bug-gnulib
[Top][All Lists]
Advanced

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

gnulib (+ coreutils) patch for Solaris 10 pedantic <time.h>


From: Paul Eggert
Subject: gnulib (+ coreutils) patch for Solaris 10 pedantic <time.h>
Date: Wed, 01 Mar 2006 23:40:24 -0800

When Solaris 10 is compiled pedantically, its <time.h> does not
declare nanosleep or clock_gettime unless you define __EXTENSIONS__.
I assume the same thing applies to earlier Solaris versions as well.
This could cause 'configure' to wrongly conclude that the functions
are not available.  To work around this, I installed the following
patch into gnulib (and propagated it into coreutils, not that
coreutils should notice as it already defines __EXTENSIONS__).

Index: m4/clock_time.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/clock_time.m4,v
retrieving revision 1.6
diff -p -u -r1.6 clock_time.m4
--- m4/clock_time.m4    2 May 2005 07:00:50 -0000       1.6
+++ m4/clock_time.m4    2 Mar 2006 07:33:21 -0000
@@ -1,5 +1,5 @@
-# clock_time.m4 serial 6
-dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+# clock_time.m4 serial 7
+dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,8 +7,8 @@ dnl with or without modifications, as lo
 # Check for clock_gettime and clock_settime, and sets LIB_CLOCK_GETTIME.
 AC_DEFUN([gl_CLOCK_TIME],
 [
-  # dnl Persuade glibc <time.h> to declare these functions.
-  AC_REQUIRE([AC_GNU_SOURCE])
+  dnl Persuade glibc and Solaris <time.h> to declare these functions.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
   # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
   # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
Index: m4/nanosleep.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/nanosleep.m4,v
retrieving revision 1.21
diff -p -u -r1.21 nanosleep.m4
--- m4/nanosleep.m4     23 Sep 2005 04:15:13 -0000      1.21
+++ m4/nanosleep.m4     2 Mar 2006 07:33:21 -0000
@@ -1,11 +1,13 @@
-#serial 14
+#serial 15
 
 dnl From Jim Meyering.
 dnl Check for the nanosleep function.
 dnl If not found, use the supplied replacement.
 dnl
 
-# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, 
Inc.
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2006 Free Software
+# Foundation, Inc.
+
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -26,6 +28,9 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
  AC_CACHE_CHECK([whether nanosleep works],
   jm_cv_func_nanosleep_works,
   [
+   dnl Persuade glibc and Solaris <time.h> to declare nanosleep.
+   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
    AC_REQUIRE([AC_HEADER_TIME])
    AC_CHECK_HEADERS_ONCE(sys/time.h)
    AC_TRY_RUN([
Index: m4/timespec.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/timespec.m4,v
retrieving revision 1.11
diff -p -u -r1.11 timespec.m4
--- m4/timespec.m4      16 Sep 2005 06:52:15 -0000      1.11
+++ m4/timespec.m4      2 Mar 2006 07:33:21 -0000
@@ -1,6 +1,8 @@
-#serial 11
+#serial 12
+
+# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006 Free Software
+# Foundation, Inc.
 
-# Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -17,8 +19,8 @@ AC_DEFUN([gl_TIMESPEC],
   AC_CHECK_HEADERS_ONCE(sys/time.h)
   gl_CHECK_TYPE_STRUCT_TIMESPEC
 
-  dnl Persuade glibc <time.h> to declare nanosleep().
-  AC_REQUIRE([AC_GNU_SOURCE])
+  dnl Persuade glibc and Solaris <time.h> to declare nanosleep.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
   AC_CHECK_DECLS(nanosleep, , , [#include <time.h>])
 ])
Index: modules/gettime
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/gettime,v
retrieving revision 1.5
diff -p -u -r1.5 gettime
--- modules/gettime     1 Mar 2005 21:22:53 -0000       1.5
+++ modules/gettime     2 Mar 2006 07:33:21 -0000
@@ -9,6 +9,7 @@ m4/gettime.m4
 Depends-on:
 gettimeofday
 timespec
+extensions
 
 configure.ac:
 gl_GETTIME
Index: modules/nanosleep
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/nanosleep,v
retrieving revision 1.6
diff -p -u -r1.6 nanosleep
--- modules/nanosleep   6 May 2005 17:22:45 -0000       1.6
+++ modules/nanosleep   2 Mar 2006 07:33:21 -0000
@@ -8,6 +8,7 @@ m4/nanosleep.m4
 Depends-on:
 timespec
 stdbool
+extensions
 
 configure.ac:
 gl_FUNC_NANOSLEEP
Index: modules/settime
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/settime,v
retrieving revision 1.5
diff -p -u -r1.5 settime
--- modules/settime     21 Mar 2005 22:07:25 -0000      1.5
+++ modules/settime     2 Mar 2006 07:33:21 -0000
@@ -8,6 +8,7 @@ m4/settime.m4
 
 Depends-on:
 timespec
+extensions
 
 configure.ac:
 gl_SETTIME




reply via email to

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