[Klug-general] autotools [was: Saturday 25th July 10am to 2pm]

james morris james at jwm-art.net
Sat Jul 18 10:41:42 UTC 2009


On 17/7/2009, "Mike Evans" <mike at tandem.f9.co.uk> wrote:

>What I have found it an excellent online presentation, that and a couple
>of other sites taught me what I now know.  Much of what I would present
>would come from this - but it is 162 slides long and goes into great
>depth so I'd be extracting a minimum for a basic talk.  All the info you
>would need on passing parameters - or setting them up in configuration
>is in there I think.
>
>   http://www.lrde.epita.fr/~adl/dl/autotools.pdf

yes, i found that too. it was not so good for me, the detail seemed
rather excessive but without enough code giving examples, plus the slide
format was a pain to navigate when trying to find info pertinent to my
intended usage. i probably should give it another go, or RTFMs of
autoconf/automake!

i found various online info, combined with looking at configure.ac &&
makefile.am files from src pkgs i'd downloaded
(libsndfile,libmatheval), and got a basic working script, but then i
found this:

http://mij.oltrelinux.com/devel/autoconf-automake/
(mind the language of the stupid example at the bottom of page).

and started over again using autoscan and pulling a few lib related lines
back from the originals i'd written.

some discussion on setting CFLAGS - or why you should not:
http://www.mail-archive.com/autoconf@gnu.org/msg14300.html

and one of the starting points:
http://www.openismus.com/documents/linux/building_libraries/building_libraries.shtml


>I've been using eclipse in conjunction with the tools and debugging has

still never tried that. i use nedit && terminal, unlikely to change.

>pkg-config should allow you to do that (assuming you mean the --exists
>flag) and config defines a variable to get you to the program on
>whatever system you end up compiling on.  There is nothing stopping you
>defining new rules in Makefile.in to use it how you want - including
>creating your own 'myconfig.h'.  You could then just use the result to
>remove the bits of your code that would fail to compile without whatever
>it is you don't have using #ifdef.  Alternatively link with your own
>version of the library which just contains null functions.  All theory
>on my part as I've never tried it.

defining rules is something which has confused me, and have not wanted to
get into that yet as i'm fairly sure i don't/shouldn't need to at
this stage. i know how to use pkg-config in a hand written
Makefile/cmdline, but in configure.ac those workings are abstracted away
by autoconf syntax. M4 is mentioned in several places. i've come to
decide though the lib won't be optional.

i'm half tempted to look at scons instead, which is supposed to address
the autotools mess.


james.



More information about the Kent mailing list