bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] patch for AC_GNU_SOURCE on Solaris


From: Paul Eggert
Subject: Re: [Bug-gnulib] patch for AC_GNU_SOURCE on Solaris
Date: 08 Aug 2003 13:19:27 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Bruno Haible <address@hidden> writes:

> >    dnl Prerequisites of lib/timespec.h.
> > +  AC_REQUIRE([AC_GNU_SOURCE])
> 
> This is confusing because lib/timespec.h doesn't need _GNU_SOURCE.
> I'd prefer either the creation of a separate macro AC_SOLARIS_SOURCE,
> or renaming AC_GNU_SOURCE into AC_USE_SYSTEM_EXTENSIONS.

OK.  Also, an advantage of this approach is that we can leave
AC_GNU_SOURCE alone, which will make it less likely that we'll break
somethiing.

I'd rather have the 2nd alternative you mention, since I want to have
a single macro that means 'use all extensions that are available; do
not worry about namespace pollution'.  That's more convenient for
Autoconfized scripts.

So I installed this patch.

Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnulib/gnulib/ChangeLog,v
retrieving revision 1.72
diff -p -u -r1.72 ChangeLog
--- ChangeLog   7 Aug 2003 19:33:14 -0000       1.72
+++ ChangeLog   8 Aug 2003 20:13:25 -0000
@@ -1,3 +1,9 @@
+2003-08-08  Paul Eggert  <address@hidden>
+
+       * MODULES.html.sh (func_all_modules): Add extensions, gnu-source.
+       * modules/extensions, modules/gnu-source: New files.
+       * modules/timespec, modules/unlocked-io: Depend on extensions.
+
 2003-08-07 Paul Eggert  <address@hidden>
 
        * modules/restrict: New file.
Index: MODULES.html.sh
===================================================================
RCS file: /cvsroot/gnulib/gnulib/MODULES.html.sh,v
retrieving revision 1.31
diff -p -u -r1.31 MODULES.html.sh
--- MODULES.html.sh     7 Aug 2003 19:33:14 -0000       1.31
+++ MODULES.html.sh     8 Aug 2003 20:13:25 -0000
@@ -1884,10 +1884,12 @@ func_all_modules ()
   func_module exitfail
   func_module c-stack
   func_module error
+  func_module extensions
   func_module fatal
   func_module getloadavg
   func_module getpagesize
   func_module getusershell
+  func_module gnu-source
   func_module physmem
   func_module posixver
   func_module quotearg
Index: m4/ChangeLog
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/ChangeLog,v
retrieving revision 1.470
diff -p -u -r1.470 ChangeLog
--- m4/ChangeLog        7 Aug 2003 19:33:14 -0000       1.470
+++ m4/ChangeLog        8 Aug 2003 20:13:30 -0000
@@ -1,3 +1,11 @@
+2003-08-08  Paul Eggert  <address@hidden>
+
+       * extensions.m4: New file.
+       * timespec.m4 (jm_CHECK_TYPE_STRUCT_TIMESPEC):
+       Require gl_USE_SYSTEM_EXTENSIONS.
+       * unlocked-io.m4 (jm_FUNC_GLIBC_UNLOCKED_IO):
+       Require gl_USE_SYSTEM_EXTENSIONS rather than AC_GNU_SOURCE.
+
 2003-08-07  Paul Eggert  <address@hidden>
 
        * restrict.m4: New file.
Index: m4/timespec.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/timespec.m4,v
retrieving revision 1.6
diff -p -u -r1.6 timespec.m4
--- m4/timespec.m4      31 Dec 2002 13:43:06 -0000      1.6
+++ m4/timespec.m4      8 Aug 2003 20:13:30 -0000
@@ -1,4 +1,4 @@
-#serial 6
+#serial 7
 
 dnl From Jim Meyering
 
@@ -21,6 +21,9 @@ dnl in time.h or sys/time.h.
 
 AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC],
 [
+  dnl Persuade pedantic Solaris to declare struct timespec.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
   AC_REQUIRE([AC_HEADER_TIME])
   AC_CHECK_HEADERS_ONCE(sys/time.h)
   AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
Index: m4/unlocked-io.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/unlocked-io.m4,v
retrieving revision 1.1
diff -p -u -r1.1 unlocked-io.m4
--- m4/unlocked-io.m4   31 Dec 2002 13:42:07 -0000      1.1
+++ m4/unlocked-io.m4   8 Aug 2003 20:13:30 -0000
@@ -1,4 +1,4 @@
-#serial 7 -*- autoconf -*-
+#serial 8 -*- autoconf -*-
 
 dnl From Jim Meyering.
 dnl
@@ -10,9 +10,9 @@ dnl on Solaris 2.6).
 
 AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
 [
-  dnl Persuade glibc <stdio.h> to declare fgets_unlocked(), fputs_unlocked()
-  dnl etc.
-  AC_REQUIRE([AC_GNU_SOURCE])
+  dnl Persuade glibc and Solaris <stdio.h> to declare
+  dnl fgets_unlocked(), fputs_unlocked() etc.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
   AC_CHECK_DECLS_ONCE(
      [clearerr_unlocked feof_unlocked ferror_unlocked
Index: modules/timespec
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/timespec,v
retrieving revision 1.3
diff -p -u -r1.3 timespec
--- modules/timespec    20 Jan 2003 10:02:38 -0000      1.3
+++ modules/timespec    8 Aug 2003 20:13:30 -0000
@@ -7,6 +7,7 @@ m4/st_mtim.m4
 m4/timespec.m4
 
 Depends-on:
+extensions
 
 configure.ac:
 gl_TIMESPEC
Index: modules/unlocked-io
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/unlocked-io,v
retrieving revision 1.3
diff -p -u -r1.3 unlocked-io
--- modules/unlocked-io 20 Jan 2003 10:02:38 -0000      1.3
+++ modules/unlocked-io 8 Aug 2003 20:13:30 -0000
@@ -6,6 +6,7 @@ lib/unlocked-io.h
 m4/unlocked-io.m4
 
 Depends-on:
+extensions
 
 configure.ac:
 jm_FUNC_GLIBC_UNLOCKED_IO
--- /dev/null   Tue Mar 18 13:55:57 2003
+++ m4/extensions.m4    Fri Aug  8 13:05:26 2003
@@ -0,0 +1,15 @@
+# gl_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], [
+  AC_REQUIRE([AC_GNU_SOURCE])
+  AH_VERBATIM([__EXTENSIONS__],
+[/* Enable extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif])
+  AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+  AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+  AC_DEFINE([__EXTENSIONS__])
+])
--- /dev/null   Tue Mar 18 13:55:57 2003
+++ modules/extensions  Fri Aug  8 13:11:42 2003
@@ -0,0 +1,18 @@
+Description:
+Enable extensions in standard headers
+
+Files:
+m4/extensions.m4
+
+Depends-on:
+
+configure.ac:
+gl_USE_SYSTEM_EXTENSIONS
+
+Makefile.am:
+
+Include:
+
+Maintainer:
+Paul Eggert and Jim Meyering
+
--- /dev/null   Tue Mar 18 13:55:57 2003
+++ modules/gnu-source  Fri Aug  8 11:55:34 2003
@@ -0,0 +1,18 @@
+Description:
+Enable GNU extensions in standard headers
+
+Files:
+m4/gnu-source.m4
+
+Depends-on:
+
+configure.ac:
+AC_GNU_SOURCE
+
+Makefile.am:
+
+Include:
+
+Maintainer:
+Paul Eggert and Jim Meyering
+




reply via email to

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