bug-gnulib
[Top][All Lists]
Advanced

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

Re: Build errors on Solaris 2.6 & 7


From: Paul Eggert
Subject: Re: Build errors on Solaris 2.6 & 7
Date: Sun, 20 Jan 2013 22:58:34 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

Oh, my.  I guess it's time to try a more-drastic fix.
Does the following work for you?

---
 ChangeLog           | 16 +++++++++
 lib/sys_select.in.h | 96 +++++++++++++++--------------------------------------
 2 files changed, 43 insertions(+), 69 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8218eb3..be59d41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2013-01-20  Paul Eggert  <address@hidden>
+
+       sys_select: port to Solaris 2.6
+       * lib/sys_select.in.h: Redo to resemble sys_time.in.h, which
+       delegates to the system's header when being invoked recursively,
+       and doesn't have split double-inclusion guards.  This breaks
+       a circularity problem on Solaris 2.6, where <time.h> includes
+       <sys/time.h> for struct timespec.  The include nesting is gnulib
+       <time.h>, system <time.h>, gnulib <sys/time.h>, system
+       <sys/time.h>, gnulib <sys/types.h>, system <sys/types.h>, gnulib
+       <sys/select.h>, gnulib <signal.h>, system <sys/signal.h>, system
+       <sys/siginfo.h>; the last, innermost file needs struct
+       timestruc_t, which is defined in <sys/time.h>, which has not been
+       fully parsed.  Problem reported by Tom G. Christensen in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-01/msg00113.html>.
+
 2013-01-16  Paul Eggert  <address@hidden>
 
        unistd: port to recent mingw
diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h
index b48c1bb..9ee52ad 100644
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -19,91 +19,44 @@
 # endif
 @PRAGMA_COLUMNS@
 
-/* On OSF/1, <sys/types.h> and <sys/time.h> include <sys/select.h>.
-   Simply delegate to the system's header in this case.  */
-#if @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TYPES_H_ && 
!defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H) && defined _OSF_SOURCE
+#ifdef address@hidden@_SYS_SELECT_H
 
-# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H
-# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
-
-#elif @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TIME_H_ && 
!defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H) && defined _OSF_SOURCE
-
-# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H
-# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
-
-/* On IRIX 6.5, <sys/timespec.h> includes <sys/types.h>, which includes
-   <sys/bsd_types.h>, which includes <sys/select.h>.  At this point we cannot
-   include <signal.h>, because that includes <internal/signal_core.h>, which
-   gives a syntax error because <sys/timespec.h> has not been completely
-   processed.  Simply delegate to the system's header in this case.  */
-#elif @HAVE_SYS_SELECT_H@ && defined __sgi && (defined _SYS_BSD_TYPES_H && 
!defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_BSD_TYPES_H)
-
-# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_BSD_TYPES_H
-# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
-
-/* On OpenBSD 5.0, <pthread.h> includes <sys/types.h>, which includes
-   <sys/select.h>.  At this point we cannot include <signal.h>, because that
-   includes gnulib's pthread.h override, which gives a syntax error because
-   /usr/include/pthread.h has not been completely processed.  Simply delegate
-   to the system's header in this case.  */
-#elif @HAVE_SYS_SELECT_H@ && defined __OpenBSD__ && (defined _PTHREAD_H_ && 
!defined PTHREAD_MUTEX_INITIALIZER)
-
-# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+/* Simply delegate to the system's header, without adding anything.  */
+# if @HAVE_SYS_SELECT_H@
+#  @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+# endif
 
 #else
 
-#ifndef address@hidden@_SYS_SELECT_H
+#define address@hidden@_SYS_SELECT_H
 
 /* On many platforms, <sys/select.h> assumes prior inclusion of
    <sys/types.h>.  Also, mingw defines sigset_t there, instead of
    in <signal.h> where it belongs.  */
 #include <sys/types.h>
 
-#if @HAVE_SYS_SELECT_H@
+/* Get the 'struct timeval' and 'fd_set' types and the FD_* macros
+   on many platforms.  But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
 
 /* On OSF/1 4.0, <sys/select.h> provides only a forward declaration
    of 'struct timeval', and no definition of this type.
-   Also, Mac OS X, AIX, HP-UX, IRIX, Solaris, Interix declare select()
-   in <sys/time.h>.
-   But avoid namespace pollution on glibc systems.  */
-# ifndef __GLIBC__
-#  include <sys/time.h>
-# endif
-
-/* On AIX 7 and Solaris 10, <sys/select.h> provides an FD_ZERO implementation
-   that relies on memset(), but without including <string.h>.
-   But in any case avoid namespace pollution on glibc systems.  */
-# if (defined __OpenBSD__ || defined _AIX || defined __sun || defined __osf__ 
|| defined __BEOS__) \
-     && ! defined __GLIBC__
-#  include <string.h>
-# endif
-
-/* The include_next requires a split double-inclusion guard.  */
-# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+   Also, Mac OS X, AIX, HP-UX, IRIX, Solaris, Interix declare select
+   in <sys/time.h>.  */
+# include <sys/time.h>
 
+/* On AIX 7 and Solaris 10, <sys/select.h>'s FD_ZERO
+   implementation relies on memset, but without including <string.h>.
+   HP-UX 11 has a similar problem with <sys/time.h>'s FD_ZERO.  */
+# include <string.h>
 #endif
 
-/* Get definition of 'sigset_t'.
-   But avoid namespace pollution on glibc systems.
-   Do this after the include_next (for the sake of OpenBSD 5.0) but before
-   the split double-inclusion guard (for the sake of Solaris).  */
-#if !(defined __GLIBC__ && !defined __UCLIBC__)
-# include <signal.h>
-#endif
+#if @HAVE_SYS_SELECT_H@
 
-#ifndef address@hidden@_SYS_SELECT_H
-#define address@hidden@_SYS_SELECT_H
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
+#else
 
-#if address@hidden@
-/* A platform that lacks <sys/select.h>.  */
-/* Get the 'struct timeval' and 'fd_set' types and the FD_* macros
-   on most platforms.  */
-# include <sys/time.h>
-/* On HP-UX 11, <sys/time.h> provides an FD_ZERO implementation
-   that relies on memset(), but without including <string.h>.  */
-# if defined __hpux
-#  include <string.h>
-# endif
 /* On native Windows platforms:
    Get the 'fd_set' type.
    Get the close() declaration before we override it.  */
@@ -117,6 +70,13 @@
 # endif
 #endif
 
+/* Get definition of 'sigset_t'.
+   But avoid namespace pollution on glibc systems.
+   Do this after the include_next (for the sake of OpenBSD 5.0).  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <signal.h>
+#endif
+
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
@@ -294,5 +254,3 @@ _GL_WARN_ON_USE (select, "select is not always POSIX 
compliant - "
 
 
 #endif /* address@hidden@_SYS_SELECT_H */
-#endif /* address@hidden@_SYS_SELECT_H */
-#endif /* OSF/1 */
-- 
1.7.11.7




reply via email to

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