Tue 25 Jan 2011 09:20:18 PM UTC, original submission:
On my run-of-the-mill Debian Lenny system:
martind@whitewater:~/download/make-cvs/whitewater2$ uname -a
Linux whitewater 2.6.26-2-amd64 #1 SMP Thu Nov 25 04:30:55 UTC 2010 x86_64 GNU/Linux
martind@whitewater:~/download/make-cvs/whitewater2$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.2-1.1' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-cld --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.2 (Debian 4.3.2-1.1)
martind@whitewater:~/download/make-cvs/whitewater2$
The build from clean, from CVS, fails at:
../make/main.c:534: error: static declaration of ‘bsd_signal’ follows non-static declaration
/usr/include/signal.h:109: error: previous declaration of ‘bsd_signal’ was here
../make/main.c: In function ‘main’:
../make/main.c:1872: warning: comparison of unsigned expression < 0 is always false
../make/main.c:2209: warning: comparison of unsigned expression < 0 is always false
make[2]: *** [main.o] Error 1
The conftest results in:
configure:8605: checking whether bsd_signal is declared
configure:8635: gcc -c -g -O2 conftest.c >&5
conftest.c: In function 'main':
conftest.c:76: error: 'bsd_signal' undeclared (first use in this function)
conftest.c:76: error: (Each undeclared identifier is reported only once
conftest.c:76: error: for each function it appears in.)
config.log says the program being compiled is:
| /* end confdefs.h. */
| #include <signal.h>
|
| int
| main ()
| {
| #ifndef bsd_signal
| (void) bsd_signal;
| #endif
|
| ;
| return 0;
| }
If, however, I try to compile that program, or something very similar, with an extra macro:
#define _GNU_SOURCE 1
#include <signal.h>
int main() {
(void) bsd_signal;
}
Then it succeeds. make.h defines this macro before including signal.h:
/* Specify we want GNU source code. This must be defined before any
system headers are included. */
#define _GNU_SOURCE 1
...
#include <signal.h>
Searching for bsd_signal here, I see this changed not too long ago, under:
bug #25713: Please note CPPFLAGS required to build on Tru64
After Google pointed me to http://www.airs.com/ian/configure/configure_2.html, specifically the mention of how to define _GNU_SOURCE in autoconf, I tried the attached patch, which seemed to work for me. I have no idea what I'm doing with autoconf. Perhaps the macro should be defined earlier in configure.in.
|