Thu 18 Mar 2010 10:49:08 AM UTC, original submission:
screen compilation fails on HP-UX:
gcc -c -I. -I. -D_XOPEN_SOURCE=600 -DETCSCREENRC='"/comptel/ilink/xxx/etc/screenrc"' -DSCREENENCODINGS='"/comptel/ilink/xxx/share/screen/utf8encodings"' -DHAVE_CONFIG_H -DGIT_REV=\""`git describe --always 2>/dev/null`"\" \
-D_XOPEN_SOURCE=600 loadav.c
loadav.c:279: error: conflicting types for `nlist64'
/usr/include/nlist.h:108: error: previous declaration of `nlist64'
make: *** [loadav.o] Error 1
The HP-UX's nlist.h contains the next:
...
#ifdef __ia64
#define nlist nlist64
#endif
#ifdef __ia64
#pragma extern nlist
#endif
#if defined(_STDC_) || defined(__cplusplus) || defined(_PROTOTYPES)
extern int nlist(const char* file_name, struct nlist *nl);
#else /* not _STDC_ || __cplusplus || _PROTOTYPES */
extern int nlist();
#endif /* not _STDC_ || __cplusplus || _PROTOTYPES */
#if defined(_LP64_) || ! defined(_STDC_32_MODE_)
# if defined(_STDC_) || defined(__cplusplus) || defined(_PROTOTYPES)
extern int nlist64(const char* filename, struct nlist64* nl);
# else /* not _STDC_ || __cplusplus || _PROTOTYPES */
extern int nlist64();
# endif /* not _STDC_ || __cplusplus || _PROTOTYPES */
#endif
...
line #108 is the one containing 2-arg nlist64 declaration.
If I append -DNLIST_DECLARED to CFLAGS, screen compiles OK. So I suspect there might be a problem in ./configure script...
P.S.
ilink@tunis:/tmp/screen/src > grep def.*NLIST config.h
/* #undef LOADAV_USE_NLIST64 */
/* #undef NLIST_DECLARED */
#define NLIST_STRUCT 1
/* #undef NLIST_NAME_UNION */
ilink@tunis:/tmp/screen/src > grep nlist xxx-configure.log
checking nlist.h usability... yes
checking nlist.h presence... yes
checking for nlist.h... yes
configure: checking n_un in struct nlist...
configure: checking for nlist declaration...
ilink@tunis:/tmp/screen/src >
Here you can see why AC_EGREP fails to find nlist function:
ilink@tunis:/tmp/screen/src > cat nlist.c
#define NLIST_STRUCT 1
#ifdef NLIST_STRUCT
# include <nlist.h>
#else
# include <a.out.h>
#endif
ilink@tunis:/tmp/screen/src > cpp nlist.c | egrep "nlist([[:space:]]+.*\(|\()"
ilink@tunis:/tmp/screen/src > cpp nlist.c | egrep "nlist([[:space:]].\(|\()"
extern int nlist64(const char* file_name, struct nlist64 *nl);
extern int nlist64(const char* filename, struct nlist64* nl);
ilink@tunis:/tmp/screen/src >
Any suggestions? Can configure.in's AC_EGREP_CPP for nlist be fixed at all (replaced with a pair of regexps)?
|