From 53bc10be29b9d1c421c0ab21f7163d2f90f16e60 Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Sat, 6 May 2006 11:06:07 +0000 Subject: [PATCH] Added MAKEFLAGS support. --- LFS/master.sh | 4 ++-- optimize/opt_config | 5 +++++ optimize/opt_config.d/noOpt | 3 +++ optimize/optimize_functions | 16 +++++++++++++++- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/LFS/master.sh b/LFS/master.sh index 8fdfe20..a92e84a 100755 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -112,7 +112,7 @@ chapter5_Makefiles() { # Insert instructions for unpacking the package and to set the PKGDIR variable. wrt_unpack "$FILE" - [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" + [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags fi # Insert date and disk usage at the top of the log file, the script run @@ -216,7 +216,7 @@ chapter6_Makefiles() { if [ "$vrs" != "" ] ; then FILE="$name-$vrs.tar.*" wrt_unpack2 "$FILE" - [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" + [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags fi # In the mount of kernel filesystems we need to set LFS diff --git a/optimize/opt_config b/optimize/opt_config index 56c3530..02a4280 100644 --- a/optimize/opt_config +++ b/optimize/opt_config @@ -7,6 +7,11 @@ #$Id$ # +#--- Extra flags passed to the packages make commands +# "unset" will cause the variable to be not set +# instead of just set to null. +MAKEFLAGS="-j3" + #--- Default optimization mode # This level is overridden by definitions in opt_override; # in this way, packages can be tuned independently. For example, diff --git a/optimize/opt_config.d/noOpt b/optimize/opt_config.d/noOpt index 168d46f..26c2502 100644 --- a/optimize/opt_config.d/noOpt +++ b/optimize/opt_config.d/noOpt @@ -9,6 +9,9 @@ # doing. By default, this is set to disable optimization # of packages known to have build or runtime failure. # +# Also, if you what to use MAKEFLAGS but no build +# optimizations, set this mode in DEF_OPT_LVL +# # Usage: - Apply optimization string to each variable # - "unset" will cause the variable to be not set # instead of being just set to null. diff --git a/optimize/optimize_functions b/optimize/optimize_functions index 73e387a..cffa3dc 100644 --- a/optimize/optimize_functions +++ b/optimize/optimize_functions @@ -29,4 +29,18 @@ EOF continue fi done -} \ No newline at end of file +} + +#----------------------------------# +wrt_makeflags() { # Apply MAKEFLAGS to build +#----------------------------------# + if [[ "$MAKEFLAGS" != "unset" ]]; then +( +cat << EOF + @echo "export MAKEFLAGS=\"$MAKEFLAGS\"" >> envars +EOF +) >> $MKFILE.tmp + else + continue + fi +}