bug-autoconf
[Top][All Lists]
Advanced

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

Re: present but cannot be compiled (Was: linux/time.h: present but canno


From: Akim Demaille
Subject: Re: present but cannot be compiled (Was: linux/time.h: present but cannot be compiled)
Date: Tue, 06 May 2003 17:51:29 +0200
User-agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3 (gnu/linux)

Thanks for the bug report!

Unfortunately, the problem comes from the package itself, not from
Autoconf.  The configure.ac script needs to be updated.  Please, send
all this message (which your output attached) to the bug list (or the
authors) of the package you were trying to configure.

Below two parts of the Autoconf documentation are included: 1. the
documentation of AC_CHECK_HEADER(S), and 2. what's to be done to
upgrade configure.ac.

If you have some knowledge in C compilation, then there is something
more you can do to help: find out what are the prerequisite headers on
your system.

For instance, if the error message is:

       sys/socket.h: present but cannot be compiled
       sys/socket.h: check for missing prerequisite headers?
       sys/socket.h: proceeding with the preprocessor's result

then try to compile the program sample.c:

       #include <sys/socket.h>

with `cc -c sample.c'.  It will fail.  Then try to understand what
other headers are needed.  For instance, on Darwin, one needs:

       #include <stdio.h>
       #include <stdlib.h>
       #include <sys/socket.h>
       #include <sys/socket.h>

to get a successful compilation.  Then, send this additional
information to the package maintainers, together with a description of
your machine.

Thanks!

----------------------------------------------------------------------

Generic Header Checks
---------------------

   These macros are used to find system header files not covered by the
"particular" test macros.  If you need to check the contents of a header
as well as find out whether it is present, you have to write your own
test for it (*note Writing Tests::).

 - Macro: AC_CHECK_HEADER (HEADER-FILE, [ACTION-IF-FOUND],
          [ACTION-IF-NOT-FOUND], [INCLUDES = `default-includes'])
     If the system header file HEADER-FILE is compilable, execute shell
     commands ACTION-IF-FOUND, otherwise execute ACTION-IF-NOT-FOUND.
     If you just want to define a symbol if the header file is
     available, consider using `AC_CHECK_HEADERS' instead.

     For compatibility issues with older versions of Autoconf, please
     read below.

 - Macro: AC_CHECK_HEADERS (HEADER-FILE..., [ACTION-IF-FOUND],
          [ACTION-IF-NOT-FOUND], [INCLUDES = `default-includes'])
     For each given system header file HEADER-FILE in the
     whitespace-separated argument list that exists, define
     `HAVE_HEADER-FILE' (in all capitals).  If ACTION-IF-FOUND is
     given, it is additional shell code to execute when one of the
     header files is found.  You can give it a value of `break' to
     break out of the loop on the first match.  If ACTION-IF-NOT-FOUND
     is given, it is executed when one of the header files is not found.

     For compatibility issues with older versions of Autoconf, please
     read below.

   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.  If you need to check whether a
header is preprocessable, you can use `AC_PREPROC_IFELSE' (*note
Running the Preprocessor::).

   This scheme, which improves the robustness of the test, also requires
that you make sure that headers that must be included before the
HEADER-FILE be part of the INCLUDES, (*note Default Includes::).  If
looking for `bar.h', which requires that `foo.h' be included before if
it exists, we suggest the following scheme:


AC_CHECK_HEADERS([foo.h])
AC_CHECK_HEADERS([bar.h], [], [],
[#if HAVE_FOO_H
# include <foo.h>
# endif
])

----------------------------------------------------------------------

Header Present But Cannot Be Compiled
=====================================

   The most important guideline to bear in mind when checking for
features is to mimic as much as possible the intended use.
Unfortunately, old versions of `AC_CHECK_HEADER' and `AC_CHECK_HEADERS'
failed to follow this idea, and called the preprocessor, instead of the
compiler, to check for headers.  As a result, incompatibilities between
headers went unnoticed during configuration, and maintainers finally
had to deal with this issue elsewhere.

   As of Autoconf 2.56 both checks are performed, and `configure'
complains loudly if the compiler and the preprocessor do not agree.
For the time being the result used is that of the preprocessor, to give
maintainers time to adjust their `configure.ac', but in the near
future, only the compiler will be considered.

   Consider the following example:

     $ cat number.h
     typedef int number;
     $ cat pi.h
     const number pi = 3;
     $ cat configure.ac
     AC_INIT
     AC_CHECK_HEADERS(pi.h)
     $ autoconf -Wall
     $ ./configure
     checking for gcc... gcc
     checking for C compiler default output... a.out
     checking whether the C compiler works... yes
     checking whether we are cross compiling... no
     checking for suffix of executables...
     checking for suffix of object files... o
     checking whether we are using the GNU C compiler... yes
     checking whether gcc accepts -g... yes
     checking for gcc option to accept ANSI C... none needed
     checking how to run the C preprocessor... gcc -E
     checking for egrep... grep -E
     checking for ANSI C header files... yes
     checking for sys/types.h... yes
     checking for sys/stat.h... yes
     checking for stdlib.h... yes
     checking for string.h... yes
     checking for memory.h... yes
     checking for strings.h... yes
     checking for inttypes.h... yes
     checking for stdint.h... yes
     checking for unistd.h... yes
     checking pi.h usability... no
     checking pi.h presence... yes
     configure: WARNING: pi.h: present but cannot be compiled
     configure: WARNING: pi.h: check for missing prerequisite headers?
     configure: WARNING: pi.h: proceeding with the preprocessor's result
     configure: WARNING:     ## ------------------------------------ ##
     configure: WARNING:     ## Report this to address@hidden ##
     configure: WARNING:     ## ------------------------------------ ##
     checking for pi.h... yes

The proper way the handle this case is using the fourth argument (*note
Generic Headers::):

     $ cat configure.ac
     AC_INIT
     AC_CHECK_HEADERS(number.h pi.h,,,
     [[#if HAVE_NUMBER_H
     # include <number.h>
     #endif
     ]])
     $ autoconf -Wall
     $ ./configure
     checking for gcc... gcc
     checking for C compiler default output... a.out
     checking whether the C compiler works... yes
     checking whether we are cross compiling... no
     checking for suffix of executables...
     checking for suffix of object files... o
     checking whether we are using the GNU C compiler... yes
     checking whether gcc accepts -g... yes
     checking for gcc option to accept ANSI C... none needed
     checking for number.h... yes
     checking for pi.h... yes

   See *Note Particular Headers::, for a list of headers with their
prerequisite.

----------------------------------------------------------------------

Portability of Headers
----------------------

   This section tries to collect knowledge about common headers, and the
problems they cause.  By definition, this list will always require
additions.  Please help us keeping it as complete as possible.

`inttypes.h' vs. `stdint.h'
     Paul Eggert notes that: ISO C 1999 says that `inttypes.h' includes
     `stdint.h', so there's no need to include `stdint.h' separately in
     a standard environment.  Many implementations have `inttypes.h'
     but not `stdint.h' (e.g., Solaris 7), but I don't know of any
     implementation that has `stdint.h' but not `inttypes.h'.  Nor do I
     know of any free software that includes `stdint.h'; `stdint.h'
     seems to be a creation of the committee.

`net/if.h'
     On Darwin, this file requires that `sys/socket.h' be included
     beforehand.  One should run:

          AC_CHECK_HEADERS([sys/socket.h])
          AC_CHECK_HEADERS([net/if.h], [], [],
          [#include <stdio.h>
          #if STDC_HEADERS
          # include <stdlib.h>
          # include <stddef.h>
          #else
          # if HAVE_STDLIB_H
          #  include <stdlib.h>
          # endif
          #endif
          #if HAVE_SYS_SOCKET_H
          # include <sys/socket.h>
          #endif
          ])

`stdlib.h'
     On many systems (e.g., Darwin), `stdio.h' is a prerequisite.

`sys/socket.h'
     On Darwin, `stdlib.h' is a prerequisite.
Redhat 9.0:
/usr/local/src/xinetd-2.3.11># ./config && make && make install
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking for main in -lcompat... no
checking for gethostbyname... yes
checking for getnameinfo... yes
checking for inet_ntop... yes
checking for difftime... yes
checking for fcvt... yes
checking for ecvt... yes
checking for gcvt... yes
checking for strerror... yes
checking for strcasecmp... yes
checking for socket... yes
checking for inet_aton... yes
checking for setenv... yes
checking for strsignal... yes
checking for sys_siglist in -lc... yes
checking for gai_strerror... yes
checking for freeaddrinfo... yes
checking for getaddrinfo... yes
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for sys/types.h... (cached) yes
checking sys/termios.h usability... yes
checking sys/termios.h presence... yes
checking for sys/termios.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking rpc/rpc.h usability... yes
checking rpc/rpc.h presence... yes
checking for rpc/rpc.h... yes
checking rpc/rpcent.h usability... no
checking rpc/rpcent.h presence... no
checking for rpc/rpcent.h... no
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking ftw.h usability... yes
checking ftw.h presence... yes
checking for ftw.h... yes
checking machine/reg.h usability... no
checking machine/reg.h presence... no
checking for machine/reg.h... no
checking linux/time.h usability... no
checking linux/time.h presence... yes
configure: WARNING: linux/time.h: present but cannot be compiled
configure: WARNING: linux/time.h: check for missing prerequisite headers?
configure: WARNING: linux/time.h: proceeding with the preprocessor's 
result
configure: WARNING:     ## ------------------------------------ ##
configure: WARNING:     ## Report this to address@hidden ##
configure: WARNING:     ## ------------------------------------ ##
checking for linux/time.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking rpc/pmap_clnt.h usability... yes
checking rpc/pmap_clnt.h presence... yes
checking for rpc/pmap_clnt.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/signal.h usability... yes
checking sys/signal.h presence... yes
checking for sys/signal.h... yes
checking crypt.h usability... yes
checking crypt.h presence... yes
checking for crypt.h... yes
checking for stdint.h... (cached) yes
checking stdbool.h usability... yes
checking stdbool.h presence... yes
checking for stdbool.h... yes
checking sys/filio.h usability... no
checking sys/filio.h presence... no
checking for sys/filio.h... no
checking DNSServiceDiscovery/DNSServiceDiscovery.h usability... no
checking DNSServiceDiscovery/DNSServiceDiscovery.h presence... no
checking for DNSServiceDiscovery/DNSServiceDiscovery.h... no
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uid_t... yes
checking for gid_t... yes
checking for socklen_t... yes
checking for rlim_t... no
checking for struct addrinfo... yes
checking for struct in6_addr... yes
checking for struct sockaddr_in6... yes
checking for struct sockaddr_storage... yes
checking for main in -lcrypt... yes
checking whether to compile in loadavg... no
checking for crypt in -lc... yes
checking for log10 in -lm... yes
checking whether to default to ipv6... ignored
checking whether to use libwrap... no
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
checking for isatty... yes
checking for memcpy... yes
checking for waitpid... yes
checking for sigvec... yes
checking for setsid... yes
checking for strftime... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libs/src/misc/Makefile
config.status: creating libs/src/pset/Makefile
config.status: creating libs/src/sio/Makefile
config.status: creating libs/src/str/Makefile
config.status: creating libs/src/xlog/Makefile
config.status: creating libs/src/portable/Makefile
config.status: creating xinetd/Makefile
config.status: creating config.h
config.status: config.h is unchanged
cd libs/src/portable ; make CC=gcc CFLAGS='-g -O2  -I../../include' 
install
make[1]: Entering directory 
`/usr/local/src/xinetd-2.3.11/libs/src/portable'
Installed libportable.a to ../../lib
Installed ./libportable.h to ../../include
make[1]: Leaving directory 
`/usr/local/src/xinetd-2.3.11/libs/src/portable'
cd libs/src/sio ; make CC=gcc CFLAGS='-g -O2  -I../../include' install
make[1]: Entering directory `/usr/local/src/xinetd-2.3.11/libs/src/sio'
Installed libsio.a to ../../lib
Installed ./sio.h to ../../include
Installed ./sio.3 ./Sprint.3 to ../../man
make[1]: Leaving directory `/usr/local/src/xinetd-2.3.11/libs/src/sio'
cd libs/src/str ; make CC=gcc CFLAGS='-g -O2  -I../../include' install
make[1]: Entering directory `/usr/local/src/xinetd-2.3.11/libs/src/str'
Installed libstr.a to ../../lib
Installed ./str.h to ../../include
Installed ./strparse.3 ./strprint.3 ./strutil.3 to ../../man
make[1]: Leaving directory `/usr/local/src/xinetd-2.3.11/libs/src/str'
cd libs/src/misc ; make CC=gcc CFLAGS='-g -O2  -I../../include' install
make[1]: Entering directory `/usr/local/src/xinetd-2.3.11/libs/src/misc'
Installed libmisc.a to ../../lib
Installed ./misc.h ./m_env.h to ../../include
Installed ./misc.3 ./m_env.3 to ../../man
make[1]: Leaving directory `/usr/local/src/xinetd-2.3.11/libs/src/misc'
cd libs/src/pset ; make CC=gcc CFLAGS='-g -O2  -I../../include' install
make[1]: Entering directory `/usr/local/src/xinetd-2.3.11/libs/src/pset'
Installed libpset.a to ../../lib
Installed ./pset.h to ../../include
Installed ./pset.3 ./psi.3 to ../../man
make[1]: Leaving directory `/usr/local/src/xinetd-2.3.11/libs/src/pset'
cd libs/src/xlog ; make CC=gcc CFLAGS='-g -O2  -I../../include' install
make[1]: Entering directory `/usr/local/src/xinetd-2.3.11/libs/src/xlog'
Installed libxlog.a to ../../lib
Installed ./xlog.h to ../../include
Installed ./xlog.3 to ../../man
make[1]: Leaving directory `/usr/local/src/xinetd-2.3.11/libs/src/xlog'
cd xinetd ; make CC=gcc CFLAGS='-g -O2  -I../libs/include' 
LDFLAGS='-L../libs/lib'
make[1]: Entering directory `/usr/local/src/xinetd-2.3.11/xinetd'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/local/src/xinetd-2.3.11/xinetd'
cd libs/src/portable ; make CC=gcc CFLAGS='-g -O2  -I../../include' 
install
make[1]: Entering directory 
`/usr/local/src/xinetd-2.3.11/libs/src/portable'
Installed libportable.a to ../../lib
Installed ./libportable.h to ../../include
make[1]: Leaving directory 
`/usr/local/src/xinetd-2.3.11/libs/src/portable'
cd libs/src/sio ; make CC=gcc CFLAGS='-g -O2  -I../../include' install
make[1]: Entering directory `/usr/local/src/xinetd-2.3.11/libs/src/sio'
Installed libsio.a to ../../lib
Installed ./sio.h to ../../include
Installed ./sio.3 ./Sprint.3 to ../../man
make[1]: Leaving directory `/usr/local/src/xinetd-2.3.11/libs/src/sio'
cd libs/src/str ; make CC=gcc CFLAGS='-g -O2  -I../../include' install
make[1]: Entering directory `/usr/local/src/xinetd-2.3.11/libs/src/str'
Installed libstr.a to ../../lib
Installed ./str.h to ../../include
Installed ./strparse.3 ./strprint.3 ./strutil.3 to ../../man
make[1]: Leaving directory `/usr/local/src/xinetd-2.3.11/libs/src/str'
cd libs/src/misc ; make CC=gcc CFLAGS='-g -O2  -I../../include' install
make[1]: Entering directory `/usr/local/src/xinetd-2.3.11/libs/src/misc'
Installed libmisc.a to ../../lib
Installed ./misc.h ./m_env.h to ../../include
Installed ./misc.3 ./m_env.3 to ../../man
make[1]: Leaving directory `/usr/local/src/xinetd-2.3.11/libs/src/misc'
cd libs/src/pset ; make CC=gcc CFLAGS='-g -O2  -I../../include' install
make[1]: Entering directory `/usr/local/src/xinetd-2.3.11/libs/src/pset'
Installed libpset.a to ../../lib
Installed ./pset.h to ../../include
Installed ./pset.3 ./psi.3 to ../../man
make[1]: Leaving directory `/usr/local/src/xinetd-2.3.11/libs/src/pset'
cd libs/src/xlog ; make CC=gcc CFLAGS='-g -O2  -I../../include' install
make[1]: Entering directory `/usr/local/src/xinetd-2.3.11/libs/src/xlog'
Installed libxlog.a to ../../lib
Installed ./xlog.h to ../../include
Installed ./xlog.3 to ../../man
make[1]: Leaving directory `/usr/local/src/xinetd-2.3.11/libs/src/xlog'
cd xinetd ; make CC=gcc CFLAGS='-g -O2  -I../libs/include' 
LDFLAGS='-L../libs/lib'
make[1]: Entering directory `/usr/local/src/xinetd-2.3.11/xinetd'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/local/src/xinetd-2.3.11/xinetd'
for i in /usr/sbin  /usr/man/man5 /usr/man/man8 ; do \
   test -d $i || mkdir -p $i ; done
/usr/bin/install -c -m 755 xinetd/xinetd /usr/sbin
/usr/bin/install -c -m 755 xinetd/itox /usr/sbin
/usr/bin/install -c -m 755 ./xinetd/xconv.pl /usr/sbin
/usr/bin/install -c -m 644 ./xinetd/xinetd.conf.man 
/usr/man/man5/xinetd.conf.5
/usr/bin/install -c -m 644 ./xinetd/xinetd.log.man 
/usr/man/man8/xinetd.log.8
/usr/bin/install -c -m 644 ./xinetd/xinetd.man /usr/man/man8/xinetd.8
/usr/bin/install -c -m 644 ./xinetd/itox.8 /usr/man/man8/itox.8
/usr/bin/install -c -m 644 ./xinetd/xconv.pl.8 /usr/man/man8/xconv.pl.8
You must put your xinetd.conf in /etc/xinetd.conf
There is a sample config file in xinetd/sample.conf and you can
use xconv.pl to convert your old inetd.conf file to an xinetd format
/usr/local/src/xinetd-2.3.11># 








reply via email to

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