Added optimize/optimize_functions.
This commit is contained in:
parent
fb6b1c57f5
commit
2c2471d36e
3 changed files with 40 additions and 27 deletions
|
@ -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
|
||||
#----------------------------------#
|
||||
|
|
|
@ -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..."
|
||||
|
|
32
optimize/optimize_functions
Normal file
32
optimize/optimize_functions
Normal file
|
@ -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
|
||||
}
|
Reference in a new issue