I just started doing auto tools stuff for the last 4 months, after looking
at it over a year ago and failing to understand it. The 'Goat' book does a
decent job of explaining things, but an additional book that follows the
'Perl Cookbook' would be even better. One thing that the autotools
highlight very well is how many things could be different from system to
system.

Currently the project that I'm using Autoconf for doesn't take any
advantage of the defines that configure defines. But at least it looks
cool when I type ./configure! ;-)

Now, here's a autotools question. What's the best way of allowing the user
to supply a path to a library that your package needs? I currently have
this:

configure.in:

AC_ARG_WITH(cfg,
'Path to cfg libs',
[CFG_PATH="$withval"],
[CFG_PATH="../conf"]
)

AC_SUBST(CFG_PATH)

AC_ARG_WITH(log,
'Path to log libs',
[LOG_PATH="$withval"],
[LOG_PATH="../log"]
)

AC_SUBST(LOG_PATH)


Makefile.am:

INCLUDES= -I@CFG_PATH@ -I@LOG_PATH@
<..some stuff>
feeder_LDADD = @CFG_PATH@/libcfg.a @LOG_PATH@/liblog.a
<..some stuff>


if just ./configure is invoked without any options, the ../conf and ../log
paths are used. using --with-cfg=/some/path and --with-log=/some/path
would overide the defaults. This works, but I feel it's not the best way
to do things. Further, I would like configure the complain when it can't
find the library.

Anyway, if someone else is struggling, please ask here too.





**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to