>>> "Simon" == Simon Waters <[EMAIL PROTECTED]> writes:

 Simon> I want to autoconf/automake the "right way" for including GNU
 Simon> getopt_long in a C program.

 Simon> Currently configure.ac has;

 Simon> AC_SUBST(LIBOBJS)

 Simon> AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS
 Simon> getopt.o getopt1.o"] )

We no longer update LIBOBJS manually today.  See the `AC_LIBOBJ
vs LIBOBJS' section of the Autoconf manual.  Also `.o' should be
`$(OBJEXT)' if portability matters (but AC_LIBOBJ will do that
for you).

Here is what I'm using to check for getopt_long
http://www.gnu.org/software/ac-archive/htmldoc/adl_func_getopt_long.html

 Simon> In ./src/ I have getopt.h getopt.c getopt1.c

 Simon> EXTRA_DIST lists relevant files to include.

 Simon> So where do I stick LIBOBJ in src/Makefile.am to best effect? 

in yourprog_LDADD or yourlib_LIBADD.

[...]

 Simon> Alas "hello" always builds it's own getopt, which is looking
 Simon> appeallingly simple at the moment. 

Many "serious" packages do that to, so perhaps it's not worth the trouble.
-- 
Alexandre Duret-Lutz



Reply via email to