blob: c20fab5d13c0a1f953e15db7f4a4bd551407fb8c [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)
Emmanuel Bretelle2a103682010-09-07 17:01:20 +020016 AC_CONFIG_LINKS([lib/getopt.h:lib/gnugetopt.h])])])])
17