2 dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
3 dnl This file is free software, distributed under the terms of the GNU
4 dnl General Public License. As a special exception to the GNU General
5 dnl Public License, this file may be distributed as part of a program
6 dnl that contains a configuration script generated by Autoconf, under
7 dnl the same distribution terms as the rest of that program.
9 # The getopt module assume you want GNU getopt, with getopt_long etc,
10 # rather than vanilla POSIX getopt. This means your your code should
11 # always include <getopt.h> for the getopt prototypes.
13 AC_DEFUN([gl_GETOPT_SUBSTITUTE],
18 AC_DEFINE([optarg], [rpl_optarg],
19 [Define to rpl_optarg if the replacement variable should be used.])
20 AC_DEFINE([optind], [rpl_optind],
21 [Define to rpl_optind if the replacement variable should be used.])
22 AC_DEFINE([opterr], [rpl_opterr],
23 [Define to rpl_opterr if the replacement variable should be used.])
24 AC_DEFINE([optopt], [rpl_optopt],
25 [Define to rpl_optopt if the replacement variable should be used.])
26 AC_DEFINE([getopt], [rpl_getopt],
27 [Define to rpl_getopt if the replacement function should be used.])
28 AC_DEFINE([getopt_long], [rpl_getopt_long],
29 [Define to rpl_getopt_long if the replacement function should be used.])
30 AC_DEFINE([getopt_long_only], [rpl_getopt_long_only],
31 [Define to rpl_getopt_long_only if the replacement function should be used.])
40 AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
41 AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
43 dnl BSD getopt_long uses an incompatible method to reset option processing,
44 dnl and (as of 2004-10-15) mishandles optional option-arguments.
45 AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
47 if test -n "$GETOPT_H"; then
52 # Prerequisites of lib/getopt*.
53 AC_DEFUN([gl_PREREQ_GETOPT], [:])