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 report)


From: Akim Demaille
Subject: Re: present but cannot be compiled (Was: bug report)
Date: Fri, 20 Jun 2003 09:18:22 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Thanks for the bug report!

Contrary to the message reported by ./configure, this is not a bug in
Autoconf, but the result of a recent incompatible change in Autoconf
that is likely to require the package's configure.ac to be updated.
Please, first make sure you are trying the most recent version of that
package, then, if you are, send all this message (including your
output attached) to the bug list (or the authors) of the package you
were trying to configure.

I've appended two relevant parts of the Autoconf documentation: 1. the
documentation of AC_CHECK_HEADER(S), and 2. how configure.ac should be
upgraded.

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>

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.

`sys/ucred.h'
     On HP Tru64 5.1, `sys/types.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>
          ]])

----------------------------------------------------------------------
Hello,
I was asked to send in a bug report. uname -a says:

        bash-2.05$ uname -a
        FreeBSD localhost 4.8-STABLE FreeBSD 4.8-STABLE #32: Thu May 29 
11:05:55 BST
        2003     address@hidden:/usr/src/sys/compile/POTATO  i386

I was just doing

        bash-2.05$ portupgrade kdeutils

and I got this: (underneath is the list of installed packages - I hope this is 
enough.)

############
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking sys/sysctl.h usability... yes
checking sys/sysctl.h presence... yes
checking for sys/sysctl.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking sys/user.h usability... no
checking sys/user.h presence... yes
configure: WARNING: sys/user.h: present but cannot be compiled
configure: WARNING: sys/user.h: check for missing prerequisite headers?
configure: WARNING: sys/user.h: proceeding with the preprocessor's result
configure: WARNING:     ## ------------------------------------ ##
configure: WARNING:     ## Report this to address@hidden ##
configure: WARNING:     ## ------------------------------------ ##
checking for sys/user.h... yes
checking sys/vmmeter.h usability... yes
checking sys/v
####################

###################
bash-2.05$ pkg_info | sort -f
a2ps-letter-4.13    Formats an ascii file for printing on a postscript printer
aalib-1.2_2         An ascii art library
acrobatviewer-1.1   Viewer for the PDF files written in Java(TM)
acroread-4.05       View, distribute and print PDF documents
apache-2.0.43_1     Version 2 of the extremely popular Apache http server
apsfilter-7.2.2     Magic print filter with file type recognition, print 
previe
arts-1.1.1,1        Audio system for the KDE integrated X11 desktop
autoconf-2.13_1     Automatically configure source code on many Un*x platforms
autoconf213-2.13.000227_5 Automatically configure source code on many Un*x 
platforms
automake-1.4.5_1    GNU Standards-compliant Makefile generator
automake14-1.4.5    GNU Standards-compliant Makefile generator (legacy version
bash-2.05           The GNU Bourne Again Shell
bison-1.35_1        A parser generator from FSF, (mostly) compatible with Yacc
blender-2.20        Fully functional 3D modeling/rendering/animation/gaming 
pac
bluefish-0.6        HTML editor designed for the experienced web designer
bwbasic-2.20        The Bywater Basic interpreter
bzip2-1.0.1         A block-sorting file compressor
cd-write-1.4.1      A X11 based CD-burner
cd2mp3-0.81,1       Easy to use MP3 manipulation and creation tool
compat3x-i386-4.4.20011227 A convenience package to install the compat3x 
libraries
cups-base-1.1.18.0_5 The Common UNIX Printing System: headers, libs, & daemons
cvsup-16.1_1        A general network file distribution system optimized for 
CV
dagrab-0.3.5        Read audio tracks from a CD into wav sound files
enjoympeg-0.4.1     An MPEG-1 video player
esound-0.2.22       A sound library for enlightenment package
expat-1.95.6_1      XML 1.0 parser written in C
fam-2.6.4           A file alteration monitor
fbsd-icons-1.0      A collection of icons related to the FreeBSD project 
(daemo
flashplayer-0.4.10_1 GPL standalone Flash (TM) player
fontconfig-2.2.0    An XML-based font configuration API for X Windows
freefonts-0.10_1    A collection of ATM fonts (not all free) from the CICA 
arch
freetype-1.3.1_2    A free and portable TrueType font rendering engine
freetype2-2.1.4_1   A free and portable TrueType font rendering engine
gdk-pixbuf-0.11.0_1 A graphic library for GTK+
gettext-0.11.4      GNU gettext package
ghostscript-gnu-7.05_2 GNU Postscript interpreter
gimp-1.2.3_2,1      the GNU Image Manipulation Program
glib-1.2.10_4       Some useful routines of C programming
gmake-3.79.1        GNU version of 'make' utility
gnapster-1.5.0      GNOME client for the online mp3 community called napster
gnupg-1.0.6_2       The GNU Privacy Guard
gpa-0.4.3           This is a graphical frontend for the GNU Privacy Guard
gtk-1.2.10_9        Gimp Toolkit for X11 GUI (previous stable version)
html2ps-letter-1.0_1 HTML to PostScript converter
iconv-2.0_1         Charset conversion library and utilities
IglooFTP-0.6.1      Easy to use FTP client for X Window System
ImageMagick-5.4.7.4 Image processing tools (interactive optional--misc/display 
imake-4.3.0         Imake and other utilities from XFree86
imlib-1.9.11        A graphic library for enlightenment package
imwheel-0.9.9       Utility to translate mouse wheel actions into X keyboard 
ev
jargon-4.3.1        The famous jargon file in HTML format
javavmwrapper-1.3   Wrapper script for various Java Virtual Machines
jbigkit-1.4         Lossless compression for bi-level images such as scanned 
pa
jpeg-6b             IJG's jpeg compression utilities
jre-1.1.8           Standard Java Platform for running Java programs
kde-3.1.1           The "meta-port" for KDE
kdebase-3.1.1a      This package provides the basic applications for the KDE 
sy
kdegames-3.1.1      Games for the KDE integrated X11 desktop
kdegraphics-3.1.1   Graphics utilities for the KDE3 integrated X11 desktop
kdelibs-3.1.1a      This is the base set of libraries needed by KDE programs
kdemultimedia-3.1.1 Multimedia utilities for the KDE integrated X11 desktop
kdenetwork-3.1.1    Network-related programs and modules for KDE
kdeutils-3.1.1      Utilities for the KDE integrated X11 desktop
koffice-1.2.1_1,1   Office Suite for KDE3
lame-3.93.1         ISO code based fast MP3 encoder kit
lcms-1.07           Light Color Management System -- a color management 
library
libart_lgpl2-2.3.11 Library for high-performance 2D graphics
libaudiofile-0.2.2  A sound library for SGI audio file
libdivxdecore-devel-0.4.0.50_1 OpenDivX decoding engine from Project Mayo 
(development ver
libflash-0.4.10     GPL Flash (TM) Library
libfpx-1.2.0.4_1    Library routines for working with Flashpix images
libgnugetopt-1.2    GNU getopt library
libiconv-1.8        A character set conversion library
libmng-1.0.2        Multiple-image Network Graphics (MNG) reference library
libmpeg2-0.2.1_1    A free library for decoding mpeg-2 and mpeg-1 video 
streams
libogg-1.0_1,3      Ogg bitstream library
libtool-1.3.4_2     Generic shared library support script
libungif-4.1.0b1    Tools and library routines for working with GIF images
libusb-0.1.7        Library giving userland programs access to USB devices
libvorbis-1.0_1,3   Audio compression codec library
libwmf-0.2.6        Tools and library for converting microsoft's wmf (windows 
m
libwww-5.3.1        The W3C Reference Library
libxml-1.8.17_1     Xml parser library for GNOME
libxml2-2.5.6       Xml parser library for GNOME
libxslt-1.0.29      The XSLT C library for GNOME
linux-divx4linux-5.0.20020418 Linux binary release of DivX (TM) Codec
linux-gtk-1.2_1     RPM of the Gtk lib
linux-jdk-1.4.0     Sun's Java Developers Kit for Linux, version 1.4
linux-jpeg-6b.9_1   RPM of Jpeg lib
linux-netscape-6.2_1 Linux Netscape suite
linux-openmotif-2.1.30 Motif toolkit Linux libraries
linux-opera-6.01.20020523 A blazingly fast, full-featured, standards-compliant 
browse
linux-png-1.0.3_1   RPM of png lib
linux-realplayer-8.cs2 Linux RealPlayer 8.0 from RealNetworks
linux_base-6.1      The base set of packages needed in Linux mode
lynx-2.8.3.1        A non-graphical, text-based World-Wide Web client
m4-1.4              GNU's m4
mad-esound-0.14.2b_2 High-quality MPEG audio decoder
Mesa-3.4.2_1        A graphics library similar to SGI's OpenGL
mkfontalias-0.3     Python script to make fonts.alias files for X
mkisofs-1.14        Create iso9660/Rock Ridge/Joliet filesystems
mod_php4-4.2.3      PHP4 module for Apache
mozilla-1.1_3,2     The open source, standards compliant web browser
mozilla-fonts-1.0_1 Web fonts for Netscape/Mozilla
mpeg_play-2.4       A program to play mpeg movies on X displays
mutt-1.4            The Mongrel of Mail User Agents (part Elm, Pine, Mush, mh, 
mysql-client-3.23.53_1 Multithreaded SQL database (client)
mysql-server-3.23.54 Multithreaded SQL database (server)
nap-1.4.8           An MP3 sharing, search, and chat client for the OpenNAP 
net
nasm-0.98           General-purpose multi-platform x86 assembler
netpbm-10.6         A toolkit for conversion of images between different 
format
open-motif-2.2.2_1  Motif X11 Toolkit (industry standard GUI (IEEE 1295))
openquicktime-1.0   Portable library for handling Apple's QuickTime(TM) files
OQTPlayer-0.5       A very very small, not functionnal, video OpenQuicktime 
(TM
ORBit-0.5.8_1       High-performance CORBA ORB with support for the C language
p5-Data-ShowTable-3.3 Perl5 module to pretty-print arrays of data
p5-DBI-1.28         The perl5 Database Interface.  Required for DBD::* modules
p5-Digest-MD5-2.20  Perl5 interface to the MD5 algorithm
p5-HTML-Parser-3.26 Perl5 module for parse HTML tag
p5-HTML-Tagset-3.03 Some useful data table in parsing HTML
p5-libwww-5.65      Perl5 library for WWW access
p5-MIME-Base64-2.12 Perl5 module for Base64 and Quoted-Printable encodings
p5-Mysql-modules-1.2216 Perl5 modules for accessing MySQL databases
p5-Net-1.11,1       Perl5 modules to access and use network protocols
p5-Net-Daemon-0.36  Perl5 extension for portable daemons
p5-PlRPC-0.2016     Perl module for writing RPC servers and clients
p5-Storable-2.05    Persistency for perl data structures
p5-Test-Harness-2.26 Run perl standard test scripts with statistics
p5-Test-Simple-0.47_1 Basic utilities for writing tests in perl
p5-URI-1.20         Perl5 interface to Uniform Resource Identifier (URI) 
refere
pcre-3.4            Perl Compatible Regular Expressions library
pkgconfig-0.15.0    An utility used to retrieve information about installed 
lib
pm3-base-1.1.15     Compiler and base libraries of the Polytechnique Montreal 
M
pm3-net-1.1.15      Low-level networking libraries for the PM3 Modula-3 
distrib
png-1.2.0           Library for manipulating PNG images
popt-1.5.1          A getopt(3) like library with a number of enhancements, 
fro
portupgrade-20030427 FreeBSD ports/packages administration and management tool 
s
psutils-letter-1.17_1 Utilities for manipulating PostScript documents
pth-1.4.1_1         GNU Portable Threads
python-2.2.2_2      An interpreted object-oriented programming language
qt-3.1.1_5          A C++ X GUI toolkit
rar-3.0,1           File archiver (binary port)
rosegarden-2.1.2    The Rosegarden Editor and Sequencer suite
rpm-3.0.6_5         The Red Hat Package Manager
rtc-2001.09.16.1    Kernel module which provides /dev/rtc device support
ruby-1.6.6.2002.01.29 An object-oriented interpreted scripting language
ruby-1.8.0.p2.2003.04.19 An object-oriented interpreted scripting language
ruby-bdb1-0.1.7     Ruby interface to Berkeley DB revision 1.8x with full 
featu
ruby-shim-ruby18-1.8.0.p2.2003.04.19 A set of Ruby modules to provide Ruby 1.8 
functionalities
ruby_static-1.8.0.p2.2003.04.19 A Ruby binary with some modules compiled in 
(in case of eme
samba-2.2.7a        A free SMB and CIFS client and server for UNIX
sane-backends-1.0.5 API for access to scanners, digitals camera, frame 
grabbers
sane-frontends-1.0.5 Tools for access to scanners, digitals camera, frame 
grabbe
sdl-1.2.4_1         Cross-platform multi-media development API (developm. 
vers.
sed_inplace-2002.06.17 A modified version of the sed(1) which can do in-place 
edit
sharefonts-0.10     A collection of shareware ATM fonts from the CICA archives
smpeg-0.4.4         A free MPEG1 video player library with sound support
svgalib-1.4.2_1     A low level console graphics library
tcl-8.2.3           Tool Command Language
tclmidi-3.1         A language designed for creating and editing standard MIDI
teTeX-1.0.7         Thomas Esser's distribution of TeX & friends
tiff-3.5.5          Tools and library routines for working with TIFF images
tix-4.1.0.007       An extension to the Tk toolkit
tk-8.2.3            Graphical toolkit for TCL
tkcron-2.12         A frontend to crontab
ttmkfdir-0.0        Create fonts.scale file for use with TrueType font server
unzip-5.42          List, test and extract compressed files in a ZIP archive
uulib-0.5.18        A library for uu/xx/Base64/BinHex/yEnc de-/encoding
vilearn-1.0         An interactive tutorial for the vi editor
virt-1.0            Game and keyboard teacher in one. Enjoy it!
vmware2-2.0.4.1142  A virtual machine emulator - a full PC in a window
weblint-1.020       HTML validator and sanity checker
win32-codecs-011002.0.0.60 Huge compilation of Win32 binary codecs, including 
MPEG-4(D
wine-2001.08.24     Microsoft Windows 3.1/95/98/NT/2000 emulator for Unix
wrapper-1.0_3       Wrapper for XFree86-4 server
xanim-2.92.0        Play most popular animation formats and show pictures
xfractint-3.10      The Unix port of fractint
XFree86-4.3.0,1     X11/XFree86 core distribution (complete, using 
mini/meta-po
XFree86-clients-4.3.0_1 XFree86-4 client programs and related files
XFree86-documents-4.3.0 XFree86-4 documentation
XFree86-font100dpi-4.3.0 XFree86-4 bitmap 100 dpi fonts
XFree86-font75dpi-4.3.0 XFree86-4 bitmap 75 dpi fonts
XFree86-fontCyrillic-4.3.0 XFree86-4 Cyrillic fonts
XFree86-fontDefaultBitmaps-4.3.0 XFree86-4 default bitmap fonts
XFree86-fontEncodings-4.3.0 XFree86-4 font encoding files
XFree86-fontScalable-4.3.0 XFree86-4 scalable fonts
XFree86-FontServer-4.3.0 XFree86-4 font server
XFree86-libraries-4.3.0_3 XFree86-4 libraries and headers
XFree86-Server-4.3.0_6 XFree86-4 X server and related programs
Xft-2.1_8           A client-sided font API for X applications
xkobo-1.11          Multi-way scrolling shoot 'em up game for X.  Strangely 
add
xlife-3.0           John Horton Conway's Game of Life
xpm-3.4k            The X Pixmap library
xrn-9.02            Usenet News reader for the X Window System
xv-3.10a_2          An X11 program that displays images of various formats
xvid-0.20020412_1   An opensource MPEG-4 codec, based on OpenDivx
zip-2.3             Create/update ZIP files compatible with pkzip









reply via email to

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