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: bug)


From: Akim Demaille
Subject: Re: present but cannot be compiled (Was: bug)
Date: Tue, 06 May 2003 17:52:14 +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.
During configuration of kdebase HEAD:
checking X11/extensions/XKBstr.h usability... no
checking X11/extensions/XKBstr.h presence... yes
configure: WARNING: X11/extensions/XKBstr.h: present but cannot be compiled
configure: WARNING: X11/extensions/XKBstr.h: check for missing prerequisite 
headers?
configure: WARNING: X11/extensions/XKBstr.h: proceeding with the preprocessor's 
result
configure: WARNING:     ## ------------------------------------ ##
configure: WARNING:     ## Report this to address@hidden ##
configure: WARNING:     ## ------------------------------------ ##
checking for X11/extensions/XKBstr.h... yes

config.log:

configure:33039: checking X11/extensions/XKBstr.h usability
configure:33052: g++ -c -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall 
-pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi 
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts 
-O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new 
-fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST  
-DQT_THREAD_SUPPORT  -D_REENTRANT -I/usr/local/kde/include 
-I/usr/lib/qt-3.1/include -I/usr/X11R6/include  conftest.cc >&5
conftest.cc:1:7: warning: line number out of range
In file included from configure:33194:
/usr/X11R6/include/X11/extensions/XKBstr.h:77: 'Bool' is used as a type, but is 
   not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:88: 'Atom' is used as a type, but is 
   not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:89: syntax error before `*' token
/usr/X11R6/include/X11/extensions/XKBstr.h:328: syntax error before `*' token
/usr/X11R6/include/X11/extensions/XKBstr.h:349: 'KeySym' is used as a type, but 
   is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:399: 'Atom' is used as a type, but 
   is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:400: 'Atom' is used as a type, but 
   is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:401: 'Atom' is used as a type, but 
   is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:402: 'Atom' is used as a type, but 
   is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:403: 'Atom' is used as a type, but 
   is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:404: parse error before `[' token
/usr/X11R6/include/X11/extensions/XKBstr.h:405: parse error before `[' token
/usr/X11R6/include/X11/extensions/XKBstr.h:406: parse error before `[' token
/usr/X11R6/include/X11/extensions/XKBstr.h:409: syntax error before `*' token
/usr/X11R6/include/X11/extensions/XKBstr.h:410: 'Atom' is used as a type, but 
   is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:425: 'KeyCode' is used as a type, 
   but is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:426: 'KeyCode' is used as a type, 
   but is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:467: 'KeyCode' is used as a type, 
   but is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:468: 'KeyCode' is used as a type, 
   but is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:471: 'KeyCode' is used as a type, 
   but is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:473: 'KeyCode' is used as a type, 
   but is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:475: 'KeyCode' is used as a type, 
   but is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:477: 'KeyCode' is used as a type, 
   but is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:479: 'KeyCode' is used as a type, 
   but is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:481: 'KeyCode' is used as a type, 
   but is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:490: 'Bool' is used as a type, but 
   is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:574: parse error before `[' token
/usr/X11R6/include/X11/extensions/XKBstr.h:580: 'Atom' is used as a type, but 
   is not defined as a type.
/usr/X11R6/include/X11/extensions/XKBstr.h:582: 'Bool' is used as a type, but 
   is not defined as a type.
configure:33055: $? = 1
configure: failed program was:
| #line 33041 "configure"
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "kdebase"
| #define VERSION "3.1.0"
| #ifdef __cplusplus
| #include <stdlib.h>
| #endif
| #define KDELIBSUFF ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define HAVE_CRYPT 1
| #define ksize_t socklen_t
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_RES_INIT 1
| #define HAVE_RES_INIT 1
| #define SIZEOF_INT 4
| #define SIZEOF_LONG 4
| #define SIZEOF_CHAR_P 4
| #define SIZEOF_SIZE_T 4
| #define SIZEOF_UNSIGNED_LONG 4
| #define HAVE_VSNPRINTF 1
| #define HAVE_SNPRINTF 1
| #define HAVE_LIBZ 1
| #define HAVE_LIBPNG 1
| #define HAVE_LIBJPEG 1
| #define HAVE_LIBPTHREAD 1
| #define HAVE_SHADOW 1
| #define HAVE_LIBTIFF 1
| #define HAVE_DIRENT_H 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_CRYPT_H 1
| #define HAVE_SYS_SELECT_H 1
| #define HAVE_SYS_IOCTL_H 1
| #define HAVE_SYS_STROPTS_H 1
| #define HAVE_STROPTS_H 1
| #define HAVE_TERMIO_H 1
| #define HAVE_TERMIOS_H 1
| #define HAVE_SYS_TERMIOS_H 1
| #define HAVE_LASTLOG_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_RPC_RPC_H 1
| #define HAVE_RPC_KEY_PROT_H 1
| #define HAVE_NCURSES_H 1
| #define HAVE_PATHS_H 1
| #define HAVE_SYSLOG_H 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_SYS_MOUNT_H 1
| #define HAVE_FSTAB_H 1
| #define HAVE_MNTENT_H 1
| #define HAVE_TIME_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_STRING_H 1
| #define HAVE_FLOAT_H 1
| #define HAVE_MATH_H 1
| #define HAVE_SETUPTERM 1
| #define HAVE_UTEMPTER 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_BOOL 1
| #define HAVE_LONG_DOUBLE 1
| #define GETGROUPS_T gid_t
| #define SIZEOF_CHAR 1
| #define SIZEOF_SHORT 2
| #define SIZEOF_INT 4
| #define SIZEOF_LONG 4
| #define HAVE_SOCKET 1
| #define HAVE_STRDUP 1
| #define HAVE_GETDTABLESIZE 1
| #define HAVE_SETPGID 1
| #define HAVE_NICE 1
| #define HAVE_SETEUID 1
| #define HAVE_VSYSLOG 1
| #define HAVE_INITGROUPS 1
| #define HAVE_SETGROUPS 1
| #define HAVE_GETGROUPS 1
| #define HAVE_GRANTPT 1
| #define HAVE_SETPRIORITY 1
| #define HAVE_GETPT 1
| #define HAVE_UNLOCKPT 1
| #define HAVE_PTSNAME 1
| #define HAVE_WAITPID 1
| #define HAVE_SETENV 1
| #define HAVE_SETENV_PROTO 1
| #define HAVE_UNSETENV 1
| #define HAVE_UNSETENV_PROTO 1
| #define HAVE_GETDOMAINNAME 1
| #define HAVE_GETDOMAINNAME_PROTO 1
| #define HAVE_GETHOSTNAME 1
| #define HAVE_GETHOSTNAME_PROTO 1
| #define HAVE_USLEEP 1
| #define HAVE_USLEEP_PROTO 1
| #define HAVE_RANDOM 1
| #define HAVE_RANDOM_PROTO 1
| #define HAVE_SRANDOM 1
| #define HAVE_SRANDOM_PROTO 1
| #define HAVE_S_ISSOCK 1
| #define KDEMAXPATHLEN 4096
| #define UTMP_SUPPORT 1
| #define UTMP "/var/run/utmp"
| #define PATH_JAVA "/usr/java/jdk1.3.1_02/bin/java"
| #define HAVE_XTEST 1
| #define HAVE_XKB 1
| #define HAVE_XKBSETPERCLIENTCONTROLS 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 <X11/extensions/XKBstr.h>
configure:33071: result: no
configure:33075: checking X11/extensions/XKBstr.h presence
configure:33086: g++ -E  -DQT_THREAD_SUPPORT  -D_REENTRANT 
-I/usr/local/kde/include -I/usr/lib/qt-3.1/include -I/usr/X11R6/include  
conftest.cc
configure:33092: $? = 0
configure:33111: result: yes
configure:33131: WARNING: X11/extensions/XKBstr.h: present but cannot be 
compiled
configure:33133: WARNING: X11/extensions/XKBstr.h: check for missing 
prerequisite headers?
configure:33135: WARNING: X11/extensions/XKBstr.h: proceeding with the 
preprocessor's result
configure:33147: checking for X11/extensions/XKBstr.h
configure:33154: result: yes




reply via email to

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