Environment in Makefiles

Alexander E. Patrakov patrakov at ums.usu.ru
Sat Jan 14 03:13:37 PST 2006


our Makefiles thorougly copy the environment suggested in LFS, even in 
parts that are irrelevant (or even harmful) to non-interactive builds. 
In particular:

1) the "set +h" is not needed because a separate copy of bash is fired 
for each package, and there is no path hashing between separate copies 
of bash
2) $INPUTRC is only relevant ro reading lines interactively from the 
3) $PS1 only affects prompts and is completely unused while building 
4) CFLAGS and CXXFLAGS can be omitted from the "env" lines because the 
Makefile exports these variables from itself
5) The "-" in the "su" commands makes the new shell a login shell, but 
there is no benefit in doing so because the new shell is non-interactive 

When this cruft gets removed, further simplification is possible:

Remove the differences in the chenv-pre-bash, chenv-post-bash and 
chenv-blfs due to the facts that "/bin/sh -c ..." always works and the 
environment there is just the same (yes, this means the /usr/bin/env -> 
/tools/bin/env symlink). Remove the "chroot" command from all 
packages/*/Makefile files and instead move it to the main Makefile and 
adjust $PATH as an argument to $(std_build).

This simplification is important for me because it allows easily 
replacing all "chroot" commands with, e.g., invocations of 

Do you agree with the proposed changes?

Alexander E. Patrakov

More information about the livecd mailing list