[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getopt question
Gary V. Vaughan
Re: getopt question
Mon, 20 Nov 2000 20:28:30 +0000
On Sun, Nov 19, 2000 at 02:54:54PM -0500, Matthew R. MacIntyre wrote:
> In a package I'm contributing to, we're looking for a way to include GNU
> getopt in the sources if the build system does not have it installed.
> I looked around for a way to do this, and the only thing semi-useful I
> found was the AC_REPLACE_GNU_GETOPT macro.
> Does this actually work? Whenever I use it in the configure.in I get a
> ./configure: AC_REPLACE_GNU_GETOPT: command not found
> I figure I must either be missing something, or this is broken?
You also need the AC_REPLACE_GNU_GETOPT macro definition... but I
don't know where you might find that -- at the autoconf macro
> If this macro does work, how are the sources setup in the Makefile.am.
> Currently, here's what I have, which I'm pretty sure is wrong:
> EXTRA_DIST = getopt.c getopt.h getopt1.c
> getopt.o: getopt.c
> $(CC) $(CFLAGS) -c getopt.c
> getopt1.o: getopt1.c
> $(CC) $(CFLAGS) -c getopt1.c
> Any suggestions would be very greatly appreciated. This one has been
> frustrating me for some time now.
>From the rather excellent ``GNU Autoconf, Automake and Libtool'' =)O|
$ ls replace/
[LIBOBJS="$LIBOBJS getopt.$ac_objext getopt1.$objext"
rm -f replace/getopt.h
$LN_S ./gnu-getopt.h replace/getopt.h])
Xsed="sed -e s/^X//"
LTLIBOBJS=`echo "$LIBOBJS | \
[$Xsed -e "s,\.[^.]* ,.lo ,g;s,\.[^.]*$,.lo,"]
noinst_HEADERS = gnu-getopt.h
noinst_LTLIBRARIES = libreplace.la
libreplace_la_LIBADD = @LTLIBOBJS@
But if you want to understand all the hoops this code jumps through,
you will need to reads the book =)O|
___ _ ___ __ _ mailto: address@hidden
/ __|__ _ _ ___ _| | / / | / /_ _ _ _ __ _| |_ __ _ ___ address@hidden
| (_ / _` | '_|// / |/ /| |/ / _` | || / _` | ' \/ _` | _ \
\___\__,_|_|\_, /|___(_)___/\__,_|\_,_\__, |_||_\__,_|//_/
home page: /___/ /___/ gpg public key: