getopt: Update regarding AIX.
authorBruno Haible <bruno@clisp.org>
Fri, 30 Jul 2010 18:51:04 +0000 (20:51 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 30 Jul 2010 18:51:04 +0000 (20:51 +0200)
ChangeLog
doc/posix-functions/getopt.texi
m4/getopt.m4

index 63f9b262ef10f0fecc7b6deafa82163ab8f7a0da..f533983577b91e247ea975126786ff67602b0f50 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-07-30  Bruno Haible  <bruno@clisp.org>
+
+       getopt: Update regarding AIX.
+       * m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): When cross-compiling, guess
+       no on AIX.
+       * doc/posix-functions/getopt.texi: Mention that AIX has the optind bug.
+       Reported by Rainer Tammer.
+
 2010-07-30  Bruno Haible  <bruno@clisp.org>
 
        ldexpl; Update regarding AIX.
index 50640a8509bb6443b3a832f8218e3755ac6ec4b4..5ee2d04cba7db929595cf915a38d03e8c162d66d 100644 (file)
@@ -19,7 +19,7 @@ mingw.
 @item
 The value of @code{optind} after a missing required argument is wrong
 on some platforms:
-MacOS 10.5.
+MacOS 10.5, AIX 7.1.
 @end itemize
 
 Portability problems fixed by Gnulib module @code{getopt-gnu}:
index 5b211e5678be6ac4f24b2dfa2ea00ca5c7c1e568..caa5df43577febc5cf81fb073700c156f0efdd01 100644 (file)
@@ -1,4 +1,4 @@
-# getopt.m4 serial 28
+# getopt.m4 serial 29
 dnl Copyright (C) 2002-2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -102,7 +102,7 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
     AC_CACHE_CHECK([whether getopt is POSIX compatible],
       [gl_cv_func_getopt_posix],
       [
-        dnl This test fails on mingw and succeeds on all other platforms.
+        dnl This test fails on mingw and succeeds on many other platforms.
         AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <unistd.h>
 #include <stdlib.h>
@@ -176,7 +176,7 @@ main ()
     if (!(optind == 1))
       return 12;
   }
-  /* Detect MacOS 10.5 bug.  */
+  /* Detect MacOS 10.5, AIX 7.1 bug.  */
   {
     char *argv[3] = { "program", "-ab", NULL };
     optind = OPTIND_MIN;
@@ -196,9 +196,9 @@ main ()
 ]])],
           [gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no],
           [case "$host_os" in
-             mingw*) gl_cv_func_getopt_posix="guessing no";;
-             darwin*) gl_cv_func_getopt_posix="guessing no";;
-             *)      gl_cv_func_getopt_posix="guessing yes";;
+             mingw*)         gl_cv_func_getopt_posix="guessing no";;
+             darwin* | aix*) gl_cv_func_getopt_posix="guessing no";;
+             *)              gl_cv_func_getopt_posix="guessing yes";;
            esac
           ])
       ])