bug-autoconf
[Top][All Lists]
Advanced

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

Issue AC_CHECK_HEADERS


From: Loic Domaigne
Subject: Issue AC_CHECK_HEADERS
Date: Fri, 16 Apr 2004 15:56:19 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Hello everybody,

I found the following issue with autoconf v2.57 on Tru64 4.0f platform. With older autoconf (2.52), it works.

The minimal configure.in that fails:

AC_PREREQ(2.5)
AC_INIT(try.cc)
AC_PROG_CXX
AC_LANG_CPLUSPLUS
AC_DEFINE(_XOPEN_SOURCE_EXTENDED)
AC_CHECK_HEADERS(strings.h)

configure gives me that strings.h doesn't exist although it is in /usr/include. A closer look at the config.log reveals that <stdlib.h>
get included prior to any user #define. In particular prior to
_XOPEN_SOURCE_EXTENDED which is needed to insure proper definition of bzero(). Apparently, this #include<stdlib.h> comes from confdefs.h

See below the annoted config.log ("HERE IS THE PROBLEM").
Is there a fix somewhere?


Regards,
Loic.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.57.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##

hostname = vdphr1
uname -m = alpha
uname -r = V4.0
uname -s = OSF1
uname -v = 1229

/usr/bin/uname -p = alpha
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
hostinfo               = unknown
/bin/machine           = alpha
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/bin/X11
PATH: /usr/local/bin
PATH: /opt/TWWfsw/bin
PATH: /usr/local/gcc-3.2.3/bin
PATH: /usr/local/sbin
PATH: /usr/local/pvm3/lib
PATH: /opt/schily/bin
PATH: /usr/bin/X11
PATH: /usr/local/bin
PATH: /opt/TWWfsw/bin
PATH: /usr/local/gcc-3.2.3/bin
PATH: /usr/local/sbin
PATH: /usr/local/pvm3/lib
PATH: /opt/schily/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1348: checking for C++ compiler version
configure:1351: /usr/local/gcc-3.2.3/bin/g++ --version </dev/null >&5
g++ (GCC) 3.2.3
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:1354: $? = 0
configure:1356: /usr/local/gcc-3.2.3/bin/g++ -v </dev/null >&5
Reading specs from 
/usr/local/gcc-3.2.3/lib/gcc-lib/alphaev56-dec-osf4.0f/3.2.3/specs
Configured with: ../gcc-3.2.3/configure --prefix=/usr/local/gcc-3.2.3 
--enable-languages=c++
Thread model: single
gcc version 3.2.3
configure:1359: $? = 0
configure:1361: /usr/local/gcc-3.2.3/bin/g++ -V </dev/null >&5
g++: argument to `-V' missing

configure:1364: $? = 1
configure:1388: checking for C++ compiler default output
configure:1391: /usr/local/gcc-3.2.3/bin/g++    conftest.cc  >&5
configure:1394: $? = 0
configure:1440: result: a.out
configure:1445: checking whether the C++ compiler works
configure:1451: ./a.out
configure:1454: $? = 0
configure:1471: result: yes
configure:1478: checking whether we are cross compiling
configure:1480: result: no
configure:1483: checking for suffix of executables
configure:1485: /usr/local/gcc-3.2.3/bin/g++ -o conftest    conftest.cc  >&5
configure:1488: $? = 0
configure:1513: result: 
configure:1519: checking for suffix of object files
configure:1541: /usr/local/gcc-3.2.3/bin/g++ -c   conftest.cc >&5
configure:1544: $? = 0
configure:1566: result: o
configure:1570: checking whether we are using the GNU C++ compiler
configure:1595: /usr/local/gcc-3.2.3/bin/g++ -c   conftest.cc >&5
configure:1598: $? = 0
configure:1601: test -s conftest.o
configure:1604: $? = 0
configure:1617: result: yes
configure:1623: checking whether /usr/local/gcc-3.2.3/bin/g++ accepts -g
configure:1645: /usr/local/gcc-3.2.3/bin/g++ -c -g  conftest.cc >&5
configure:1648: $? = 0
configure:1651: test -s conftest.o
configure:1654: $? = 0
configure:1665: result: yes
configure:1709: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
configure:1712: $? = 0
configure:1715: test -s conftest.o
configure:1718: $? = 0
configure:1745: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
configure: In function `int main()':
configure:1740: `exit' undeclared (first use this function)
configure:1740: (Each undeclared identifier is reported only once for each 
   function it appears in.)
configure:1748: $? = 1
configure: failed program was:
| #line 1728 "configure"
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| exit (42);
|   ;
|   return 0;
| }
configure:1709: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
configure:1712: $? = 0
configure:1715: test -s conftest.o
configure:1718: $? = 0
configure:1745: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
configure:1748: $? = 0
configure:1751: test -s conftest.o
configure:1754: $? = 0
configure:1793: checking how to run the C++ preprocessor
configure:1825: /usr/local/gcc-3.2.3/bin/g++ -E  conftest.cc
configure:1831: $? = 0
configure:1863: /usr/local/gcc-3.2.3/bin/g++ -E  conftest.cc
configure:1866:28: ac_nonexistent.h: No such file or directory
configure:1869: $? = 1
configure: failed program was:
| #line 1854 "configure"
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""

######
# HERE IS THE PROBLEM!!! 
#
# the _XOPEN stuff should have been declared prior to that include.
#####
| #ifdef __cplusplus
| #include <stdlib.h>
| #endif
####

| #define _XOPEN_SOURCE_EXTENDED 1
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:1907: result: /usr/local/gcc-3.2.3/bin/g++ -E
configure:1932: /usr/local/gcc-3.2.3/bin/g++ -E  conftest.cc
configure:1938: $? = 0
configure:1970: /usr/local/gcc-3.2.3/bin/g++ -E  conftest.cc
configure:1973:28: ac_nonexistent.h: No such file or directory
configure:1976: $? = 1
configure: failed program was:
| #line 1961 "configure"
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #ifdef __cplusplus
| #include <stdlib.h>
| #endif
| #define _XOPEN_SOURCE_EXTENDED 1
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:2019: checking for egrep
configure:2029: result: grep -E
configure:2034: checking for ANSI C header files
configure:2060: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
In file included from 
/usr/local/gcc-3.2.3/lib/gcc-lib/alphaev56-dec-osf4.0f/3.2.3/include/string.h:162,
                 from configure:2053:
/usr/include/strings.h:80: declaration of C function `void bzero(void*, long 
   unsigned int)' conflicts with
/usr/include/sys/select.h:223: previous declaration `void bzero(char*, int)' 
   here
configure:2063: $? = 1
configure: failed program was:
| #line 2039 "configure"
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #ifdef __cplusplus
| #include <stdlib.h>
| #endif
| #define _XOPEN_SOURCE_EXTENDED 1
| /* end confdefs.h.  */
| #include <stdlib.h>
| #include <stdarg.h>
| #include <string.h>
| #include <float.h>
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2181: result: no
configure:2205: checking for sys/types.h
configure:2222: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
configure:2225: $? = 0
configure:2228: test -s conftest.o
configure:2231: $? = 0
configure:2242: result: yes
configure:2205: checking for sys/stat.h
configure:2222: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
configure:2225: $? = 0
configure:2228: test -s conftest.o
configure:2231: $? = 0
configure:2242: result: yes
configure:2205: checking for stdlib.h
configure:2222: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
configure:2225: $? = 0
configure:2228: test -s conftest.o
configure:2231: $? = 0
configure:2242: result: yes
configure:2205: checking for string.h
configure:2222: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
In file included from 
/usr/local/gcc-3.2.3/lib/gcc-lib/alphaev56-dec-osf4.0f/3.2.3/include/string.h:162,
                 from configure:2260:
/usr/include/strings.h:80: declaration of C function `void bzero(void*, long 
   unsigned int)' conflicts with
/usr/include/sys/select.h:223: previous declaration `void bzero(char*, int)' 
   here
configure:2225: $? = 1
configure: failed program was:
| #line 2210 "configure"
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #ifdef __cplusplus
| #include <stdlib.h>
| #endif
| #define _XOPEN_SOURCE_EXTENDED 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| /* end confdefs.h.  */
| #include <stdio.h>
| #if HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #if HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #if STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # if HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #if HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #if HAVE_INTTYPES_H
| # include <inttypes.h>
| #else
| # if HAVE_STDINT_H
| #  include <stdint.h>
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| 
| #include <string.h>
configure:2242: result: no
configure:2205: checking for memory.h
configure:2222: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
In file included from 
/usr/local/gcc-3.2.3/lib/gcc-lib/alphaev56-dec-osf4.0f/3.2.3/include/string.h:162,
                 from /usr/include/memory.h:68,
                 from configure:2260:
/usr/include/strings.h:80: declaration of C function `void bzero(void*, long 
   unsigned int)' conflicts with
/usr/include/sys/select.h:223: previous declaration `void bzero(char*, int)' 
   here
configure:2225: $? = 1
configure: failed program was:
| #line 2210 "configure"
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #ifdef __cplusplus
| #include <stdlib.h>
| #endif
| #define _XOPEN_SOURCE_EXTENDED 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| /* end confdefs.h.  */
| #include <stdio.h>
| #if HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #if HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #if STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # if HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #if HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #if HAVE_INTTYPES_H
| # include <inttypes.h>
| #else
| # if HAVE_STDINT_H
| #  include <stdint.h>
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| 
| #include <memory.h>
configure:2242: result: no
configure:2205: checking for strings.h
configure:2222: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
In file included from configure:2260:
/usr/include/strings.h:80: declaration of C function `void bzero(void*, long 
   unsigned int)' conflicts with
/usr/include/sys/select.h:223: previous declaration `void bzero(char*, int)' 
   here
configure:2225: $? = 1
configure: failed program was:
| #line 2210 "configure"
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #ifdef __cplusplus
| #include <stdlib.h>
| #endif
| #define _XOPEN_SOURCE_EXTENDED 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| /* end confdefs.h.  */
| #include <stdio.h>
| #if HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #if HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #if STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # if HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #if HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #if HAVE_INTTYPES_H
| # include <inttypes.h>
| #else
| # if HAVE_STDINT_H
| #  include <stdint.h>
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| 
| #include <strings.h>
configure:2242: result: no
configure:2205: checking for inttypes.h
configure:2222: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
configure:2260:22: inttypes.h: No such file or directory
configure:2225: $? = 1
configure: failed program was:
| #line 2210 "configure"
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #ifdef __cplusplus
| #include <stdlib.h>
| #endif
| #define _XOPEN_SOURCE_EXTENDED 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| /* end confdefs.h.  */
| #include <stdio.h>
| #if HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #if HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #if STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # if HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #if HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #if HAVE_INTTYPES_H
| # include <inttypes.h>
| #else
| # if HAVE_STDINT_H
| #  include <stdint.h>
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| 
| #include <inttypes.h>
configure:2242: result: no
configure:2205: checking for stdint.h
configure:2222: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
configure:2260:20: stdint.h: No such file or directory
configure:2225: $? = 1
configure: failed program was:
| #line 2210 "configure"
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #ifdef __cplusplus
| #include <stdlib.h>
| #endif
| #define _XOPEN_SOURCE_EXTENDED 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| /* end confdefs.h.  */
| #include <stdio.h>
| #if HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #if HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #if STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # if HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #if HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #if HAVE_INTTYPES_H
| # include <inttypes.h>
| #else
| # if HAVE_STDINT_H
| #  include <stdint.h>
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| 
| #include <stdint.h>
configure:2242: result: no
configure:2205: checking for unistd.h
configure:2222: /usr/local/gcc-3.2.3/bin/g++ -c -g -O2  conftest.cc >&5
configure:2225: $? = 0
configure:2228: test -s conftest.o
configure:2231: $? = 0
configure:2242: result: yes
configure:2259: checking for strings.h
configure:2264: result: no

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=set
ac_cv_env_CXX_value=/usr/local/gcc-3.2.3/bin/g++
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=
ac_cv_header_inttypes_h=no
ac_cv_header_memory_h=no
ac_cv_header_stdc=no
ac_cv_header_stdint_h=no
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=no
ac_cv_header_strings_h=no
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_objext=o
ac_cv_prog_CXXCPP='/usr/local/gcc-3.2.3/bin/g++ -E'
ac_cv_prog_cxx_g=yes
ac_cv_prog_egrep='grep -E'

## ----------------- ##
## Output variables. ##
## ----------------- ##

CPPFLAGS=''
CXX='/usr/local/gcc-3.2.3/bin/g++'
CXXCPP='/usr/local/gcc-3.2.3/bin/g++ -E'
CXXFLAGS='-g -O2'
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='grep -E'
EXEEXT=''
LDFLAGS=''
LIBS=''
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
SHELL='/bin/bash'
ac_ct_CXX=''
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${prefix}/share'
exec_prefix='NONE'
host_alias=''
includedir='${prefix}/include'
infodir='${prefix}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define HAVE_STDLIB_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define _XOPEN_SOURCE_EXTENDED 1
#endif
#ifdef __cplusplus
#include <stdlib.h>

configure: exit 0

reply via email to

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