Tugger the SLUGger!SLUG Mailing List Archives

Re: [chat] portable scripting


On Wed, Jan 29, 2003 at 11:26:56PM +1100, Jamie Wilkinson wrote:
> This one time, at band camp, Andre Pang wrote:
> >Crikey.  As standard as the autotools are, it's remarkable they work at 
> >all considering all of this bizarre whacko behaviour ...
> 
> I (heart) autoblah. ;-)  I can't even remember how to write a normal
> makefile!
> 
> In fact, automake does such cool things (like make dist, make check) that
> even when linux achieves world domination everyone will still be using them.
> They'll just be a lot simpler.

Well, I recently did a "lisp-like" function interpreter for work which had
to compile on Linux, Solaris and BSD (and on a system with gcc installed in
/opt/sfw/gnu/bin/gcc and autoconf in /usr/local/gnu/autoconf/bin/autoconf
and other stuff in equally wierd places, because according to the sysadmin
"it makes it easier".  Yeah.).  Anyway, php, perl, python and C interfaces
were required.  <sarcasm>Fortunately</sarcasm>, the three p's each provide
their own unique way to build and install extensions.  Not much fun.

For Perl I tried to use the Makefile.master technique, but in the end gave
up and instead left it to its own devices with a fudge in the parent
directory to create the perl/Makefile from the perl/Makefile.PL which, as it
turns out, likes to rebuid every time for some reason, even when doing a
make test (perl's generated Makefile doesn't have make check, so I have to
use make test).  This probably isn't portable across make versions, but I
haven't had a problem so far.

Python was ok - I just had to wrap the setup.py with a Makefile.in.

And php was fine once I stopped trying to create the .so not starting with
"lib".

In the end, though, it took less than a day to write the code (and seperate
Makefiles for the three architectures), and about a week (and half a head of
hair) to sort out the autotools stuff.  And in terms of numbers of lines,
the configure script ended up being longer than all the C code put together.
At least now I can truly say that I understand autoconf 2.5x, which is
probably good for another, maybe, 2 months? :)

Pete
-- 
Pete Ryland
http://pdr.cx/