[csw-maintainers] gar: -I/opt/csw/include -I. should be -I. -I/opt/csw/include
Sebastian Kayser
skayser at opencsw.org
Mon May 17 21:39:35 CEST 2010
rupert THURNER wrote on 17.05.2010 20:49:
> On Mon, May 17, 2010 at 11:07, Dagobert Michelsen <dam at opencsw.org> wrote:
>> Am 16.05.2010 um 09:49 schrieb rupert THURNER:
>>> hi, what would be the best way to turn the inclusion directories. in
>>> this case, we have an old version of serf, and its .h files gets
>>> included instead of the new versions to be compiled.
>> Difficult. You have to look how -I/opt/csw/include gets there,
>> by which variable in the Makefile. Then you either change the
>> variables passed to "make" (preferred), patch the Makefile or,
>> as a last resort, rewrite the arguments by a "cc" stub like in
>> <http://sourceforge.net/apps/trac/gar/browser/csw/mgar/pkg/flac/trunk/bin/>
>
> this seems quite complex? the current makefile is here:
> http://sourceforge.net/apps/trac/gar/browser/csw/mgar/pkg/libserf/trunk/Makefile,
> and i did not put anything to tinker with that order. at least not
> deliverately.
Have a look at the output of "gmake modenv". GAR pre-sets default
preprocessor, compiler, and linker flags WRT to /opt/csw via the
environment. For libserf CPPFLAGS is the interesting one.
$ gmake modenv | grep CPPFLAGS
CPPFLAGS = -I/opt/csw/include
Combined with the serf Makefile ...
$ grep CPPFLAGS work/solaris9-i386/build-isa-i386/serf-0.6.1/Makefile
CPPFLAGS = -DSOLARIS2=8 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE64_SOURCE -I/opt/csw/include
$(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o $@ $< && touch $@
... this translates to the failing build invocation. When you swap
$(CPPFLAGS) and $(INCLUDES) the build continues.
> should it not be the default that the files delivered with a package
> source should be the first in the path for everything, in any case,
> every package?
I don't have a strong stance here, but I would think that if a
software build absolutely needs to make sure -I. comes first, then
it should also place it properly for the compiler invocation
(i.e. even before any possibly given -I in $CPPFLAGS).
Sebastian
More information about the maintainers
mailing list