Ensure that optarg etc. get declared by <unistd.h>.
authorBruno Haible <bruno@clisp.org>
Wed, 12 Aug 2009 23:09:50 +0000 (01:09 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 12 Aug 2009 23:09:50 +0000 (01:09 +0200)
ChangeLog
m4/getopt.m4
modules/getopt

index 2e4643b3e696d537f2d2184c0cbc806c47661f95..530999b137c99f254f9f365f26478c6ffde8151c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-08-12  Bruno Haible  <bruno@clisp.org>
+
+       Ensure that optarg etc. get declared by <unistd.h>.
+       * m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Require
+       AC_USE_SYSTEM_EXTENSIONS.
+       * modules/getopt (Depends-on): Add 'extensions'.
+
 2009-08-12  Bruno Haible  <bruno@clisp.org>
 
        Avoid test link errors.
index 3f8597aef8f345ad0d47d8d04fa0a1409a936558..7fefef7446e23af69f8c1a6f43b41d24c3a53016 100644 (file)
@@ -1,4 +1,4 @@
-# getopt.m4 serial 19
+# getopt.m4 serial 20
 dnl Copyright (C) 2002-2006, 2008-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -41,6 +41,9 @@ AC_DEFUN([gl_GETOPT_IFELSE],
 # Determine whether to replace the entire getopt facility.
 AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
 [
+  dnl Persuade Solaris <unistd.h> to declare optarg, optind, opterr, optopt.
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
   gl_replace_getopt=
   if test -z "$gl_replace_getopt"; then
     AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes])
index 39751bf331a2f088303549ae6abe6c9067f3b308..bad6de2c7a5cc389fe2769b1ce02a3e622af8175 100644 (file)
@@ -11,6 +11,7 @@ m4/getopt.m4
 Depends-on:
 gettext-h
 unistd
+extensions
 
 configure.ac:
 gl_GETOPT