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: autoconf bug report with openv


From: Akim Demaille
Subject: Re: present but cannot be compiled (Was: autoconf bug report with openvpn)
Date: Wed, 14 May 2003 10:23:27 +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.

`linux/irda.h'
     It requires `linux/types.h' and `sys/socket.h'.

`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
          ])

`stdint.h'
     See above, item `inttypes.h' vs. `stdint.h'.

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

`sys/socket.h'
     On Darwin, `stdlib.h' is a prerequisite.

`X11/extensions/scrnsaver.h'
     Using XFree86, this header requires `X11/Xlib.h', which is probably
     so required that you might not even consider looking for it.

          AC_CHECK_HEADERS([X11/extensions/scrnsaver.h], [], [],
          [[#include <X11/Xlib.h>
          ]])

----------------------------------------------------------------------
I downloaded this software:
 http://unc.dl.sourceforge.net/sourceforge/openvpn/openvpn-1.4.0.tar.gz

and tried to install it on a RedHat Linux 9 machine. I did a "./configure" 
according
to the instructions, and the output indicated I should report a bug here. 
The output
follows my signature.


Regards,

-- Gregor Purdy

checking for ifconfig... /sbin/ifconfig
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 a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
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 style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking whether gcc needs -traditional... no
checking for ANSI C header files... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for working volatile... 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 off_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking for ISO C 1999 vararg macro support... yes
checking for GNU GCC vararg macro support... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking for sys/stat.h... (cached) yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking for stdlib.h... (cached) yes
checking for stdint.h... (cached) yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking for unistd.h... (cached) yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking net/if_tun.h usability... no
checking net/if_tun.h presence... no
checking for net/if_tun.h... no
checking net/if.h usability... yes
checking net/if.h presence... yes
checking for net/if.h... yes
checking stropts.h usability... yes
checking stropts.h presence... yes
checking for stropts.h... yes
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking netinet/in_systm.h usability... yes
checking netinet/in_systm.h presence... yes
checking for netinet/in_systm.h... yes
checking netinet/ip.h usability... yes
checking netinet/ip.h presence... yes
checking for netinet/ip.h... yes
checking netinet/if_ether.h usability... yes
checking netinet/if_ether.h presence... yes
checking for netinet/if_ether.h... yes
checking netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking resolv.h usability... yes
checking resolv.h presence... yes
checking for resolv.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking linux/if_tun.h usability... yes
checking linux/if_tun.h presence... yes
checking for linux/if_tun.h... yes
checking linux/sockios.h usability... yes
checking linux/sockios.h presence... yes
checking for linux/sockios.h... yes
checking linux/types.h usability... yes
checking linux/types.h presence... yes
checking for linux/types.h... yes
checking linux/errqueue.h usability... no
checking linux/errqueue.h presence... yes
configure: WARNING: linux/errqueue.h: present but cannot be compiled
configure: WARNING: linux/errqueue.h: check for missing prerequisite 
headers?
configure: WARNING: linux/errqueue.h: proceeding with the preprocessor's 
result
configure: WARNING:     ## ------------------------------------ ##
configure: WARNING:     ## Report this to address@hidden ##
configure: WARNING:     ## ------------------------------------ ##
checking for linux/errqueue.h... yes
checking for in_addr_t... yes
checking for uint8_t... yes
checking for uint32_t... yes
checking for struct tun_pi... yes
checking for struct iphdr... yes
checking for struct iovec... yes
checking for struct sock_extended_err... yes
checking for struct msghdr... yes
checking for struct cmsghdr... yes
checking for unsigned int... yes
checking size of unsigned int... 4
checking for unsigned long... yes
checking size of unsigned long... 4
checking for socklen_t... yes
checking return type of signal handlers... void
checking for library containing socket... none required
checking for library containing inet_ntoa... none required
checking for library containing gethostbyname... none required
checking for unistd.h... (cached) yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for daemon... yes
checking for chroot... yes
checking for getpwnam... yes
checking for setuid... yes
checking for nice... yes
checking for system... yes
checking for getpid... yes
checking for dup... yes
checking for dup2... yes
checking for getpass... yes
checking for strerror... yes
checking for syslog... yes
checking for openlog... yes
checking for mlockall... yes
checking for getgrnam... yes
checking for setgid... yes
checking for setgroups... yes
checking for stat... yes
checking for flock... yes
checking for readv... yes
checking for writev... yes
checking for setsockopt... yes
checking for getsockopt... yes
checking for setsid... yes
checking for chdir... yes
checking for inet_aton... yes
checking for working memcmp... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for time... yes
checking for gettimeofday... yes
checking for select... yes
checking for socket... yes
checking for gethostbyname... yes
checking for inet_ntoa... yes
checking for memset... yes
checking for vsnprintf... yes
configure: checking for LZO Library and Header files...
checking lzo1x.h usability... yes
checking lzo1x.h presence... yes
checking for lzo1x.h... yes
checking for lzo1x_1_15_compress in -llzo... yes
configure: checking for OpenSSL Crypto Library and Header files...
checking openssl/evp.h usability... yes
checking openssl/evp.h presence... yes
checking for openssl/evp.h... yes
checking for EVP_CIPHER_CTX_init in -lcrypto... yes
configure: checking that OpenSSL Library is at least version 0.9.5...
checking for EVP_CIPHER_CTX_set_key_length... yes
configure: checking for OpenSSL SSL Library and Header files...
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
checking for SSL_CTX_new in -lssl... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating openvpn.spec
config.status: creating config.h
config.status: executing depfiles commands







reply via email to

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