tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Environment settings not taken into account by (portable) bmake(1)?(!)



   Date: Sat, 05 Nov 2016 18:47:54 +0100
   From: Steffen Nurpmeso <steffen%sdaoden.eu@localhost>
   
   I am currently fixing the build system of the MUA i maintain
   because the portable version of bmake looses CFLAGS (and LDFLAGS
   i think) from the environment.

Can you share a small isolated example that demonstrates the problem
you're observing?  Certainly bmake does respect environment variables
for make macro expansion:

% printf 'x:;@echo ${CFLAGS}' | CFLAGS=abcd bmake -f /dev/stdin
abcd
% printf 'x:;@echo ${CFLAGS}' | bmake -f /dev/stdin CFLAGS=abcd
abcd

However, following POSIX, any assignments in the makefile itself
override environment variables, unless you use the -e option:

% printf 'CFLAGS=pqrs\nx:;@echo ${CFLAGS}' | CFLAGS=abcd bmake -f /dev/stdin
pqrs
% printf 'CFLAGS=pqrs\nx:;@echo ${CFLAGS}' | CFLAGS=abcd bmake -f /dev/stdin -e
abcd
% printf 'CFLAGS=pqrs\nx:;@echo ${CFLAGS}' | bmake -f /dev/stdin CFLAGS=abcd
abcd


Home | Main Index | Thread Index | Old Index