source: optimize/optimize_functions@ 8324ee2

experimental
Last change on this file since 8324ee2 was eb0837b, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Clean-up.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1#!/bin/bash
2
3# $Id$
4
5set +e
6
7
8#----------------------------------#
9validate_opt_settings() { # Show optimize setting and wait user agreement
10#----------------------------------#
11 local OPT_VAR optVal
12
13 echo -e "MAKEFLAGS: ${L_arrow}${BOLD}${MAKEFLAGS}${OFF}${R_arrow}\n"
14 echo -e "DEF_OPT_LVL: ${L_arrow}${BOLD}${DEF_OPT_LVL}${OFF}${R_arrow}\n"
15
16 for OPT_VAR in $ACTIVE_OPT_VARS ; do
17 eval optVal=\$${OPT_VAR}_${DEF_OPT_LVL}
18 echo -e "${OPT_VAR}: ${L_arrow}${BOLD}${optVal}${OFF}${R_arrow}"
19 done
20
21 echo -e "\nOverrided packages:"
22 cat optimize/opt_override
23 echo "${nl_}${SD_BORDER}${nl_}"
24
25 echo -n "Are you happy with these optimization settings? yes/no (no): "
26 read ANSWER
27 if [ x$ANSWER != "xyes" ] ; then
28 echo "${nl_}Fix the optimization options and rerun the script.${nl_}"
29 exit 1
30 fi
31 echo "${nl_}${SD_BORDER}${nl_}"
32}
33
34#----------------------------------#
35wrt_optimize() { # Apply pkg specific opt's to build
36#----------------------------------#
37 local pkg=$1
38 local optLvl optVal OPT_VAR
39
40 optLvl=`awk -v pkg="$pkg" '$1 == pkg { print $2 }' $JHALFSDIR/opt_override`
41 if [[ "$optLvl" = "" ]] ; then
42 optLvl=$DEF_OPT_LVL;
43 fi
44
45 for OPT_VAR in $ACTIVE_OPT_VARS ; do
46 eval optVal=\$${OPT_VAR}_$optLvl
47
48 if [[ "$optVal" != "unset" ]]; then
49(
50cat << EOF
51 @echo "export $OPT_VAR=\"$optVal\"" >> envars
52EOF
53) >> $MKFILE.tmp
54 else
55 continue
56 fi
57 done
58}
59
60#----------------------------------#
61wrt_makeflags() { # Apply MAKEFLAGS to build
62#----------------------------------#
63 if [[ "$MAKEFLAGS" != "unset" ]]; then
64(
65cat << EOF
66 @echo "export MAKEFLAGS=\"$MAKEFLAGS\"" >> envars
67EOF
68) >> $MKFILE.tmp
69 else
70 continue
71 fi
72}
Note: See TracBrowser for help on using the repository browser.