blob: 2aea10b182dc32a52171bc5a9734e851d9e7eb54 [file] [log] [blame]
jjakoff9985c2004-01-16 11:05:22 +00001dnl Available from the GNU Autoconf Macro Archive at:
2dnl http://www.gnu.org/software/ac-archive/htmldoc/adl_func_getopt_long.html
3dnl
4AC_DEFUN([adl_FUNC_GETOPT_LONG],
5 [AC_PREREQ(2.49)dnl
6 # clean out junk possibly left behind by a previous configuration
7 rm -f lib/getopt.h
8 # Check for getopt_long support
9 AC_CHECK_HEADERS([getopt.h])
10 AC_CHECK_FUNCS([getopt_long],,
11 [# FreeBSD has a gnugetopt library for this
12 AC_CHECK_LIB([gnugetopt],[getopt_long],[AC_DEFINE([HAVE_GETOPT_LONG])],
13 [# use the GNU replacement
14 AC_LIBOBJ(getopt)
15 AC_LIBOBJ(getopt1)
16 AC_CONFIG_LINKS([ggsn/getopt.h:ggsn/gnugetopt.h])
17 AC_CONFIG_LINKS([sgsnemu/getopt.h:sgsnemu/gnugetopt.h])])])])