|
From: J. op d. B. <ht...@op...> - 2003-06-19 09:11:08
|
Hi all,
I'm trying to locate/fix the select() problem
on HP-UX 10.20
Sysinfo
-------
uname -a
HP-UX chaos B.10.20 U 9000/800 2004964319 unlimited-user license
gcc -v
Reading specs from
/opt/gcc/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.8.1/specs
gcc version 2.8.1
make -v
GNU Make version 3.78, by Richard Stallman and Roland McGrath.
htdig
htdig-3.2.0b4-20030601
Problem
-------
When running ./configure with numerous option in db directory of htdig,
./configure stops complaining about select() not found:
...
checking for qsort... yes
checking for select... no
configure: error: No select library function.
configure: error: /bin/sh './configure' failed for db
[msql@chaos htdig-3.2.0b4-20030601]$
After some digging(!), it came clear that the gcc compiler
finds two prototypes for select(), one in an include
file and the other, as stated by the config.log file
(I added the -v flag on gcc):
...
configure:12688: checking for select
configure:12741: gcc -v -v -o conftest -g -O2 -Wall -D_REENTRANT
-I/opt/htdig/lib/zlib/include -L/opt/htdig/lib/zlib/lib conftest.c -lz
-w >&5
Reading specs from /opt/gcc/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.8.1/specs
gcc version 2.8.1
/opt/gcc/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.8.1/cpp -lang-c -v
-I/opt/htdig/lib/zlib/include -undef -D__GNUC__=2 -D__GNUC_MIN
OR__=8 -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix
-D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -
D__PWB__ -D__hpux__ -D__unix__ -D__hppa -D__hp9000s800 -D__hp9k8 -D__PWB
-D__hpux -D__unix -Asystem(unix) -Asystem(hpux) -Acpu
(hppa) -Amachine(hppa) -D__OPTIMIZE__ -g -Wall -w -D__hp9000s700
-D_PA_RISC1_1 -D_HPUX_SOURCE -D_HIUX_SOURCE -D_REENTRANT conf
test.c /var/tmp/cca05375.i
GNU CPP version 2.8.1 (hppa)
#include "..." search starts here:
#include <...> search starts here:
/opt/htdig/lib/zlib/include
/usr/local/include
/opt/gcc/hppa1.1-hp-hpux10.20/include
/opt/gcc/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.8.1/include
/usr/include
End of search list.
/opt/gcc/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.8.1/cc1 /var/tmp/cca05375.i
-quiet -dumpbase conftest.c -g -O2 -Wall -w -version
-o /var/tmp/cca05375.s
GNU C version 2.8.1 (hppa1.1-hp-hpux10.20) compiled by CC.
configure:12743: conflicting types for `select'
/usr/include/sys/time.h:512: previous declaration of `select'
configure:12744: $? = 1
configure: failed program was:
| #line 12693 "configure"
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #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_UNISTD_H 1
| #define HAVE_LIBZ 1
| #define WORDS_BIGENDIAN 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
| #define HAVE_ST_BLKSIZE 1
| #define HAVE_DIRENT_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_MUTEX_THREADS 1
| #define HAVE_MUTEX_TAS 1
| #define HAVE_MUTEX_HPPA_MSEM_INIT 1
| #define HAVE_GETUID 1
| #define HAVE_PSTAT_GETDYNAMIC 1
| #define HAVE_SYSCONF 1
| #define HAVE_SCHED_YIELD 1
| #define HAVE_SIGFILLSET 1
| #define HAVE_FCNTL_F_SETFD 1
| #define HAVE_QSORT 1
| /* end confdefs.h. */
| /* System header to define __stub macros and hopefully few prototypes,
| which can conflict with char select (); below.
| Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
| <limits.h> exists even on freestanding compilers. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| {
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char select ();
| /* The GNU C library defines this for functions which it implements
| to always fail with ENOSYS. Some functions are actually named
| something starting with __ and the normal name is an alias. */
| #if defined (__stub_select) || defined (__stub___select)
| choke me
| #else
| char (*f) () = select;
| #endif
| #ifdef __cplusplus
| }
| #endif
|
| int
| main ()
| {
| return f != select;
| ;
| return 0;
| }
It seems that this C-source is defining select() again as char but the
file
Original failing C-source in configure (by autoconf 2.57) but the file
/usr/include/sys/time.h defines it as:
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
Okay, I pulled the configure.in through autoconf 2.13, cut out only
the select() routines and pasted it over the 2.57 select() routine.
Now the C-source generated bij autoconf 2.13 is (below) and
here select is also prototyped (again) as char but this
time the compiler is not complaining....
| #line 2048 "configure"
| #include "confdefs.h"
| /* System header to define __stub macros and hopefully few prototypes,
| which can conflict with char select(); below. */
| #include <assert.h>
| /* Override any gcc2 internal prototype to avoid an error. */
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char select();
|
| int main() {
|
| /* The GNU C library defines this for functions which it implements
| to always fail with ENOSYS. Some functions are actually named
| something starting with __ and the normal name is an alias. */
| #if defined (__stub_select) || defined (__stub___select)
| choke me
| #else
| select();
| #endif
|
| ; return 0; }
So, autoconf 2.57 generated code breaks, autoconf 2.13 generated code
is okay... Baffled me is....
Maybe it's just my system.....
Oh, after that, make breaks on some htdig file...
more on that later... |