[AD] build process overhaul

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


Allegro uses a quite arcane build system. I can see at least 4 problems:

#1 Dependency generation under unix (all those misc/dep* sed scripts) is
error prone and slow (24 seconds to run "make depend" here, compared to
9 seconds running "make depend" when cross-compiling to mingw, where gcc
is used instead of sed).

#2 Use of "make depend" itself is error prone, automatic dependencies
are much better. I don't want to know how often I hunted phantom bugs
caused by forgetting make depend.

#3 It is hard to add configure checks due to use of m4. Maybe someone
thinks it is an easy to use language, but I doubt it.

#4 Platform dependence, i.e. we have separate makefiles for each
platform/compiler. (E.g. getting the split demo to compile again
everywhere took several iterations because of that.)

Now, I was looking a bit at scons, which would solve all 4 problems, but
postponed finishing a scons build for several reasons, I may add my
findings to the wiki later.

A way to solve at least #1 and #2 would be to use automake. It would be
quite some work, but basically, makefile.in would be renamed
Makefile.am, and all the misc/dep* scripts would be replaced by automake
lines like:

bin_PROGRAMS+=exsprite
exsprite_SOURCES=exsprite.c

I can see how the original author of the dep* scripts thought they could
save some typing, but it just got too hackish to be maintainable IMO, so
the change would be worth it. But, before presenting a complete patch,
are there any reasons against it?

Advantages would be:

- Time of complete first build would be reduced, since automake
dependencies are much faster than the dep* scripts.

- "make depend" would be gone, resulting in a huge speed boost when
compiling after changes.

- All the hunting for phantom bugs caused by outdated dependencies would
be gone, since automake would automatically manage dependencies, like is
done in 100ds of other projects using it.

And in the long run, having a modernized (well, if you can autotools
call so) build system would pay off in other ways, e.g. automake builds
the libraries using libtool, which is more portable than our custom
build rules, I think.

-- 
Elias Pschernig





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