From 2c2471d36eda4a9443df7f56c9fa808529e91f1f Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Sat, 6 May 2006 10:35:19 +0000 Subject: [PATCH] Added optimize/optimize_functions. --- common/common-functions | 27 --------------------------- master.sh | 8 ++++++++ optimize/optimize_functions | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 27 deletions(-) create mode 100644 optimize/optimize_functions diff --git a/common/common-functions b/common/common-functions index dee72e8..1db3e97 100644 --- a/common/common-functions +++ b/common/common-functions @@ -287,33 +287,6 @@ EOF } -#----------------------------------# -wrt_optimize() { # Apply pkg specific opt's to build -#----------------------------------# - local pkg=$1 - local optLvl optVal OPT_VAR - - optLvl=`awk -v pkg="$pkg" '$1 == pkg { print $2 }' $JHALFSDIR/opt_override` - if [[ "$optLvl" = "" ]] ; then - optLvl=$DEF_OPT_LVL; - fi - - for OPT_VAR in $ACTIVE_OPT_VARS ; do - eval optVal=\$${OPT_VAR}_$optLvl - - if [[ "$optVal" != "unset" ]]; then -( -cat << EOF - @echo "export $OPT_VAR=\"$optVal\"" >> envars -EOF -) >> $MKFILE.tmp - else - continue - fi - done -} - - #----------------------------------# wrt_run_as_su() { # Execute script inside time { }, footer to log file #----------------------------------# diff --git a/master.sh b/master.sh index 46f89d4..69a74a2 100755 --- a/master.sh +++ b/master.sh @@ -464,6 +464,14 @@ if [[ "$COMPARE" = "1" ]]; then [[ $VERBOSITY > 0 ]] && echo "OK" fi # +# optimize module +if [[ "$OPTIMIZE" != "0" ]]; then + [[ $VERBOSITY > 0 ]] && echo -n "Loading optimization module..." + source optimize/optimize_functions + [[ $? > 0 ]] && echo " optimize/optimize_functions did not load.." && exit + [[ $VERBOSITY > 0 ]] && echo "OK" +fi +# # optimize configurations if [[ "$OPTIMIZE" != "0" ]]; then [[ $VERBOSITY > 0 ]] && echo -n "Loading optimization config..." diff --git a/optimize/optimize_functions b/optimize/optimize_functions new file mode 100644 index 0000000..73e387a --- /dev/null +++ b/optimize/optimize_functions @@ -0,0 +1,32 @@ +#!/bin/bash + +# $Id$ + +set +e + + +#----------------------------------# +wrt_optimize() { # Apply pkg specific opt's to build +#----------------------------------# + local pkg=$1 + local optLvl optVal OPT_VAR + + optLvl=`awk -v pkg="$pkg" '$1 == pkg { print $2 }' $JHALFSDIR/opt_override` + if [[ "$optLvl" = "" ]] ; then + optLvl=$DEF_OPT_LVL; + fi + + for OPT_VAR in $ACTIVE_OPT_VARS ; do + eval optVal=\$${OPT_VAR}_$optLvl + + if [[ "$optVal" != "unset" ]]; then +( +cat << EOF + @echo "export $OPT_VAR=\"$optVal\"" >> envars +EOF +) >> $MKFILE.tmp + else + continue + fi + done +} \ No newline at end of file