[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnulib unsetenv/environ compile failure in hp-ux
From: |
Bruno Haible |
Subject: |
Re: gnulib unsetenv/environ compile failure in hp-ux |
Date: |
Mon, 25 May 2009 00:12:27 +0200 |
User-agent: |
KMail/1.9.9 |
address@hidden wrote:
> The compile fails with
>
> cc -DHAVE_CONFIG_H -I. -I.. ... -g -z +O2 -c unsetenv.c +Z -DPIC -o
> .libs/unsetenv.o
> cc: "unsetenv.c", line 67: error 1588: "environ" undefined.
This fails because this command line does not include the option -Ae or
-D_HPUX_SOURCE. One of these options is necessary, otherwise the HP-UX
/usr/include/*.h files lack many POSIX declarations. In particular the one
of 'environ'.
The INSTALL file in gnulib recommends that for HP-UX cc not only the option
"-Ae" but also "-D_XOPEN_SOURCE=500" should be used.
> configure:27297: checking if environ is properly declared
> configure:27325: cc -c -g -z +O2 -Ae -Wp,-H32768 ... conftest.c >&5
> cc: "conftest.c", line 41: error 1584: Inconsistent type declaration:
> "environ".
> cc: "conftest.c", line 45: error 1529: Cannot select field of non-structure.
Here the 'environ' declaration is visible because "-Ae" is part of the command
line.
Maybe you have passed -Ae not as part of the CC variable but as part of CFLAGS
or CPPFLAGS, and a particular Makefile rule ignores CFLAGS and CPPFLAGS.
(Unlikely because the Makefile rules were generated by automake.) Or maybe
you have overridden CFLAGS and/or CPPFLAGS somewhere? You shouldn't do that.
Automake provides variables AM_CFLAGS and AM_CPPFLAGS that you can override
instead.
Bruno