[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Building on HP-UX problems

From: Matthew Sanderson <matthew_at_formtrap.com>
Date: 2006-03-29 03:17:51 CEST

On Tue, 28 Mar 2006, Brian Hechinger wrote:

> On Tue, Mar 28, 2006 at 10:12:53AM -0800, Garrett Rooney wrote:
> > On 3/28/06, Brian Hechinger <wonko@4amlunch.net> wrote:
> > > I'm trying to build 1.3.0 on an HP-UX box, but I'm running into these
> > > issues:
> > >
> > > Making all in network_io/unix
> > > make[2]: Entering directory `/tmp/monitor/subversion-1.3.0/apr/network_io/unix'
> > > make[3]: Entering directory `/tmp/monitor/subversion-1.3.0/apr/network_io/unix'
> > > /bin/sh /tmp/monitor/subversion-1.3.0/apr/libtool --silent --mode=compile aCC -Ae -mt -I/tmp/monitor/subversion-1.3.0/apr/include/arch/unix -DHAVE_CONFIG_H -DHPUX11 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -I../../include -I../../include/arch/unix -I../../include/arch/unix -c sendrecv.c && touch sendrecv.lo
> > > Error 298: "/usr/include/netinet/tcp.h", line 63 # In ANSI C bitfields must be one of 'int', 'signed int', or 'unsigned int' type.
> > > u_char th_off:4, /* data offset */
> > > ^^^^^^
> > > Error 298: "/usr/include/netinet/tcp.h", line 64 # In ANSI C bitfields must be one of 'int', 'signed int', or 'unsigned int' type.
> > > th_x2:4; /* (unused) */
> >
> > It looks like APR is failing to compile due to some interaction
> > between the C compiler, the set of flags passed to the C compiler, and
> > your system's header files (/usr/include/netinet/tcp.h is part of the
> > Operating System). Perhaps there's some flag that can be added to
> > CFLAGS to make the compiler more permissive?
> That's what I was thinking, but as to how to do that? I had no idea. I've
> never used aCC before this. I can make Sun Studio and MIPSpro sing and dance,
> but I've a long way to go until I will be able to make aCC do that. ;)
> Any recommendations as to what that flag could be? So far I've come up short
> with google and the man pages.
> No offense to any HP-UX fanatics out there, but I have to say that the HP-UX
> man pages are some of the worst I've seen. ;)
> -brian
> --
> "Some people say that if you play a Windows XP install CD backwards
> you will hear demon voices commanding you to worship Satan. But
> that's nothing! If you play it forward it will install Windows XP."
> -- Anonymous
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org

Hi again Brian,

I think when compiling ANSI C on HPPA, one should use /opt/ansic/bin/cc
instead of /opt/aCC/bin/aCC. What happens if you perform the configure
step again, but this time with the additional argument 'CC=cc'? Obviously
'cc' or a symlink to it will have to be in your PATH.

If that fixes it then I suppose 'configure' should be taught to prefer
'cc' over 'aCC' on HPUX somehow. If that doesn't fix it, then read on...

I too had a look through 'man cc' and I too didn't see any options that
would make the compiler be more tolerant of this specific header bug
(well, 'header non-ANSI-ness', at any rate). 'cc -Ae' seems to be as
permissive as it gets with respect to bitfields.

Our copy of /usr/include/netinet/tcp.h has the same bug as yours, but it
seems that at least on our box, 'cc' can compile such code regardless.
I made a test program whose source is below, which compiles and runs on
our HPPA with all of the following compiler command lines:

cc -Ae +DA2.0W -o test test.c
cc -Ae -o test test.c
# LP64, ANSI only
cc -Aa +DA2.0W -o test test.c
# ILP32, ANSI only
cc -Aa -o test test.c
# LP64, default
cc +DA2.0W -o test test.c
# ILP32, default
cc -o test test.c

Does it compile on your machine using 'cc', too? What about with your aCC?
What versions of these tools do you have, especially /opt/ansic/lbin/ccom
which is the real C compiler (cc is just the driver, same setup as GCC).
On our box, the command '/opt/ansic/lbin/ccom -V' outputs:
ccom: HP92453-01 B.11.11.29484.GP HP C Compiler

Sidenote: I wasn't able to test with aCC - it is suddenly complaining
about missing 'flexlm' license files and I have no idea when it broke or
why... <sigh>. But I've never seen aCC sing and dance in the way that GCC
can; the most I've managed was a croak and an ungainly shuffle ;-)
FWIW I find it best to just turn HP-UX into a GNU/HP-UX system - mostly
GNU userland, but HP-supplied kernel, libc and init. Works much better.

Hope this helps,


Matthew Sanderson
Senior Programmer (UNIX)
TCG Information Systems Pty Ltd
Sydney, Australia
+61 (02) 8303 2407

/* netinet/tcp.h needs the u_long etc types that this header can define */
#include <sys/types.h>

 * If this symbol wasn't defined (for example, because you compiled with -Aa)
 * then sys/types.h will not have defined the necessary types after all.
 * In that case we define them here to be able to test compile even with -Aa.
typedef unsigned char u_char;
typedef unsigned int u_int;
typedef unsigned short u_short;
typedef unsigned long u_long;
#endif /* ndef _INCLUDE_HPUX_SOURCE */

#include <netinet/tcp.h>
#include <stdio.h>

main(int argc, char ** argv)
    struct tcphdr hdr;
    puts("Hello, world!");
    return 0;

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Mar 29 03:18:42 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.