[csw-maintainers] Building postgresql-8.4.1
Dagobert Michelsen
dam at opencsw.org
Tue Nov 17 17:58:14 CET 2009
Hi Maciej,
Am 17.11.2009 um 15:58 schrieb Maciej (Matchek) Blizinski:
> I'm looking at building postgresql-8.4.1. I used this db engine
> before a lot and I'd like to have its recent version.
>
> The main problem with compilation is this:
> http://archives.postgresql.org/pgsql-general/2009-11/msg00687.php
>
> In short, the old includes from /opt/csw/postgresql/include are
> breaking the build. How would you fix it? I guess that uninstalling
> the devel postgresql package would help, but it's not the proper
> solution. It looks like a general problem: suppose there are old,
> incompatible header files in the include/ directory. The application
> needs include its foo.h, which is present in both /opt/csw/include/
> and its source directory. The code using the header file just says:
>
> #include "foo.h"
>
> The foo.h file is also in, say ../../../src/include. The compiler
> invocation looks like this:
>
> /opt/studio/SOS11/SUNWspro/bin/cc -Xa -xO3 -xarch=v8
> -I/opt/csw/include -I../../../src/include -I/opt/csw/include -c -o
> nodeGroup.o nodeGroup.c
>
> What should it look like to compile correctly, assuming that the
> /opt/csw/include/foo.h files is incompatible with the software being
> built?
The problem is that GAR adds the include to CPPFLAGS and CFLAGS. An
upstream maintainer (can't remember who) already pointed out that
it is not good to pass -I in CPPFLAGS and CFLAGS and that CPPFLAGS
would be sufficient. The Makefile from Postgres makes the assumption
that it takes CFLAGS, then adds his includes and then the CPPFLAGS.
Putting the include in CFLAGS erranously prepends it before his own
flags.
I had this problem myself some times but didn't recognize the cause
properly:
grep filter-out */trunk/Makefile | grep CFLAGS
I even used argument-reordering on compile invocation for flac to
work around it which may have better be solved in the above way.
Now that I have understood it I would propose to remove
the "-I" from CFLAGS in GAR, but I am afraid that this may break
existing Makefiles as they may rely on it. This is especially true
for manual builds which pass CFLAGS explicitly without passing
CPPFLAGS explicitly.
What do the C-gurus say? James? Anybody?
Best regards
-- Dago
More information about the maintainers
mailing list