My makefile donāt work yet but Iām reading āGNU autoconf, automake
and libtoolā so
it 'll work soon (So iām still compiling with a 1 miles long g++
commandā¦)
Note that this book is also available online.
I fully agree - that autoconf/automake stuff can scare even experienced
hackers awayā¦ heh
The secret is to learn automake AND autoconf at the same time, and
ignore all the stuff in the autoconf info files about how to construct
your makefile.inās.
You only need three files; configure.in (get a basic by running autoscan
on your directory), Makefile.am (start with the extremely simple example
in the automake info files), and a file to ābootstrapā the build
process. An example bootstrap file follows;
#!/bin/sh
This script can be used to bootstrap thxās autotool setup.
Due to a minor bug in automake version 1.4, the toplevel Makefile.in
will be patched. This is only relevant if you plan on doing a
make dist - I use that, which is why I like it to work.
echo Setting up m4 macros && \
aclocal -I config && \
aclocal &&
echo Creating headers &&
autoheader &&
echo Autogenerating Makefile.ins &&
automake --add-missing --copy &&
echo Patching toplevel Makefile.in &&
cat Makefile.in | sed ās/cp -pr $$/$/cp -pr $$d/$/ā >
Makefile.in.patch &&
mv -f Makefile.in.patch Makefile.in &&
echo Creating configure script &&
autoconf &&
echo āYou can now run ./configure --help (or ./configure && make)ā
|| echo Some kind of error happened - you can not run ./configure.
OK, Iāll stop this now, as it is probably of topic, but, really autotools
is a lot simpler than people think, if you ignore all the hairy stuff to
begin with (eventually you will need it, but by that time you will
understand the basics a lot better.
set up to compile SDL programs using G++. I think the guy who invented
Make was the first and only person to actually write a makefile.
Everyone else just copies one they found sitting around on disk some
where and editted it for their own use.
Butā¦ Iāve actualy written a few from scratch. Am I insane?
Nah, I have done that as well. It is a skill I am quickly forgetting
though. Only really relevant when you have to do very tricky things,
like crosscompiling with non-gnu tools, and stuff like that.
Mads
P.S. Make no mistake, I am no autotools guru - I have just found it to be
simpler than its rumours. Most guides/tutorials try to do way to many
things at a time.On Wed, 23 Jan 2002, David Olofson wrote:
ā
Mads Bondo Dydensborg. @Mads_Bondo_Dydensbor
Each generation has the right to determine its own culture. Culture isnāt
just symphony orchestras, movies about dead British royalty and hard-bound
books. For some, culture is now also gaming, websites, chat and messaging
systems, TV shows, music and movies.
- Jon Katz, Slashdot, on youth culture.