autoconf
[Top][All Lists]
Advanced

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

Bugs encountered updating GCC


From: Daniel Jacobowitz
Subject: Bugs encountered updating GCC
Date: Sun, 7 Sep 2003 14:07:51 -0400
User-agent: Mutt/1.5.1i

Hi autoconf'ers...

I've been involved in converting a number of projects in the GCC and sources
(binutils, gdb, etc) repositories to autoconf 2.57.  By and large, it's
going well, but we've turned up a couple of problems.  I'm not familiar with
autoconf development, so these may have more historical baggage than I know
about...

The first is with AC_CHECK_HEADERS.  The manual says:
   Previous versions of Autoconf merely checked whether the header was
accepted by the preprocessor.  This was changed because the old test was
inappropriate for typical uses.  Headers are typically used to compile,
not merely to preprocess, and the old behavior sometimes accepted
headers that clashed at compile-time.

However, that's not the whole story.  The old check also failed if there
were warning messages on stderr when preprocessing.  The new one doesn't do
that, by default.  Instead it only does so if ac_c_preproc_warn_flag, which
is only set if missing headers are a warning rather than an error. As a
result autoconf now decides malloc.h is available on FreeBSD, even though it
has a #warning in it.

Test case:
foo.h:
#warning "A.h"

configure.in:
AC_INIT(foo.h)
AC_CHECK_HEADERS([foo.h])
AC_OUTPUT

Old output:
configure:609: checking for foo.h
configure:619: gcc -I/home/drow/autoconf/o/.. -E  conftest.c >/dev/null 
2>conftest.out
In file included from configure:615:
/home/drow/autoconf/foo.h:1:2: warning: #warning "A.h"
configure: failed program was:
#line 614 "configure"
#include "confdefs.h"
#include <foo.h>


configure:2606: checking foo.h usability
configure:2619: gcc -I/home/drow/autoconf/o/.. -c -g -O2  conftest.c >&5
In file included from configure:2660: /home/drow/autoconf/foo.h:1:2: warning: 
#warning "A.h"
configure:2622: $? = 0
configure:2625: test -s conftest.o
configure:2628: $? = 0
configure:2638: result: yes
configure:2642: checking foo.h presence
configure:2653: gcc -I/home/drow/autoconf/o/.. -E  conftest.c
In file included from configure:2662: /home/drow/autoconf/foo.h:1:2: warning: 
#warning "A.h"
configure:2659: $? = 0
configure:2678: result: yes
configure:2714: checking for foo.h
configure:2721: result: yes


The other problem we've encountered is a change to AC_LANG_FUNC_LINK_TRY(C):

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $1 (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif


On HP/UX, including <limits.h> drags in a lot of other headers.  With
_HPUX_SOURCE defined, this includes a prototype for clock, which causes 
AC_CHECK_FUNCS(clock) to not find clock.  The __stub macros are glibc
specific, aren't they?


I don't have good patches for either issue.  Checking for _HPUX_SOURCE to
defeat the __stub check is good enough for our purposes, so that's what
we're using right now.  Could someone explain why AC_PREPROC_IFELSE no
longer considers all warnings fatal?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer




reply via email to

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