Subject: Re: /usr/pkg/include
To: Julian Assange <proff@suburbia.net>
From: Frederick Bruckman <fb@enteract.com>
List: tech-pkg
Date: 12/28/1999 02:35:16
On Tue, 28 Dec 1999, Julian Assange wrote:

> Is there any reason bsd.pkg.mk doesn't define
> 
> 	CFLAGS+=-I${PREFIX}/include automatically?

It wouldn't work in all cases, as many packages redefine CFLAGS
unconditionally, and for those that don't, it could lead to unintended
collisions with identically named includes. The latest trend is for
the library to put includes in ${PREFIX}/include/foo; to find these
for the client, Gnu configure preserves CPPLFAGS, or takes arguments.
Since you have to take it case-by-case anyway, why take the chance of
messing up many other packages?

> The result of not doing this is hard code the above code snippit
> in the Makefiles of most packages with a compile-time dependency
> -- where it can not be changed easily if ${PREFIX}/include is not
> appropriate -- for instance if the user is installing somewhere
> other than /usr/pkg, but compiling from dependencies already
> installed in /usr/pkg.

For one thing, the package (pkgsrc) Makefile should be using
${X11BASE}/includes or ${LOCALBASE}/includes, as appropriate. I'm not
sure I understand that last part. How would setting
CFLAGS+=-I{PREFIX}/include in bsd.pkg.mk help in that case? If you
patch the packages internal make system to respect CPPFLAGS or
similar, then at least you have a handle for creative set-ups to use.