Here are the symptoms during the build of wget 1.8.2 on Solaris 7
with GCC 2.95.3:

        gcc -I. -I. -I/usr/local/ssl/include   -DHAVE_CONFIG_H 
-DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" -DLOCALEDIR=\"/usr/local/share/locale\" -O2 
-Wall -Wno-implicit -c ftp.c
        In file included from /usr/local/ssl/include/openssl/bio.h:65,
                         from /usr/local/ssl/include/openssl/ssl.h:119,
                         from rbuf.h:34,
                         from ftp.c:50:
        /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/include/stdarg.h:170: 
warning: redefinition of `va_list'
        /usr/include/stdio.h:118: warning: `va_list' previously declared here

The problem is that Solaris 7 stdio.h plays funny games if you define
_XOPEN_SOURCE: it adds a typedef for va_list in that situation.  The
simplest workaround is to not define _XOPEN_SOURCE on Solaris, as it
isn't needed.

More generally, wget should probably be using AC_CHECK_DECLS instead
of AC_CHECK_FUNC to determine whether a function is declared.  That
way wget shouldn't have to tweak the namespace at all; it could just
adapt to the namespace that "configure" gives it.  But that's a longer
story.

Here is a patch only for the simple problem.

2003-01-20  Paul Eggert  <eggert@whale>

        * src/config.h.in (NAMESPACE_TWEAKS): Remove.
        (__EXTENSIONS__): Define only for Solaris.
        (_XOPEN_SOURCE, _SVID_SOURCE, _BSD_SOURCE): Define only for Linux.

===================================================================
RCS file: src/RCS/config.h.in,v
retrieving revision 1.8.2.0
retrieving revision 1.8.2.1
diff -pu -r1.8.2.0 -r1.8.2.1
--- src/config.h.in     2002/05/18 03:05:14     1.8.2.0
+++ src/config.h.in     2003/01/20 21:50:40     1.8.2.1
@@ -254,30 +254,19 @@ char *alloca ();
    Because of that, we define them only on architectures we know
    about.  */
 
-#undef NAMESPACE_TWEAKS
-
 #ifdef solaris
-# define NAMESPACE_TWEAKS
+/* Request Solaris extensions, even if the compiler options ask for
+   ANSI C headers.  */
+# define __EXTENSIONS__
 #endif
 
 #ifdef __linux__
-# define NAMESPACE_TWEAKS
-#endif
-
-#ifdef NAMESPACE_TWEAKS
-
-/* Request the "Unix 98 compilation environment". */
-#define _XOPEN_SOURCE 500
+/* Request the "Unix 98 compilation environment".  */
+# define _XOPEN_SOURCE 500
 
-/* For Solaris: request everything else that is available and doesn't
-   conflict with the above.  */
-#define __EXTENSIONS__
-
-/* For Linux: request features of 4.3BSD and SVID (System V Interface
-   Definition). */
-#define _SVID_SOURCE
-#define _BSD_SOURCE
-
-#endif /* NAMESPACE_TWEAKS */
+/* Request features of 4.3BSD and SVID (System V Interface Definition).  */
+# define _SVID_SOURCE
+# define _BSD_SOURCE
+#endif
 
 #endif /* CONFIG_H */

Reply via email to