annotate m4/getopt.m4 @ 112360:3215a5cff4dd

Declare some DEFVARs globally, not locally * gtkutil.h (x_gtk_use_old_file_dialog, x_gtk_show_hidden_files) (x_gtk_file_dialog_help_text, x_gtk_whole_detached_tool_bar): Declare. * gtkutil.c (xg_uses_old_file_dialog): (xg_get_file_with_chooser): (xg_tool_bar_detach_callback): Don't redeclare globals.
author Tom Tromey <tromey@redhat.com>
date Tue, 18 Jan 2011 10:28:28 -0700
parents d3c691ea0839
children c81ff7082a9a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
112311
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
1 # getopt.m4 serial 32
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
2 dnl Copyright (C) 2002-2006, 2008-2011 Free Software Foundation, Inc.
64639
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
6
112311
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
7 # Request a POSIX compliant getopt function.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
8 AC_DEFUN([gl_FUNC_GETOPT_POSIX],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
9 [
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
10 m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
11 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
12 gl_GETOPT_IFELSE([
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
13 gl_REPLACE_GETOPT
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
14 ],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
15 [])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
16 ])
64639
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
17
112311
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
18 # Request a POSIX compliant getopt function with GNU extensions (such as
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
19 # options with optional arguments) and the functions getopt_long,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
20 # getopt_long_only.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
21 AC_DEFUN([gl_FUNC_GETOPT_GNU],
64639
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
22 [
112311
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
23 m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
24
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
25 AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
26 ])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
27
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
28 # Request the gnulib implementation of the getopt functions unconditionally.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
29 # argp.m4 uses this.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
30 AC_DEFUN([gl_REPLACE_GETOPT],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
31 [
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
32 dnl Arrange for getopt.h to be created.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
33 gl_GETOPT_SUBSTITUTE_HEADER
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
34 dnl Arrange for unistd.h to include getopt.h.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
35 GNULIB_UNISTD_H_GETOPT=1
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
36 dnl Arrange to compile the getopt implementation.
64639
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
37 AC_LIBOBJ([getopt])
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
38 AC_LIBOBJ([getopt1])
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
39 gl_PREREQ_GETOPT
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
40 ])
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
41
112311
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
42 # emacs' configure.in uses this.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
43 AC_DEFUN([gl_GETOPT_IFELSE],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
44 [
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
45 AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
46 AS_IF([test -n "$gl_replace_getopt"], [$1], [$2])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
47 ])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
48
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
49 # Determine whether to replace the entire getopt facility.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
50 AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
51 [
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
52 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
53 AC_REQUIRE([AC_PROG_AWK]) dnl for awk that supports ENVIRON
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
54
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
55 dnl Persuade Solaris <unistd.h> to declare optarg, optind, opterr, optopt.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
56 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
57
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
58 gl_CHECK_NEXT_HEADERS([getopt.h])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
59 AC_CHECK_HEADERS_ONCE([getopt.h])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
60 if test $ac_cv_header_getopt_h = yes; then
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
61 HAVE_GETOPT_H=1
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
62 else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
63 HAVE_GETOPT_H=0
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
64 fi
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
65 AC_SUBST([HAVE_GETOPT_H])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
66
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
67 gl_replace_getopt=
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
68
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
69 dnl Test whether <getopt.h> is available.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
70 if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
71 AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
72 fi
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
73
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
74 dnl Test whether the function getopt_long is available.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
75 if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
76 AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
77 fi
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
78
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
79 dnl BSD getopt_long uses an incompatible method to reset option processing.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
80 dnl Existence of the variable, in and of itself, is not a reason to replace
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
81 dnl getopt, but knowledge of the variable is needed to determine how to
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
82 dnl reset and whether a reset reparses the environment.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
83 dnl Solaris supports neither optreset nor optind=0, but keeps no state that
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
84 dnl needs a reset beyond setting optind=1; detect Solaris by getopt_clip.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
85 if test -z "$gl_replace_getopt"; then
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
86 AC_CHECK_DECLS([optreset], [],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
87 [AC_CHECK_DECLS([getopt_clip], [], [],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
88 [[#include <getopt.h>]])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
89 ],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
90 [[#include <getopt.h>]])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
91 fi
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
92
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
93 dnl mingw's getopt (in libmingwex.a) does weird things when the options
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
94 dnl strings starts with '+' and it's not the first call. Some internal state
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
95 dnl is left over from earlier calls, and neither setting optind = 0 nor
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
96 dnl setting optreset = 1 get rid of this internal state.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
97 dnl POSIX is silent on optind vs. optreset, so we allow either behavior.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
98 dnl POSIX 2008 does not specify leading '+' behavior, but see
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
99 dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
100 dnl the next version of POSIX. For now, we only guarantee leading '+'
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
101 dnl behavior with getopt-gnu.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
102 if test -z "$gl_replace_getopt"; then
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
103 AC_CACHE_CHECK([whether getopt is POSIX compatible],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
104 [gl_cv_func_getopt_posix],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
105 [
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
106 dnl This test fails on mingw and succeeds on many other platforms.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
107 AC_RUN_IFELSE([AC_LANG_SOURCE([[
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
108 #include <unistd.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
109 #include <stdlib.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
110 #include <string.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
111
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
112 #if !HAVE_DECL_OPTRESET && !HAVE_DECL_GETOPT_CLIP
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
113 # define OPTIND_MIN 0
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
114 #else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
115 # define OPTIND_MIN 1
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
116 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
117
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
118 int
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
119 main ()
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
120 {
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
121 {
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
122 int argc = 0;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
123 char *argv[10];
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
124 int c;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
125
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
126 argv[argc++] = "program";
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
127 argv[argc++] = "-a";
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
128 argv[argc++] = "foo";
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
129 argv[argc++] = "bar";
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
130 argv[argc] = NULL;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
131 optind = OPTIND_MIN;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
132 opterr = 0;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
133
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
134 c = getopt (argc, argv, "ab");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
135 if (!(c == 'a'))
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
136 return 1;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
137 c = getopt (argc, argv, "ab");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
138 if (!(c == -1))
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
139 return 2;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
140 if (!(optind == 2))
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
141 return 3;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
142 }
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
143 /* Some internal state exists at this point. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
144 {
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
145 int argc = 0;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
146 char *argv[10];
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
147 int c;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
148
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
149 argv[argc++] = "program";
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
150 argv[argc++] = "donald";
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
151 argv[argc++] = "-p";
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
152 argv[argc++] = "billy";
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
153 argv[argc++] = "duck";
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
154 argv[argc++] = "-a";
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
155 argv[argc++] = "bar";
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
156 argv[argc] = NULL;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
157 optind = OPTIND_MIN;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
158 opterr = 0;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
159
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
160 c = getopt (argc, argv, "+abp:q:");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
161 if (!(c == -1))
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
162 return 4;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
163 if (!(strcmp (argv[0], "program") == 0))
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
164 return 5;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
165 if (!(strcmp (argv[1], "donald") == 0))
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
166 return 6;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
167 if (!(strcmp (argv[2], "-p") == 0))
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
168 return 7;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
169 if (!(strcmp (argv[3], "billy") == 0))
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
170 return 8;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
171 if (!(strcmp (argv[4], "duck") == 0))
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
172 return 9;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
173 if (!(strcmp (argv[5], "-a") == 0))
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
174 return 10;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
175 if (!(strcmp (argv[6], "bar") == 0))
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
176 return 11;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
177 if (!(optind == 1))
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
178 return 12;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
179 }
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
180 /* Detect MacOS 10.5, AIX 7.1 bug. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
181 {
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
182 char *argv[3] = { "program", "-ab", NULL };
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
183 optind = OPTIND_MIN;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
184 opterr = 0;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
185 if (getopt (2, argv, "ab:") != 'a')
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
186 return 13;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
187 if (getopt (2, argv, "ab:") != '?')
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
188 return 14;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
189 if (optopt != 'b')
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
190 return 15;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
191 if (optind != 2)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
192 return 16;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
193 }
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
194
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
195 return 0;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
196 }
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
197 ]])],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
198 [gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
199 [case "$host_os" in
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
200 mingw*) gl_cv_func_getopt_posix="guessing no";;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
201 darwin* | aix*) gl_cv_func_getopt_posix="guessing no";;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
202 *) gl_cv_func_getopt_posix="guessing yes";;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
203 esac
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
204 ])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
205 ])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
206 case "$gl_cv_func_getopt_posix" in
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
207 *no) gl_replace_getopt=yes ;;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
208 esac
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
209 fi
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
210
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
211 if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
212 AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_getopt_gnu],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
213 [# Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
214 # optstring is necessary for programs like m4 that have POSIX-mandated
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
215 # semantics for supporting options interspersed with files.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
216 # Also, since getopt_long is a GNU extension, we require optind=0.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
217 # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
218 # so take care to revert to the correct (non-)export state.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
219 dnl GNU Coding Standards currently allow awk but not env; besides, env
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
220 dnl is ambiguous with environment values that contain newlines.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
221 gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }'
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
222 case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
223 xx) gl_had_POSIXLY_CORRECT=exported ;;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
224 x) gl_had_POSIXLY_CORRECT=yes ;;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
225 *) gl_had_POSIXLY_CORRECT= ;;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
226 esac
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
227 POSIXLY_CORRECT=1
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
228 export POSIXLY_CORRECT
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
229 AC_RUN_IFELSE(
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
230 [AC_LANG_PROGRAM([[#include <getopt.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
231 #include <stddef.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
232 #include <string.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
233 ]], [[
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
234 int result = 0;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
235 /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
236 and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
237 OSF/1 5.1, Solaris 10. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
238 {
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
239 char *myargv[3];
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
240 myargv[0] = "conftest";
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
241 myargv[1] = "-+";
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
242 myargv[2] = 0;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
243 opterr = 0;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
244 if (getopt (2, myargv, "+a") != '?')
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
245 result |= 1;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
246 }
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
247 /* This code succeeds on glibc 2.8, mingw,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
248 and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
249 IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
250 {
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
251 char *argv[] = { "program", "-p", "foo", "bar", NULL };
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
252
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
253 optind = 1;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
254 if (getopt (4, argv, "p::") != 'p')
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
255 result |= 2;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
256 else if (optarg != NULL)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
257 result |= 4;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
258 else if (getopt (4, argv, "p::") != -1)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
259 result |= 6;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
260 else if (optind != 2)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
261 result |= 8;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
262 }
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
263 /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
264 {
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
265 char *argv[] = { "program", "foo", "-p", NULL };
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
266 optind = 0;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
267 if (getopt (3, argv, "-p") != 1)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
268 result |= 16;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
269 else if (getopt (3, argv, "-p") != 'p')
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
270 result |= 32;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
271 }
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
272 /* This code fails on glibc 2.11. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
273 {
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
274 char *argv[] = { "program", "-b", "-a", NULL };
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
275 optind = opterr = 0;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
276 if (getopt (3, argv, "+:a:b") != 'b')
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
277 result |= 64;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
278 else if (getopt (3, argv, "+:a:b") != ':')
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
279 result |= 64;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
280 }
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
281 return result;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
282 ]])],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
283 [gl_cv_func_getopt_gnu=yes],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
284 [gl_cv_func_getopt_gnu=no],
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
285 [dnl Cross compiling. Guess based on host and declarations.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
286 case $host_os:$ac_cv_have_decl_optreset in
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
287 *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
288 *:yes) gl_cv_func_getopt_gnu=no;;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
289 *) gl_cv_func_getopt_gnu=yes;;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
290 esac
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
291 ])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
292 case $gl_had_POSIXLY_CORRECT in
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
293 exported) ;;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
294 yes) AS_UNSET([POSIXLY_CORRECT]); POSIXLY_CORRECT=1 ;;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
295 *) AS_UNSET([POSIXLY_CORRECT]) ;;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
296 esac
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
297 ])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
298 if test "$gl_cv_func_getopt_gnu" = "no"; then
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
299 gl_replace_getopt=yes
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
300 fi
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
301 fi
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
302 ])
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
303
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
304 # emacs' configure.in uses this.
64639
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
305 AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
306 [
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
307 GETOPT_H=getopt.h
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
308 AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
309 [Define to rpl_ if the getopt replacement functions and variables
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
310 should be used.])
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
311 AC_SUBST([GETOPT_H])
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
312 ])
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
313
112311
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
314 # Prerequisites of lib/getopt*.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
315 # emacs' configure.in uses this.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
316 AC_DEFUN([gl_PREREQ_GETOPT],
64639
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
317 [
112311
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents: 75249
diff changeset
318 AC_CHECK_DECLS_ONCE([getenv])
64639
385af3e03206 Merge gnulib getopt implementation into Emacs.
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
319 ])