>>> "Matthew" == Matthew Whitworth <[EMAIL PROTECTED]> writes:
Matthew> What I have done so far (and it seems to work), is to
Matthew> copy getopt.c and getopt.h to getopt_long.c and
Matthew> getopt_long.h, and then to use the following snippets:
Matthew> configure.in:
Matthew> AC_REPLACE_FUNCS(getopt_long)
Does someone here handle the FreeBSD case in some way? What about:
AC_CHECK_FUNCS([getopt_long],,
[#FreeBSD has a gnugetopt library for this:
AC_CHECK_LIB([gnugetopt],[getopt_long],
[AC_DEFINE([HAVE_GETOPT_LONG])],
[# use the gnu replacement
AC_LIBOBJ(getopt)
AC_LIBOBJ(getopt1)])])
Matthew> Makefile.am:
Matthew> useless_SOURCES=useless.c getopt_long.h tailor.h
Matthew> dnl This condionally links getopt_long.o
Matthew> useless_LDADD=@LIBOBJS@
Matthew> useless.c:
Matthew> #ifndef HAVE_GETOPT_LONG
Matthew> # include "getopt_long.h"
Matthew> #else
Matthew> # include <getopt.h>
Matthew> #endif
Matthew> I have no idea what tailor.h does yet, but getopt.h
Matthew> #includes it.
I don't see any use of getopt.h in the version of getopt I use.
[...]
PS: http://sources.redhat.com/ml/automake/2000-09/msg00036.html
--
Alexandre Duret-Lutz