[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Building 4.1.0 rc1 on Solaris 8 and 9 with gcc 3.3.2
From: |
Chad Walstrom |
Subject: |
Re: Building 4.1.0 rc1 on Solaris 8 and 9 with gcc 3.3.2 |
Date: |
Thu, 18 Nov 2004 12:04:34 -0600 |
User-agent: |
Mutt/1.5.6+20040722i |
Tim Buck wrote:
> For what it's worth, I get the same error on FreeBSD 4.9 (with gcc
> 2.95.4) that Yngve gets on Solaris.
*sigh* I had a bad feeling about the whole libiberty/*, include/*
update. I'm glad I tagged CVS before making changes. Anyway, time to
track down the problems:
With respect to the Solaris 8 & 9 builds, libiberty.h and getopt.h fail
at the notorious triple-state macro attempt at resolving declarations
for getopt() and basename(). Here's the explanation in libiberty.h for
basename():
/* Return the last component of a path name. Note that we can't use a
prototype here because the parameter is declared inconsistently
across different systems, sometimes as "char *" and sometimes as
"const char *" */
/* HAVE_DECL_* is a three-state macro: undefined, 0 or 1. If it is
undefined, we haven't run the autoconf check so provide the
declaration without arguments. If it is 0, we checked and failed
to find the declaration so provide a fully prototyped one. If it
is 1, we found it so don't provide any declaration at all. */
#if !HAVE_DECL_BASENAME
#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined
(__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined
(__CYGWIN__) || defined (__CYGWIN32__) || defined (HAVE_DECL_BASENAME)
extern char *basename PARAMS ((const char *));
#else
extern char *basename ();
#endif
#endif
So, it appears that the autoconf check for basename() didn't happen...
Looking in the configure.ac file, I found this wonderful exclusion:
# These are neither executed nor required, but they help keep
# autoheader happy without adding a bunch of text to acconfig.h.
if test "x" = "y"; then
AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock
\
getcwd getpagesize index insque mkstemps memchr memcmp memcpy \
...
Not sure if it really matters or not. I'll dig into this deeper.
Nowhere in the config.in is HAVE_DECL_GETOPT defined, nor is configure
testing for it at all. It appears that getopt and basename both require
manual definitions of HAVE_DECL_*=1 to skip the function declaration or
0 to use it. Try throwing these defines in your CFLAGS and see what
happens.
Maybe we should ask the gcc folks why this "three-state macro" doesn't
have the glue in configure.ac?
--
Chad Walstrom <chewie@wookimus.net> http://www.wookimus.net/
assert(expired(knowledge)); /* core dump */
signature.asc
Description: Digital signature