--disable-ns-self-contained
disable self contained build under NeXTstep
--enable-asserts compile code with asserts enabled
- --enable-maintainer-mode
- enable make rules and dependencies not useful (and
+ --disable-maintainer-mode
+ disable make rules and dependencies not useful (and
sometimes confusing) to the casual installer
--enable-locallisppath=PATH
directories Emacs should search for lisp files
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
gl_optind_min=1
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
gl_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min"
main ()
{
{
- int argc = 0;
- char *argv[10];
+ static char program[] = "program";
+ static char a[] = "-a";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, a, foo, bar, NULL };
int c;
- argv[argc++] = "program";
- argv[argc++] = "-a";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
optind = OPTIND_MIN;
opterr = 0;
- c = getopt (argc, argv, "ab");
+ c = getopt (4, argv, "ab");
if (!(c == 'a'))
return 1;
- c = getopt (argc, argv, "ab");
+ c = getopt (4, argv, "ab");
if (!(c == -1))
return 2;
if (!(optind == 2))
}
/* Some internal state exists at this point. */
{
- int argc = 0;
- char *argv[10];
+ static char program[] = "program";
+ static char donald[] = "donald";
+ static char p[] = "-p";
+ static char billy[] = "billy";
+ static char duck[] = "duck";
+ static char a[] = "-a";
+ static char bar[] = "bar";
+ char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
int c;
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
optind = OPTIND_MIN;
opterr = 0;
- c = getopt (argc, argv, "+abp:q:");
+ c = getopt (7, argv, "+abp:q:");
if (!(c == -1))
return 4;
if (!(strcmp (argv[0], "program") == 0))
}
/* Detect MacOS 10.5, AIX 7.1 bug. */
{
- char *argv[3] = { "program", "-ab", NULL };
+ static char program[] = "program";
+ static char ab[] = "-ab";
+ char *argv[3] = { program, ab, NULL };
optind = OPTIND_MIN;
opterr = 0;
if (getopt (2, argv, "ab:") != 'a')
and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
OSF/1 5.1, Solaris 10. */
{
- char *myargv[3];
- myargv[0] = "conftest";
- myargv[1] = "-+";
- myargv[2] = 0;
+ static char conftest[] = "conftest";
+ static char plus[] = "-+";
+ char *argv[3] = { conftest, plus, NULL };
opterr = 0;
- if (getopt (2, myargv, "+a") != '?')
+ if (getopt (2, argv, "+a") != '?')
result |= 1;
}
/* This code succeeds on glibc 2.8, mingw,
and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */
{
- char *argv[] = { "program", "-p", "foo", "bar", NULL };
+ static char program[] = "program";
+ static char p[] = "-p";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, p, foo, bar, NULL };
optind = 1;
if (getopt (4, argv, "p::") != 'p')
}
/* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */
{
- char *argv[] = { "program", "foo", "-p", NULL };
+ static char program[] = "program";
+ static char foo[] = "foo";
+ static char p[] = "-p";
+ char *argv[] = { program, foo, p, NULL };
optind = 0;
if (getopt (3, argv, "-p") != 1)
result |= 16;
}
/* This code fails on glibc 2.11. */
{
- char *argv[] = { "program", "-b", "-a", NULL };
+ static char program[] = "program";
+ static char b[] = "-b";
+ static char a[] = "-a";
+ char *argv[] = { program, b, a, NULL };
optind = opterr = 0;
if (getopt (3, argv, "+:a:b") != 'b')
result |= 64;
else if (getopt (3, argv, "+:a:b") != ':')
result |= 64;
}
+ /* This code dumps core on glibc 2.14. */
+ {
+ static char program[] = "program";
+ static char w[] = "-W";
+ static char dummy[] = "dummy";
+ char *argv[] = { program, w, dummy, NULL };
+ optind = opterr = 1;
+ if (getopt (3, argv, "W;") != 'W')
+ result |= 128;
+ }
return result;
;