Subject: Problems with CFLAGS inheritance
To: None <port-pc532@NetBSD.ORG>
From: Julian H Stacey <Julian.H.Stacey@regent.e-technik.tu-muenchen.de>
List: port-pc532
Date: 10/19/1994 00:55:32
I am seeing problems with CFLAGS inheritance:

I can fix some things at the cost of breaking others,
but I'd welcome a proper clean solution
(simple suggestions such as `use make -e' aren't useful for /usr/src,
as the subsidiary Makefile's internal CFLAGS stuff is wanted as well as
my login/csh global CFLAGS such as -O1/3 etc )

I might add Stuart is experiencing the same pain.

I'm running a system with binaries not recompiled for a few weeks,
with /usr/src mirrored 94 10 14, starting with `make build'.

Phil, I'd welcome you posting your printenv & alias stuff 
re CFLAGS LDFLAGS MFLAGS MAKEFLAGS etc.

Some Detail follows:
----------

I get loads of things such as:
	===> atrun
	cc   -o atrun atrun.o 
	ld: No reference to __DYNAMIC

If I remove the # in src/lib/csu/ns32k/Makefile (leo@marco.de suggestion):
	< CFLAGS+=        -DLIBC_SCCS # -DDYNAMIC
	> CFLAGS+=        -DLIBC_SCCS -DDYNAMIC
& make clean all install, 
cd /usr/src/usr.bin/apropos ; make clean all install
apropos apropos
	ld.so: ld.so: warning: non pure code in /usr/lib/libc.so.12.0 at 2243b ()
	apropos (1) - locate commands by keyword lookup


So I thought i'd simply compile the whole system static & install it (to get
up to date), then recompile shared, but ... it's Not That Easy !
It _should_ be possible to do something like:
	setenv CFLAGS "-static -DMY_NAME"
	setenv LDFLAGS	-static
	cd /usr/src
	make CFLAGS="-static -DMY_NAME" LDFLAGS=-static
so that the whole thing compiles static, & with any user peculiarities enabled,
by -DMY_NAME being automatically applied to every cc inside /usr/src,
but it's not that simple, some things see a static, some dont, for instance:

cd /usr/src/libexec
make CFLAGS="-static -DJULIAN_STACEY" LDFLAGS=-static
	===> atrun
	cc   -o atrun atrun.o 
	ld: No reference to __DYNAMIC
	*** Error code 1

Note the
	atrun/Makefile
		CFLAGS+= -I${.CURDIR}/../../usr.bin/at
is ignored !
( My -static -DJULIAN_STACEY is missing too, though I presume that's my fault)

Julian Stacey <stacey@freefall.cdrom.com>