[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie: getopt - the right way

From: Alexandre Duret-Lutz
Subject: Re: Newbie: getopt - the right way
Date: Sun, 09 Mar 2003 19:56:48 +0100
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.2 (gnu/linux)

>>> "Simon" == Simon Waters <address@hidden> writes:

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

 Simon> Currently has;


 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

 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/ 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

[Prev in Thread] Current Thread [Next in Thread]