2006-05-06 12:35:19 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
|
|
|
|
set +e
|
|
|
|
|
|
|
|
|
2006-05-06 17:52:27 +02:00
|
|
|
#----------------------------------#
|
|
|
|
validate_opt_settings() { # Show optimize setting and wait user agreement
|
|
|
|
#----------------------------------#
|
|
|
|
local OPT_VAR optVal
|
|
|
|
|
|
|
|
echo -e "MAKEFLAGS: ${L_arrow}${BOLD}${MAKEFLAGS}${OFF}${R_arrow}\n"
|
|
|
|
echo -e "DEF_OPT_LVL: ${L_arrow}${BOLD}${DEF_OPT_LVL}${OFF}${R_arrow}\n"
|
|
|
|
|
|
|
|
for OPT_VAR in $ACTIVE_OPT_VARS ; do
|
|
|
|
eval optVal=\$${OPT_VAR}_${DEF_OPT_LVL}
|
|
|
|
echo -e "${OPT_VAR}: ${L_arrow}${BOLD}${optVal}${OFF}${R_arrow}"
|
|
|
|
done
|
|
|
|
|
|
|
|
echo -e "\nOverrided packages:"
|
|
|
|
cat optimize/opt_override
|
|
|
|
echo "${nl_}${SD_BORDER}${nl_}"
|
|
|
|
|
|
|
|
echo -n "Are you happy with these optimization settings? yes/no (no): "
|
|
|
|
read ANSWER
|
|
|
|
if [ x$ANSWER != "xyes" ] ; then
|
|
|
|
echo "${nl_}Fix the optimization options and rerun the script.${nl_}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "${nl_}${SD_BORDER}${nl_}"
|
|
|
|
}
|
|
|
|
|
2006-05-06 12:35:19 +02:00
|
|
|
#----------------------------------#
|
|
|
|
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
|
2006-05-06 13:06:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#----------------------------------#
|
|
|
|
wrt_makeflags() { # Apply MAKEFLAGS to build
|
|
|
|
#----------------------------------#
|
|
|
|
if [[ "$MAKEFLAGS" != "unset" ]]; then
|
|
|
|
(
|
|
|
|
cat << EOF
|
|
|
|
@echo "export MAKEFLAGS=\"$MAKEFLAGS\"" >> envars
|
|
|
|
EOF
|
|
|
|
) >> $MKFILE.tmp
|
|
|
|
else
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
}
|