cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl 7.10.4-pre3 on HP-UX using GCC v3.2

From: Rick Jones <rick_jones2_at_hp.com>
Date: Tue, 11 Mar 2003 16:11:19 -0800

for grins, and since i'll eventually need an up-to-date libcurl for
netperf work, I tried to compile the 7.10.4-pre3 bits on an HP-UX 11.11
system with the HP ANSI C compiler installed.

First, the if_ether.h error appears to stem from not also including
net/if_arp.h to get the definition of a struct arphdr, as which ea_hdr
in netinet/if_ether is declared.

configure:14065: checking netinet/if_ether.h usability
configure:14078: cc -c -g conftest.c >&5
cc: "/usr/include/netinet/if_ether.h", line 126: error 1574: Unknown
size for "ea_hdr".
cc: "/usr/include/netinet/if_ether.h", line 126: error 1578: Size of
struct or union member is unknown.
cc: "/usr/include/netinet/if_ether.h", line 157: error 1574: Unknown
size for "ea_hdr".
cc: "/usr/include/netinet/if_ether.h", line 157: error 1578: Size of
struct or union member is unknown.
configure:14081: $? = 1

$ find /usr/include -exec grep -l arphdr {} \;
/usr/include/net/if_arp.h
/usr/include/netinet/if_ether.h

It looks like the if_ether.h checks are in a loop with a bunch of
others. It may be necessary to break if_ether.h out into its own test
and perhaps have an #ifdef __hpux #include <net/if_arp.h> #endif added.

As for gettimeofday:

configure:14905: cc -o conftest -g conftest.c >&5
cc: "configure", line 14939: error 1584: Inconsistent type declaration:
"gettimeofday".
cc: "configure", line 14946: warning 604: Pointers are not
assignment-compatible.
cc: "configure", line 14955: warning 605: Illegal pointer combination
for !=.configure:14908: $? = 1
configure: failed program was:

I extracted the program from the log (very nice that the whole thing is
there, makes life much easier, but would be easier still without the
leading "| " :)

$ cat foo.c
/* #line 14860 "configure" */
/* confdefs.h. */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE "curl"
#define VERSION "7.10.4-pre3"
#define OS "hppa2.0w-hp-hpux11.11"
#define _FILE_OFFSET_BITS 64
#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_DLFCN_H 1
#define HAVE_GETADDRINFO 1
#define ENABLE_IPV6 1
#define HAVE_O_NONBLOCK 1
#define HAVE_WRITABLE_ARGV 1
#define HAVE_LOCALTIME_R 1
#define NEED_REENTRANT 1
#define HAVE_GMTIME_R 1
#define STDC_HEADERS 1
#define HAVE_UNISTD_H 1
#define HAVE_MALLOC_H 1
#define HAVE_STDLIB_H 1
#define HAVE_ARPA_INET_H 1
#define HAVE_NET_IF_H 1
#define HAVE_NETINET_IN_H 1
#define HAVE_NETINET_IF_ETHER_H 1
#define HAVE_NETDB_H 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_TERMIOS_H 1
#define HAVE_TERMIO_H 1
#define HAVE_SGTTY_H 1
#define HAVE_FCNTL_H 1
#define HAVE_DLFCN_H 1
#define HAVE_ALLOCA_H 1
#define HAVE_TIME_H 1
#define HAVE_PWD_H 1
#define HAVE_UTIME_H 1
#define HAVE_SYS_POLL_H 1
#define HAVE_SETJMP_H 1
#define TIME_WITH_SYS_TIME 1
#define RETSIGTYPE void
#define HAVE_SOCKET 1
#define HAVE_STRDUP 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_UNAME 1
#define HAVE_STRCASECMP 1
#define HAVE_GETHOSTBYADDR 1
/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char gettimeofday (); 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 gettimeofday ();
/* 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_gettimeofday) |defined (__stub___gettimeofday)
choke me
#else
char (*f) () = gettimeofday;
#endif
#ifdef __cplusplus
}
#endif
int
main ()
{
return f != gettimeofday;
  ;
  return 0;
}

and commented-out the line directive. Seems the HP compiler is grumpy
with:

char gettimeofday ();

If I comment that out, the compiler only warns about types:

$ cc foo.c
cc: "foo.c", line 87: warning 604: Pointers are not
assignment-compatible.
cc: "foo.c", line 95: warning 605: Illegal pointer combination for !=.
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (foo.o) was
detected. The linked output may not run on a PA 1.x system.

If instead, I remove the include of limits.h, the test code compiles fat
dumb and happy. From that I guess that the include of limits.h ends-up
including a file that gives a definition of gettimeofday() - and of
course the redeclaration of gettimeofday as a char makes it rather
grumpy.

the issue with select appears to be the same:

-configure:14905: cc -o conftest -g conftest.c >&5
cc: "configure", line 14933: error 1584: Inconsistent type declaration:
"select".
cc: "configure", line 14940: warning 604: Pointers are not
assignment-compatible.
cc: "configure", line 14949: warning 605: Illegal pointer combination
for !=.configure:14908: $? = 1

This also happens for strftime.

So, it seems to be an autoconf vs HP-UX includes issue?

hth,

rick jones
-
Wisdom Teeth are impacted, people are affected by the effects of events.
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to raj in cup.hp.com but NOT BOTH...

-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
Received on 2003-03-12