problems building CVS snapshot

Klaus Zeitler
2003-05-27T09:16:11Z

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

since I have I few problems with gdb 5.0 and 5.2 under SunOS-5.8 I thought
I'll go and check the CVS version, thus I fetched gdb+dejagnu-20030526
and tried configure and make. Here are 4 problems I ran into:

1. configure complains about sys/ptem.h

checking sys/ptem.h usability... no
checking sys/ptem.h presence... yes
configure: WARNING: sys/ptem.h: present but cannot be compiled
configure: WARNING: sys/ptem.h: check for missing prerequisite headers?
configure: WARNING: sys/ptem.h: proceeding with the preprocessor's result
configure: WARNING: ## ------------------------------------ ##
configure: WARNING: ## Report this to bug-autoconf@gnu.org. ##
configure: WARNING: ## ------------------------------------ ##

a test C program that additionally contains sys/streams.h does compile.

I reported this yesterday to bug-autoconf and got the following reply:

[-- Attachment #2: bug-autoconf reply --]
[-- Type: application/octet-stream, Size: 12174 bytes --]

From nobody Tue May 27 09:55:32 2003
X-From-Line: akim@lrde.epita.fr Tue May 27 08:41:33 2003
Return-Path: <akim@lrde.epita.fr>
Received: from ihrh1.emsr.lucent.com (ihrh1.emsr.lucent.com [135.1.218.53])
by sfsws1.de.lucent.com (8.11.7+Sun/8.8.5) with ESMTP id h4R6fWR04111
for <kzeitler@gsm-mailhost.de.lucent.com>; Tue, 27 May 2003 08:41:32 +0200 (MEST)
Received: from ihemail1.firewall.lucent.com by ihrh1.emsr.lucent.com (8.11.6+Sun/EMS-1.5 Solaris/emsr)
id h4R6fVt19321; Tue, 27 May 2003 01:41:31 -0500 (CDT)
Received: from epita.fr (hermes.epita.fr [163.5.255.10])
by ihemail1.firewall.lucent.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id h4R6fPs16652
for <kzeitler@lucent.com>; Tue, 27 May 2003 02:41:29 -0400 (EDT)
Received: from kualalumpur.lrde.epita.fr (kualalumpur.lrde.epita.fr [10.223.13.1])
by epita.fr id h4R6fNI13536
Tue, 27 May 2003 08:41:23 +0200 (MEST)
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
by kualalumpur.lrde.epita.fr with esmtp (Exim 3.35 #1 (Debian))
id 19KY95-0003Az-00; Tue, 27 May 2003 08:41:15 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.36 #1 (Debian))
id 19KY95-0007KC-00; Tue, 27 May 2003 08:41:15 +0200
To: Klaus Zeitler <kzeitler@lucent.com>
Cc: bug-autoconf@gnu.org
Subject: Re: present but cannot be compiled (Was: check for sys/ptem.h fails
on SunOS-5.8)
References: <q5gu1bhyht7.fsf@lucent.com>
From: Akim Demaille <akim@epita.fr>
Date: Tue, 27 May 2003 08:41:14 +0200
In-Reply-To: <q5gu1bhyht7.fsf@lucent.com> (Klaus Zeitler's message of "26
May 2003 15:10:44 +0200")
X-Gnus-Mail-Source: file:/var/mail/kzeitler
Message-ID: <mv48yssuc1h.fsf@nostromo.lrde.epita.fr>
User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: Akim Demaille <akim@lrde.epita.fr>
X-Spam-Status: No, hits=-20.9 required=5.0
tests=BAYES_01,IN_REP_TO,REFERENCES,USER_AGENT_GNUS_UA
autolearn=ham version=2.53
X-Spam-Level:
X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp)
Lines: 266
Xref: sfsw51 in:7884

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 bug-autoconf@gnu.org. ##
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>
]])

----------------------------------------------------------------------
while trying to build the readline lib for gdb, autoconf reported
the following problem:

Beginning configuration for readline-4.3 for sparc-sun-solaris2.8

...

checking sys/ptem.h usability... no
checking sys/ptem.h presence... yes
configure: WARNING: sys/ptem.h: present but cannot be compiled
configure: WARNING: sys/ptem.h: check for missing prerequisite headers?
configure: WARNING: sys/ptem.h: proceeding with the preprocessor's result
configure: WARNING: ## ------------------------------------ ##
configure: WARNING: ## Report this to bug-autoconf@gnu.org. ##
configure: WARNING: ## ------------------------------------ ##

My guess is that sys/streams.h is missing in the test program.
That's only a guess cause I don't understand that configure stuff anyway.

[-- Attachment #3: Type: text/plain, Size: 2288 bytes --]

2. compile of infrun.c fails

gcc -c -g -O2 -I/usr/include/v9 -I. -I. -I./config -DLOCALEDIR="\"/vol/freeware/SunOS-5.8/gdb+dejagnu/20030526/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../readline/.. -I../bfd -I./../bfd -I./../include -I../intl -I./../intl -DMI_OUT=1 -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized infrun.c
/usr/ccs/bin/as: "/var/tmp/ccWcVZ58.s", line 3774: error: constant value must be between -4096 and 4095
make[1]: *** [infrun.o] Error 1
make[1]: Leaving directory `/vol/freeware/source/gdb+dejagnu-20030526/gdb'

3. normally I don't build in the source directory, but if I try to build
in a separate build directory, make stops in example/calc with:

configuring in example/calc
running /bin/sh /vol/freeware/source/gdb+dejagnu-20030526/dejagnu/example/calc/configure --build=sparc-sun-solaris2.8 --host=sparc-sun-solaris2.8 --target=sparc-sun-solaris2.8 --prefix=/vol/freeware/SunOS-5.8/gdb+dejagnu/20030526 --cache-file=../../.././config.cache --srcdir=/vol/freeware/source/gdb+dejagnu-20030526/dejagnu/example/calc
loading cache ../../.././config.cache
checking for a BSD compatible install... /bin/sh $s/install-sh -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
configure: error: source directory already configured; run make distclean there first
configure: error: /vol/freeware/source/gdb+dejagnu-20030526/dejagnu/example/calc/configure failed for example/calc
make: *** [configure-dejagnu] Error 1
ERROR: gdb: make

4. on our system is tcl/tk 8.0.5 installed (old I know)
It seems as if gdb comes with its own tcl (8.4.1) but no tk.
configure doesn't find the installed tk version (on my system tcl/tk is
installed under /usr/local/gnu). configure has an option with-tkconfig that
I could use, but I guess using tcl 8.4.1 together with tk 8.0.5 might be
asking for trouble anyway.

I appreciate any help

Thanks

Klaus

--
------------------------------------------
| Klaus Zeitler Lucent Technologies |
| Email: kzeitler@lucent.com |
------------------------------------------
---
The confusion of a staff member is measured by the length
of his memos. -- New York Times, Jan. 20, 1981