r2667 - in jhalfs/branches/experimental: CLFS HLFS LFS optimize optimize/opt_config.d

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Mon May 8 11:11:01 PDT 2006


Author: manuel
Date: 2006-05-08 12:10:58 -0600 (Mon, 08 May 2006)
New Revision: 2667

Added:
   jhalfs/branches/experimental/optimize/opt_config.d/O3pipe
   jhalfs/branches/experimental/optimize/opt_config.d/O3pipe_march
   jhalfs/branches/experimental/optimize/opt_config.d/defOpt_fPIC
Removed:
   jhalfs/branches/experimental/optimize/opt_config.d/Zlib
   jhalfs/branches/experimental/optimize/opt_config.d/defOpt
   jhalfs/branches/experimental/optimize/opt_config.d/defOpt_march
Modified:
   jhalfs/branches/experimental/CLFS/master.sh
   jhalfs/branches/experimental/HLFS/master.sh
   jhalfs/branches/experimental/LFS/master.sh
   jhalfs/branches/experimental/optimize/opt_config
   jhalfs/branches/experimental/optimize/opt_config.d/noOpt
   jhalfs/branches/experimental/optimize/opt_config.d/noSymbols
   jhalfs/branches/experimental/optimize/opt_override
   jhalfs/branches/experimental/optimize/optimize_functions
Log:
Applied optimization and makeflags patches from Jeremy Byron.
Renamed some files.

Modified: jhalfs/branches/experimental/CLFS/master.sh
===================================================================
--- jhalfs/branches/experimental/CLFS/master.sh	2006-05-07 16:03:08 UTC (rev 2666)
+++ jhalfs/branches/experimental/CLFS/master.sh	2006-05-08 18:10:58 UTC (rev 2667)
@@ -184,7 +184,7 @@
     # Insert instructions for unpacking the package and to set the PKGDIR variable.
     #
     [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
-    [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags
+    [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
     wrt_run_as_su "${this_script}" "${file}"
     #
@@ -256,7 +256,7 @@
     # Insert instructions for unpacking the package and changing directories
     #
     [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
-    [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags
+    [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
     # Select a script execution method
     case $this_script in
@@ -327,7 +327,7 @@
         *util-linux)    wrt_unpack  "$name-$vrs.tar.*"  ;;
         *)              wrt_unpack2 "$name-$vrs.tar.*"  ;;
       esac
-      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags
+      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
     #
     # Select a script execution method
@@ -388,7 +388,7 @@
       tcl)    wrt_unpack2 "$name$vrs-src.tar.*" ;;
       *)      wrt_unpack2 "$name-$vrs.tar.*"    ;;
     esac
-    [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags
+    [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
     wrt_run_as_chroot1 "${this_script}" "${file}"
     #
@@ -443,7 +443,7 @@
       tcl)    wrt_unpack3 "$name$vrs-src.tar.*" ;;
       *)      wrt_unpack3 "$name-$vrs.tar.*"    ;;
     esac
-    [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags
+    [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
     wrt_run_as_root2 "${this_script}" "${file}"
     #
@@ -542,7 +542,7 @@
     if [ "$vrs" != "" ] ; then
       FILE="$name-$vrs.tar.*"
       wrt_unpack2 "$FILE"
-      [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags
+      [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
     #
     wrt_run_as_chroot1 "${this_script}" "${file}"
@@ -645,7 +645,7 @@
     if [ "$vrs" != "" ] ; then
       FILE="$name-$vrs.tar.*"
       wrt_unpack3 "$FILE"
-      [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags
+      [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
     #
     wrt_run_as_root2 "${this_script}" "${file}"

Modified: jhalfs/branches/experimental/HLFS/master.sh
===================================================================
--- jhalfs/branches/experimental/HLFS/master.sh	2006-05-07 16:03:08 UTC (rev 2666)
+++ jhalfs/branches/experimental/HLFS/master.sh	2006-05-08 18:10:58 UTC (rev 2667)
@@ -142,7 +142,7 @@
       esac
       # Insert instructions for unpacking the package and to set the PKGDIR variable.
       wrt_unpack "$FILE"
-      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags
+      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
 
     case $this_script in
@@ -309,7 +309,7 @@
       esac
       wrt_unpack2 "$FILE"
       wrt_target_vars
-      [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags
+      [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
 
     case $this_script in

Modified: jhalfs/branches/experimental/LFS/master.sh
===================================================================
--- jhalfs/branches/experimental/LFS/master.sh	2006-05-07 16:03:08 UTC (rev 2666)
+++ jhalfs/branches/experimental/LFS/master.sh	2006-05-08 18:10:58 UTC (rev 2667)
@@ -112,7 +112,7 @@
 
       # Insert instructions for unpacking the package and to set the PKGDIR variable.
       wrt_unpack "$FILE"
-      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags
+      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
 
     # Insert date and disk usage at the top of the log file, the script run
@@ -216,7 +216,7 @@
     if [ "$vrs" != "" ] ; then
       FILE="$name-$vrs.tar.*"
       wrt_unpack2 "$FILE"
-      [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags
+      [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
 
     # In the mount of kernel filesystems we need to set LFS

Modified: jhalfs/branches/experimental/optimize/opt_config
===================================================================
--- jhalfs/branches/experimental/optimize/opt_config	2006-05-07 16:03:08 UTC (rev 2666)
+++ jhalfs/branches/experimental/optimize/opt_config	2006-05-08 18:10:58 UTC (rev 2667)
@@ -13,11 +13,11 @@
 MAKEFLAGS="-j3"
 
 #--- Default optimization mode
-#    This level is overridden by definitions in opt_override;
+#    This mode is overridden by definitions in opt_override;
 #    in this way, packages can be tuned independently.  For example,
 #    if you have trouble building a package in mode defOpt, add
 #    the package to opt_override with a different mode.
-DEF_OPT_LVL=defOpt
+DEF_OPT_MODE=O3pipe
 
 
 #--- Active optimization variables
@@ -28,11 +28,12 @@
 
 #--- Load optimization modes
 #    To add modes, create a working template..
-#      cp opt_config.d/defOpt opt_config.d/newMode
+#      cp opt_config.d/O3pipe opt_config.d/newMode
 #    ..and edit it as desired.
 #
-#    To inherit another mode and add to it, see opt_config.d/defOpt_march
-#    as an example.  Given opt_config.d/modeA_modeB_modeC, modeB inherits
+#    To inherit another mode and add to it, see opt_config.d/O3pipe_march
+#    or opt_config.d/defOpt_fPIC as examples for two different ways of
+#    doing it.  Given opt_config.d/modeA_modeB_modeC, modeB inherits
 #    the optimizations of modeA by sourcing it, and modeC inherits those
 #    of modeB (which includes those of modeA).
 #

Copied: jhalfs/branches/experimental/optimize/opt_config.d/O3pipe (from rev 2666, jhalfs/branches/experimental/optimize/opt_config.d/defOpt)
===================================================================
--- jhalfs/branches/experimental/optimize/opt_config.d/O3pipe	                        (rev 0)
+++ jhalfs/branches/experimental/optimize/opt_config.d/O3pipe	2006-05-08 18:10:58 UTC (rev 2667)
@@ -0,0 +1,20 @@
+#
+#$Id$
+#
+#####
+#
+# MODE O3pipe configuration
+#
+# Usage: - Apply optimization string to each variable
+#        - "unset" will cause the variable to be not set
+#          instead of just set to null.
+#
+#####
+
+CFLAGS_O3pipe="-O3 -pipe"
+CXXFLAGS_O3pipe=$CFLAGS_O3pipe
+LDFLAGS_O3pipe="unset"
+
+OTHER_CFLAGS_O3pipe=$CFLAGS_O3pipe
+OTHER_CXXFLAGS_O3pipe=$CXXFLAGS_O3pipe
+OTHER_LDFLAGS_O3pipe=$LDFLAGS_O3pipe

Copied: jhalfs/branches/experimental/optimize/opt_config.d/O3pipe_march (from rev 2666, jhalfs/branches/experimental/optimize/opt_config.d/defOpt_march)
===================================================================
--- jhalfs/branches/experimental/optimize/opt_config.d/O3pipe_march	                        (rev 0)
+++ jhalfs/branches/experimental/optimize/opt_config.d/O3pipe_march	2006-05-08 18:10:58 UTC (rev 2667)
@@ -0,0 +1,23 @@
+#
+#$Id$
+#
+#####
+#
+# MODE O3pipe_march configuration
+#
+# Usage: - Apply optimization string to each variable
+#        - "unset" will cause the variable to be not set
+#          instead of just set to null.
+#
+#####
+
+# Inherit optimizations from O3pipe
+source optimize/opt_config.d/O3pipe
+
+CFLAGS_O3pipe_march=$CFLAGS_O3pipe" -march=pentium4"
+CXXFLAGS_O3pipe_march=$CFLAGS_O3pipe"  -march=pentium4"
+LDFLAGS_O3pipe_march=$LDFLAGS_O3pipe
+
+OTHER_CFLAGS_O3pipe_march=$CFLAGS_O3pipe" -march=pentium4"
+OTHER_CXXFLAGS_O3pipe_march=$CXXFLAGS_O3pipe" -march=pentium4"
+OTHER_LDFLAGS_O3pipe_march=$LDFLAGS_O3pipe

Deleted: jhalfs/branches/experimental/optimize/opt_config.d/Zlib
===================================================================
--- jhalfs/branches/experimental/optimize/opt_config.d/Zlib	2006-05-07 16:03:08 UTC (rev 2666)
+++ jhalfs/branches/experimental/optimize/opt_config.d/Zlib	2006-05-08 18:10:58 UTC (rev 2667)
@@ -1,56 +0,0 @@
-#
-#$Id$
-#
-#####
-#
-# MODE Zlib configuration
-#
-# Usage: - Apply optimization string to each variable
-#        - "unset" will cause the variable to be not set
-#          instead of just set to null.
-#
-#####
-
-# Inherit optimizations from DEF_OPT_LVL
-source optimize/opt_config.d/$DEF_OPT_LVL
-
-eval CFLAGS_Zlib_base=\$CFLAGS_${DEF_OPT_LVL}
-eval CXXFLAGS_Zlib_base=\$CXXFLAGS_${DEF_OPT_LVL}
-eval LDFLAGS_Zlib_base=\$LDFLAGS_${DEF_OPT_LVL}
-
-eval OTHER_CFLAGS_Zlib_base=\$CFLAGS_${DEF_OPT_LVL}
-eval OTHER_CXXFLAGS_Zlib_base=\$OTHER_CXXFLAGS_${DEF_OPT_LVL}
-eval OTHER_LDFLAGS_Zlib_base=\$OTHER_LDFLAGS_${DEF_OPT_LVL}
-
-# Set the actual values for Zlib mode
-if [[ "$CFLAGS_Zlib_base" != "unset" ]]; then
-  CFLAGS_Zlib=$CFLAGS_Zlib_base" -fPIC"
-else
-  CFLAGS_Zlib="unset"
-fi
-if [[ "$CXXFLAGS_Zlib_base" != "unset" ]]; then
-  CXXFLAGS_Zlib=$CXXFLAGS_Zlib_base" -fPIC"
-else
-  CXXFLAGS_Zlib="unset"
-fi
-if [[ "$LDFLAGS_Zlib_base" != "unset" ]]; then
-  LDFLAGS_Zlib=$LDFLAGS_Zlib_base
-else
-  LDFLAGS_Zlib="unset"
-fi
-
-if [[ "$OTHER_CFLAGS_Zlib_base" != "unset" ]]; then
-  OTHER_CFLAGS_Zlib=$OTHER_CFLAGS_Zlib_base" -fPIC"
-else
-  OTHER_CFLAGS_Zlib="unset"
-fi
-if [[ "$OTHER_CXXFLAGS_Zlib_base" != "unset" ]]; then
-  OTHER_CXXFLAGS_Zlib=$OTHER_CXXFLAGS_Zlib_base" -fPIC"
-else
-  OTHER_CXXFLAGS_Zlib="unset"
-fi
-if [[ "$OTHER_LDFLAGS_Zlib_base" != "unset" ]]; then
-  OTHER_LDFLAGS_Zlib=$OTHER_LDFLAGS_Zlib_base
-else
-  OTHER_LDFLAGS_Zlib="unset"
-fi

Deleted: jhalfs/branches/experimental/optimize/opt_config.d/defOpt
===================================================================
--- jhalfs/branches/experimental/optimize/opt_config.d/defOpt	2006-05-07 16:03:08 UTC (rev 2666)
+++ jhalfs/branches/experimental/optimize/opt_config.d/defOpt	2006-05-08 18:10:58 UTC (rev 2667)
@@ -1,20 +0,0 @@
-#
-#$Id$
-#
-#####
-#
-# MODE defOpt configuration
-#
-# Usage: - Apply optimization string to each variable
-#        - "unset" will cause the variable to be not set
-#          instead of just set to null.
-#
-#####
-
-CFLAGS_defOpt="-O3 -pipe"
-CXXFLAGS_defOpt=$CFLAGS_defOpt
-LDFLAGS_defOpt="unset"
-
-OTHER_CFLAGS_defOpt=$CFLAGS_defOpt
-OTHER_CXXFLAGS_defOpt=$CXXFLAGS_defOpt
-OTHER_LDFLAGS_defOpt=$LDFLAGS_defOpt

Added: jhalfs/branches/experimental/optimize/opt_config.d/defOpt_fPIC
===================================================================
--- jhalfs/branches/experimental/optimize/opt_config.d/defOpt_fPIC	                        (rev 0)
+++ jhalfs/branches/experimental/optimize/opt_config.d/defOpt_fPIC	2006-05-08 18:10:58 UTC (rev 2667)
@@ -0,0 +1,28 @@
+#####
+#
+# MODE defOpt_fPIC configuration
+#
+# Usage: - Apply optimization string to each variable
+#        - "unset" will cause the variable to be not set
+#          instead of just set to null.
+#
+#####
+
+# Inherit optimizations from DEF_OPT_MODE
+source optimize/opt_config.d/${DEF_OPT_MODE}
+
+# Append " -fPIC" to default *C{,XX}FLAGS and retain other defaults
+for OPT_VAR in $ACTIVE_OPT_VARS ; do
+  case $OPT_VAR in
+    CFLAGS | CXXFLAGS | OTHER_CFLAGS | OTHER_CXXFLAGS)
+      if [[ "$(eval "echo \$${OPT_VAR}_${DEF_OPT_MODE}")" != "unset" ]] ; then
+        eval ${OPT_VAR}_defOpt_fPIC=\$${OPT_VAR}_${DEF_OPT_MODE}\" -fPIC\"
+      else
+        eval ${OPT_VAR}_defOpt_fPIC="unset"
+      fi
+      ;;
+    *)
+      eval ${OPT_VAR}_defOpt_fPIC=\$${OPT_VAR}_${DEF_OPT_MODE}
+      ;;
+  esac
+done


Property changes on: jhalfs/branches/experimental/optimize/opt_config.d/defOpt_fPIC
___________________________________________________________________
Name: svn:keywords
   + Author Date Revision Id

Deleted: jhalfs/branches/experimental/optimize/opt_config.d/defOpt_march
===================================================================
--- jhalfs/branches/experimental/optimize/opt_config.d/defOpt_march	2006-05-07 16:03:08 UTC (rev 2666)
+++ jhalfs/branches/experimental/optimize/opt_config.d/defOpt_march	2006-05-08 18:10:58 UTC (rev 2667)
@@ -1,23 +0,0 @@
-#
-#$Id$
-#
-#####
-#
-# MODE defOpt_march configuration
-#
-# Usage: - Apply optimization string to each variable
-#        - "unset" will cause the variable to be not set
-#          instead of just set to null.
-#
-#####
-
-# Inherit optimizations from defOpt
-source optimize/opt_config.d/defOpt
-
-CFLAGS_defOpt_march=$CFLAGS_defOpt" -march=pentium4"
-CXXFLAGS_defOpt_march=$CFLAGS_defOpt"  -march=pentium4"
-LDFLAGS_defOpt_march=$LDFLAGS_defOpt
-
-OTHER_CFLAGS_defOpt_march=$CFLAGS_defOpt" -march=pentium4"
-OTHER_CXXFLAGS_defOpt_march=$CXXFLAGS_defOpt" -march=pentium4"
-OTHER_LDFLAGS_defOpt_march=$LDFLAGS_defOpt

Modified: jhalfs/branches/experimental/optimize/opt_config.d/noOpt
===================================================================
--- jhalfs/branches/experimental/optimize/opt_config.d/noOpt	2006-05-07 16:03:08 UTC (rev 2666)
+++ jhalfs/branches/experimental/optimize/opt_config.d/noOpt	2006-05-08 18:10:58 UTC (rev 2667)
@@ -10,7 +10,7 @@
 #          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
+#          optimizations, set this mode in DEF_OPT_MODE
 #
 # Usage: - Apply optimization string to each variable
 #        - "unset" will cause the variable to be not set

Modified: jhalfs/branches/experimental/optimize/opt_config.d/noSymbols
===================================================================
--- jhalfs/branches/experimental/optimize/opt_config.d/noSymbols	2006-05-07 16:03:08 UTC (rev 2666)
+++ jhalfs/branches/experimental/optimize/opt_config.d/noSymbols	2006-05-08 18:10:58 UTC (rev 2667)
@@ -11,8 +11,8 @@
 #
 #####
 #
-# NOTE: If using this mode in DEF_OPT_LVL (alone or combined with
-# other mode) please set STRIP=0 in common/config
+# NOTE: If using this mode in DEF_OPT_MODE (alone or combined with
+# other modes) please set STRIP=0 in common/config
 #
 CFLAGS_noSymbols="-s"
 CXXFLAGS_noSymbols=$CFLAGS_noSymbols

Modified: jhalfs/branches/experimental/optimize/opt_override
===================================================================
--- jhalfs/branches/experimental/optimize/opt_override	2006-05-07 16:03:08 UTC (rev 2666)
+++ jhalfs/branches/experimental/optimize/opt_override	2006-05-08 18:10:58 UTC (rev 2667)
@@ -2,4 +2,4 @@
 gcc            noOpt
 glibc          noOpt
 grub           noOpt
-zlib           Zlib
+zlib           defOpt_fPIC

Modified: jhalfs/branches/experimental/optimize/optimize_functions
===================================================================
--- jhalfs/branches/experimental/optimize/optimize_functions	2006-05-07 16:03:08 UTC (rev 2666)
+++ jhalfs/branches/experimental/optimize/optimize_functions	2006-05-08 18:10:58 UTC (rev 2667)
@@ -11,14 +11,14 @@
   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"
+  echo -e "DEF_OPT_MODE: ${L_arrow}${BOLD}${DEF_OPT_MODE}${OFF}${R_arrow}\n"
 
   for OPT_VAR in $ACTIVE_OPT_VARS ; do
-    eval optVal=\$${OPT_VAR}_${DEF_OPT_LVL}
+    eval optVal=\$${OPT_VAR}_${DEF_OPT_MODE}
     echo -e "${OPT_VAR}: ${L_arrow}${BOLD}${optVal}${OFF}${R_arrow}"
   done
 
-  echo -e "\nOverrided packages:"
+  echo -e "\nOverridden packages:"
   cat optimize/opt_override
   echo "${nl_}${SD_BORDER}${nl_}"
 
@@ -35,15 +35,15 @@
 wrt_optimize() {                   # Apply pkg specific opt's to build
 #----------------------------------#
   local pkg=$1
-  local optLvl optVal OPT_VAR
+  local optMode optVal OPT_VAR
 
-  optLvl=`awk -v pkg="$pkg" '$1 == pkg { print $2 }' $JHALFSDIR/opt_override`
-  if [[ "$optLvl" = "" ]] ; then
-    optLvl=$DEF_OPT_LVL;
+  optMode=`awk -v pkg="$pkg" '$1 == pkg { print $2 }' $JHALFSDIR/opt_override`
+  if [[ "$optMode" = "" ]] ; then
+    optMode=$DEF_OPT_MODE;
   fi
 
   for OPT_VAR in $ACTIVE_OPT_VARS ; do
-    eval optVal=\$${OPT_VAR}_$optLvl
+    eval optVal=\$${OPT_VAR}_$optMode
 
     if [[ "$optVal" != "unset" ]]; then
 (
@@ -60,13 +60,21 @@
 #----------------------------------#
 wrt_makeflags() {                  # Apply MAKEFLAGS to build
 #----------------------------------#
-  if [[ "$MAKEFLAGS" != "unset" ]]; then
+  local pkg=$1
+
+  case $pkg in
+    gettext | groff ) # Don't support -jX for now
+      ;;
+    *)
+      if [[ "$MAKEFLAGS" != "unset" ]]; then
 (
 cat << EOF
 	@echo "export MAKEFLAGS=\"$MAKEFLAGS\"" >> envars
 EOF
 ) >> $MKFILE.tmp
-  else
-    continue
-  fi
+      else
+        continue
+      fi
+      ;;
+  esac
 }




More information about the alfs-log mailing list