Advertisement

Autoconf/automake.

Started by February 03, 2005 06:27 PM
2 comments, last by thec 19 years, 9 months ago
I need to learn how to use these. For the last days I've been struggeling through the reference manuals, and tried to find some decent material off google, but there isn't really anything out there which has really teched me something (been at gnu.org) First off, I should say I'm a bad reader, I can't read through a 200 page manual wichout getting anywhere until towards to the end. I just don't read books at all (perhaps a slight dyslexia) so please don't post a link to a 300 page manual, it won't help. What I would need to know is the following: 1) Most tutorials I've seen deals with simple examples with executables, I'd like to know what to do to inclorperate configure scripts with libraries, this is mainly what I will use it for and there it is useful in the first place, no? Is it really that hard to find an example.zip on the net? It seems like it... 2) This is important. Do I need/want automake as well? I just don't know... I like the control that a makefile gives me, and I can dig them even if I find some parts hard sometimes (especially concerning several build directories and such). I can do a makefile, but now I need to compile on a mac and some root path was wrong so I figured autoconf should be the tool, but should I use automake as well? If you know some good tutorials (not reference manuals, I know where they are at) please post your links. I basicly need something which explains the fundamentals better than anything else. Albert EDIT: FUI, this is not my homework, nor my work, this is for hobby projects and I'm not a professional. Just to make that clear.
-------------------------------------------http://www.thec.org
I don't think you can use autoconf without automake, they are pretty much meant for each other.

I have found this online book usefull (site seems to be down right now). It explains enough to get you started.

Edit: This seems to be a working link
"THE INFORMATION CONTAINED IN THIS REPORT IS CLASSIFIED; DO NOT GO TO FOX NEWS TO READ OR OBTAIN A COPY." , the pentagon
Advertisement
I found that learning automake is easier by downloading some small project that uses it and looking at the critical files:
- configure.ac (or the older configure.in)
- Makefile.am (usually found in each directory)
- autogen.sh (may be named diffrently. This runs autoconf, automake and some other things in the correct order)

Here is the autogen.sh from my project that I mostly copied from someone I can't remember.
#!/bin/sh# Enable environment variables to override tool commands.: ${AUTOCONF=autoconf}: ${AUTOHEADER=autoheader}: ${AUTOMAKE=automake}: ${ACLOCAL=aclocal}: ${LIBTOOLIZE=libtoolize}rm -rf autom4te.cacherm -f aclocal.m4echo "Running $ACLOCAL..."$ACLOCAL || exit 1echo "Running $AUTOHEADER..."$AUTOHEADER || exit 1echo "Running $AUTOCONF..."$AUTOCONF || exit 1echo "Running $LIBTOOLIZE..."$LIBTOOLIZE --automake --copy --force || exit 1echo "Running $AUTOMAKE..."$AUTOMAKE -a -c || exit 1if [ "$1" == "-c" ]; then	echo "Running configure with developer options..."	echo	sleep 1s	./configure --enable-debug --enable-warningselse	echo	echo "autogen.sh completed successfully."	echo "Now run ./configure with the appropriate flags and then make."fi

Thanks both of you.

Funny thing, since I'm using kdevelop, the other day I thought I should look at the configure.ac and makefile.am it produces to learn, ends up that I can't create a new project (blank options under C++) and since I never do this that doesn't really matter, but this time that was kinda the last thing that could go wrong for me :-)

I thank you for the answers and I'll check into that redhat manual as soon as the page works (or your extra one, doesn't seem so for me right now).

Albert
-------------------------------------------http://www.thec.org

This topic is closed to new replies.

Advertisement