Re: [AD] Fixes for Allegro on FreeBSD.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sun, May 14, 2000 at 06:21:13PM +0200, dentoir wrote:
> I managed to get Allegro 3.9.32 running on FreeBSD 3.4 (i386) and I encountered
> two small problems. First, during the build gcc choked on tools/datedit.c:1317.
> Allegro expects FreeBSD to have a timezone variable in time.h but there is
> no such variable. Maybe you should define ALLEGRO_NO_TIMEZONE in
> include/allegro/alunix.h or somewhere else or maybe do a check in the configure
> script. FreeBSD does have an old timezone() function (not var) declared in
> time.h though, so the script might get confused.

That's OK, it's pretty simple to make the script check that it's
what Allegro expects it to be -- it basically works by
generating a small piece of source code, and seeing whether it
compiles, links, or even runs, depending upon what sort of test
you ask for.

> Second, the code in src/unix/usystem.c expects a system which supports
> sched_yield() to #define _POSIX_PRIORITY_SCHEDULING in unistd.h
> FreeBSD does define this and does recognize the call but does not
> actually support it. The kernel will give a warning message on the screen
> and the function will return -1. FreeBSD does not expect the program to
> use the function again after it failed, but Allegro already thinks the
> function is supported so the screen gets flooded by thousands of warning
> messages. The solution would be to try the function and if it fails
> the first time, don't call it again.

Would it be better to do this, or to make the configure script
test calling the function and list it as unavailable if the
function fails?  Again, it's not hard to make the configure
script do this; the question is, should this be a run-time
choice (which clutters the code a bit) or a compile-time choice?
In actual fact, it seems the `select' code yields in a way more
like what most people expect, so maybe we should just use that,
even if `sched_yield' is available.

George

-- 
Random project update:
27/04/2000: AllegroGL alpha 7 released, fixing silly omission in alpha 6
        http://AllegroGL.sourceforge.net/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/