This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: Newbie: getopt - the right way
- From: Alexandre Duret-Lutz <duret_g at lrde dot epita dot fr>
- To: Simon Waters <Simon at wretched dot demon dot co dot uk>
- Cc: automake at gnu dot org
- Date: Sun, 09 Mar 2003 19:56:48 +0100
- Subject: Re: Newbie: getopt - the right way
- References: <b4agac$n85$1@main.gmane.org>
>>> "Simon" == Simon Waters <Simon at wretched dot demon dot co dot uk> 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