Re: Build errors on Solaris 2.6 & 7

2013-01-21 Thread Tom G. Christensen

On 01/21/2013 07:58 AM, Paul Eggert wrote:

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


Unfortunately not.

It works for Solaris 7-10 but still fails in the same way on Solaris 2.6.

depbase=`echo dtotimespec.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -std=gnu99 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" 
-DNO_XMALLOC -DEXEEXT=\"\" -I. -I..  -DGNULIB_STRICT_CHECKING=
1 -I../intl -I/usr/tgcware/include -D_REENTRANT  -g -O2 -MT 
dtotimespec.o -MD -MP -MF $depbase.Tpo -c -o dtotimespec.o dtotimespe

c.c &&\
mv -f $depbase.Tpo $depbase.Po
In file included from 
/usr/tgcware/gcc-4.3.6/lib/gcc/sparc-sun-solaris2.6/4.3.6/include-fixed/sys/signal.h:132,
 from 
/usr/tgcware/gcc-4.3.6/lib/gcc/sparc-sun-solaris2.6/4.3.6/include-fixed/signal.h:27,

 from ./signal.h:52,
 from ./sys/select.h:78,
 from 
/usr/tgcware/gcc-4.3.6/lib/gcc/sparc-sun-solaris2.6/4.3.6/include-fixed/sys/types.h:431,

 from ./sys/types.h:27,
 from /usr/include/sys/time.h:71,
 from ./sys/time.h:38,
 from 
/usr/tgcware/gcc-4.3.6/lib/gcc/sparc-sun-solaris2.6/4.3.6/include-fixed/time.h:102,

 from ./time.h:39,
 from timespec.h:22,
 from dtotimespec.c:25:
/usr/include/sys/siginfo.h:229: error: expected specifier-qualifier-list 
before 'timestruc_t'
/usr/include/sys/siginfo.h:284: error: expected specifier-qualifier-list 
before 'timestruc_t'

make[4]: *** [dtotimespec.o] Error 1

This is the include chain:
gnulib  -> system  -> gnulib  -> system 
 -> gnulib  -> system  -> returns 
to gnulib  -> gnulib  -> system 
 -> returns to gnulib  -> gnulib  
-> system  -> system  -> system 


Preprocessed source for reference:
http://jupiterrise.com/tmp/dtotimespec.i
http://jupiterrise.com/tmp/unpatched-dtotimespec.i

-tgc



Re: bug#13495: Compilation fails on Mac OS X 10.8.0

2013-01-21 Thread Paul Eggert
On 01/21/2013 11:39 AM, Assaf Gordon wrote:
> This fixes the problem. Compilation succeeds with both gcc and clang.

Thanks for checking.  I pushed the following patch into gnulib
and am marking this coreutils bug as done.

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-21  Paul Eggert  
+
+   stpncpy: port to OS X 10.8
+   * lib/stpncpy.c (__stpncpy): Parenthesize name when defining function.
+   Problem reported by Assaf Gordon in .
+
 2013-01-16  Paul Eggert  
 
unistd: port to recent mingw
diff --git a/lib/stpncpy.c b/lib/stpncpy.c
index 466cd5f..8b14fb9 100644
--- a/lib/stpncpy.c
+++ b/lib/stpncpy.c
@@ -31,7 +31,7 @@
 /* Copy no more than N bytes of SRC to DST, returning a pointer past the
last non-NUL byte written into DST.  */
 char *
-__stpncpy (char *dest, const char *src, size_t n)
+(__stpncpy) (char *dest, const char *src, size_t n)
 {
   char c;
   char *s = dest;
-- 
1.7.11.7





Re: Build errors on Solaris 2.6 & 7

2013-01-21 Thread Paul Eggert
On 01/21/2013 12:53 PM, Tom G. Christensen wrote:
> It works for Solaris 7-10 but still fails in the same way on Solaris 2.6.

OK, thanks, how about this slightly-revised patch?

diff --git a/ChangeLog b/ChangeLog
index 8218eb3..32c371a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2013-01-20  Paul Eggert  
+
+   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  includes
+for struct timespec.  The include nesting is gnulib
+   , system , gnulib , system
+   , gnulib , system , gnulib
+   , gnulib , system , system
+   ; the last, innermost file needs struct
+   timestruc_t, which is defined in , which has not been
+   fully parsed.  Problem reported by Tom G. Christensen in
+   .
+   * lib/sys_types.in.h: Temporarily define _GL_INCLUDING_SYS_TYPES_H,
+   for sys_select.in.h's benefit.
+
 2013-01-16  Paul Eggert  
 
unistd: port to recent mingw
diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h
index b48c1bb..49894cc 100644
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -19,91 +19,44 @@
 # endif
 @PRAGMA_COLUMNS@
 
-/* On OSF/1,  and  include .
-   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
+#if defined _@GUARD_PREFIX@_SYS_SELECT_H || defined _GL_INCLUDING_SYS_TYPES_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,  includes , which includes
-   , which includes .  At this point we cannot
-   include , because that includes , which
-   gives a syntax error because  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,  includes , which includes
-   .  At this point we cannot include , 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 _@GUARD_PREFIX@_SYS_SELECT_H
+#define _@GUARD_PREFIX@_SYS_SELECT_H
 
 /* On many platforms,  assumes prior inclusion of
.  Also, mingw defines sigset_t there, instead of
in  where it belongs.  */
 #include 
 
-#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,  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 .
-   But avoid namespace pollution on glibc systems.  */
-# ifndef __GLIBC__
-#  include 
-# endif
-
-/* On AIX 7 and Solaris 10,  provides an FD_ZERO implementation
-   that relies on memset(), but without including .
-   But in any case avoid namespace pollution on glibc systems.  */
-# if (defined __OpenBSD__ || defined _AIX || defined __sun || defined __osf__ 
|| defined __BEOS__) \
- && ! defined __GLIBC__
-#  include 
-# 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 .  */
+# include 
 
+/* On AIX 7 and Solaris 10, 's FD_ZERO
+   implementation relies on memset, but without including .
+   HP-UX 11 has a similar problem with 's FD_ZERO.  */
+# include 
 #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 
-#endif
+#if @HAVE_SYS_SELECT_H@
 
-#ifndef _@GUARD_PREFIX@_SYS_SELECT_H
-#define