m4-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to m4/ltdl/m4/m4-getopt.m4,v


From: Gary V. Vaughan
Subject: Changes to m4/ltdl/m4/m4-getopt.m4,v
Date: Tue, 04 Jul 2006 16:29:35 +0000

CVSROOT:        /sources/m4
Module name:    m4
Changes by:     Gary V. Vaughan <gary>  06/07/04 16:29:34

Index: ltdl/m4/m4-getopt.m4
===================================================================
RCS file: /sources/m4/m4/ltdl/m4/m4-getopt.m4,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ltdl/m4/m4-getopt.m4        16 Jun 2006 03:51:29 -0000      1.3
+++ ltdl/m4/m4-getopt.m4        4 Jul 2006 16:29:34 -0000       1.4
@@ -40,14 +40,32 @@
   AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
 fi
 
-dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
-dnl option string (as of 2005-05-05).
 if test -z "$GETOPT_H"; then
-  AC_CHECK_DECL([getopt_clip], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
+  AC_CACHE_CHECK([for working gnu getopt function], [gl_cv_func_gnu_getopt],
+    [AC_RUN_IFELSE(
+      [AC_LANG_PROGRAM([#include <getopt.h>],
+        [[
+         char *myargv[3];
+         myargv[0] = "conftest";
+         myargv[1] = "-+";
+         myargv[2] = 0;
+         return getopt (2, myargv, "+a") != '?';
+       ]])],
+      [gl_cv_func_gnu_getopt=yes],
+      [gl_cv_func_gnu_getopt=no],
+      [dnl cross compiling - pessimistically gues based on decls
+       dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
+       dnl option string (as of 2005-05-05).
+       AC_CHECK_DECL([getopt_clip],
+         [gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes],
+        [#include <getopt.h>])])])
+  test X"$gl_cv_func_gnu_getopt" = Xno && GETOPT_H=getopt.h
 fi
 
 if test -n "$GETOPT_H"; then
   AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
     [Define to rpl_ if the getopt replacement function should be used.])
 fi
+
+AM_CONDITIONAL([GETOPT], [test -n "$GETOPT_H"])
 ])# M4_GETOPT




reply via email to

[Prev in Thread] Current Thread [Next in Thread]