bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] extensions: port better to MINUX 3, HP-UX, autoheader 2.62


From: Paul Eggert
Subject: [PATCH] extensions: port better to MINUX 3, HP-UX, autoheader 2.62
Date: Wed, 06 Feb 2013 22:43:01 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

Some of these changes are merged in from git Autoconf.
* m4/extensions.m4 (AC_USE_SYSTEM_EXTENSIONS):
When deciding whether to define _XOPEN_SOURCE, inspect the
preprocessor macro __hpux instead of the more-heavyweight
operation of requiring AC_CANONICAL_HOST.  Define _NETBSD_HOST on
MINUX, for MINUX 3.  Use USE_SYSTEM_EXTENSIONS, not __EXTENSIONS__,
as the key for __EXTENSIONS__.
---
 ChangeLog        |  9 +++++++++
 m4/extensions.m4 | 28 +++++++++++++---------------
 2 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 25db57d..e3fb3bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2013-02-06  Paul Eggert  <address@hidden>
 
+       extensions: port better to MINUX 3, HP-UX, autoheader 2.62
+       Some of these changes are merged in from git Autoconf.
+       * m4/extensions.m4 (AC_USE_SYSTEM_EXTENSIONS):
+       When deciding whether to define _XOPEN_SOURCE, inspect the
+       preprocessor macro __hpux instead of the more-heavyweight
+       operation of requiring AC_CANONICAL_HOST.  Define _NETBSD_HOST on
+       MINUX, for MINUX 3.  Use USE_SYSTEM_EXTENSIONS, not __EXTENSIONS__,
+       as the key for __EXTENSIONS__.
+
        unistd: avoid namespace pollution on non-glibc systems
        * lib/unistd.in.h: #define __need_getopt before including <getopt.h>.
        This avoids namespace pollution on non-glibc systems, by causing
diff --git a/m4/extensions.m4 b/m4/extensions.m4
index 617323b..33daf38 100644
--- a/m4/extensions.m4
+++ b/m4/extensions.m4
@@ -1,4 +1,4 @@
-# serial 12  -*- Autoconf -*-
+# serial 13  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
 # Copyright (C) 2003, 2006-2013 Free Software Foundation, Inc.
@@ -30,6 +30,7 @@
 # ------------------------
 # Enable extensions on systems that normally disable them,
 # typically due to standards-conformance issues.
+#
 # Remember that #undef in AH_VERBATIM gets replaced with #define by
 # AC_DEFINE.  The goal here is to define all known feature-enabling
 # macros, then, if reports of conflicts are made, disable macros that
@@ -38,8 +39,6 @@ AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
 [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 
-  AC_REQUIRE([AC_CANONICAL_HOST])
-
   AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
   if test "$MINIX" = yes; then
     AC_DEFINE([_POSIX_SOURCE], [1],
@@ -50,24 +49,18 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
        except with this defined.])
     AC_DEFINE([_MINIX], [1],
       [Define to 1 if on MINIX.])
+    AC_DEFINE([_NETBSD_SOURCE], [1],
+      [Define to 1 to make NetBSD features available.  MINIX 3 needs this.])
   fi
 
-  dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
-  dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
-  dnl provided.
-  case "$host_os" in
-    hpux*)
-      AC_DEFINE([_XOPEN_SOURCE], [500],
-        [Define to 500 only on HP-UX.])
-      ;;
-  esac
-
-  AH_VERBATIM([__EXTENSIONS__],
+dnl Use a different key than __EXTENSIONS__, as that name broke existing
+dnl configure.ac when using autoheader 2.62.
+  AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
 [/* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
-/* Enable general extensions on Mac OS X.  */
+/* Enable general extensions on OS X.  */
 #ifndef _DARWIN_C_SOURCE
 # undef _DARWIN_C_SOURCE
 #endif
@@ -75,6 +68,11 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
 #endif
+/* HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
+   regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1.  */
+#ifdef __hpux
+# define _XOPEN_SOURCE 500
+#endif
 /* Enable threading extensions on Solaris.  */
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
-- 
1.7.11.7




reply via email to

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