CLFS and Optimizations and MAKEFLAGS

William Harrington kb0iic at berzerkula.org
Wed Sep 25 12:35:28 PDT 2013


Greetings,

I was wondering why cross-tools was taking longer than usual and the  
SBU was off.

I noticed that during the building of the Makefile that cross-tools  
isn't included in the optimizations which add the MAKEFLAG variable.

In cross-tools we don't want optimizations, yet, so just the makeflags.

I ran through all of the different combinations of optimize options  
(including what I added) and all seems well.

You can tell at line 120 that is in the cross-tools part of the make  
file creation and I only have it adding the makeflags when OPTIMIZE is  
3 which is OPT_3 from Config.in.

Here is what I have so far:

Index: CLFS/master.sh
===================================================================
--- CLFS/master.sh      (revision 3727)
+++ CLFS/master.sh      (working copy)
@@ -120,6 +120,7 @@
      # If $pkg_tarball isn't empty, we've got a package...
      #
      [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
+    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "3" ]] &&   
wrt_makeflags "$name"
      #
      LUSER_wrt_RunAsUser "${file}"
      #
@@ -178,7 +179,7 @@
      # Insert instructions for unpacking the package and to set the  
PKGDIR variable.
      #
      [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
-    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&   
wrt_optimize "$name" && wrt_makeflags "$name"
+    [[ "$pkg_tarball" != "" ]] && ( [[ "$OPTIMIZE" = "2" ]] ||  
[[ "$OPTIMIZE" = "3" ]] ) &&  wrt_optimize "$name" && wrt_makeflags  
"$name"
      #
      LUSER_wrt_RunAsUser "${file}"
      #
@@ -231,7 +232,7 @@
        *util-linux)
           LUSER_wrt_target "${this_script}" "$PREV"
           LUSER_wrt_unpack "$pkg_tarball"
-         [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" &&  
wrt_makeflags "$name"
+         ( [[ "$OPTIMIZE" = "2" ]] || [[ "$OPTIMIZE" = "3" ]] ) &&   
wrt_optimize "$name" && wrt_makeflags "$name"
           LUSER_wrt_RunAsUser "${file}"
           LUSER_RemoveBuildDirs "${name}"
           wrt_touch
@@ -240,7 +241,7 @@
        *util-linux-ng)
           LUSER_wrt_target "${this_script}" "$PREV"
           LUSER_wrt_unpack "$pkg_tarball"
-         [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" &&  
wrt_makeflags "$name"
+         ( [[ "$OPTIMIZE" = "2" ]] || [[ "$OPTIMIZE" = "3" ]] ) &&   
wrt_optimize "$name" && wrt_makeflags "$name"
           LUSER_wrt_RunAsUser "${file}"
           LUSER_RemoveBuildDirs "${name}"
           wrt_touch
@@ -249,7 +250,7 @@
        *util-linux-libs)
           LUSER_wrt_target "${this_script}" "$PREV"
           LUSER_wrt_unpack "$pkg_tarball"
-         [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" &&  
wrt_makeflags "$name"
+         ( [[ "$OPTIMIZE" = "2" ]] || [[ "$OPTIMIZE" = "3" ]] ) &&   
wrt_optimize "$name" && wrt_makeflags "$name"
           LUSER_wrt_RunAsUser "${file}"
           LUSER_RemoveBuildDirs "${name}"
           wrt_touch
@@ -258,7 +259,7 @@
        *e2fsprogs)
           LUSER_wrt_target "${this_script}" "$PREV"
           LUSER_wrt_unpack "$pkg_tarball"
-         [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" &&  
wrt_makeflags "$name"
+         ( [[ "$OPTIMIZE" = "2" ]] || [[ "$OPTIMIZE" = "3" ]] ) &&   
wrt_optimize "$name" && wrt_makeflags "$name"
           LUSER_wrt_RunAsUser "${file}"
           LUSER_RemoveBuildDirs "${name}"
           wrt_touch
@@ -267,7 +268,7 @@
        *e2fsprogs-libs)
           LUSER_wrt_target "${this_script}" "$PREV"
           LUSER_wrt_unpack "$pkg_tarball"
-         [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" &&  
wrt_makeflags "$name"
+         ( [[ "$OPTIMIZE" = "2" ]] || [[ "$OPTIMIZE" = "3" ]] ) &&   
wrt_optimize "$name" && wrt_makeflags "$name"
           LUSER_wrt_RunAsUser "${file}"
           LUSER_RemoveBuildDirs "${name}"
           wrt_touch
@@ -289,7 +290,7 @@
      #
      if [ "$pkg_tarball" != "" ] ; then
        CHROOT_Unpack "$pkg_tarball"
-      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" &&  
wrt_makeflags "$name"
+      ( [[ "$OPTIMIZE" = "2" ]] || [[ "$OPTIMIZE" = "3" ]] ) &&   
wrt_optimize "$name" && wrt_makeflags "$name"
      fi
      #
      # Select a script execution method
@@ -448,7 +449,7 @@
      CHROOT_wrt_target "${this_script}" "$PREV"
      #
      CHROOT_Unpack "$pkg_tarball"
-    [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags  
"$name"
+    ( [[ "$OPTIMIZE" = "2" ]] || [[ "$OPTIMIZE" = "3" ]] ) &&   
wrt_optimize "$name" && wrt_makeflags "$name"
      #
      CHROOT_wrt_RunAsRoot "${file}"
      #
Index: Config.in
===================================================================
--- Config.in   (revision 3727)
+++ Config.in   (working copy)
@@ -1086,6 +1086,9 @@

                 config  OPT_2
                         bool    "Both temp tools and final system"
#--- Extra flags passed to the packages make commands
+
+               config  OPT_3
+                       bool    "Cross tools (MAKEFLAGS only), temp  
tools and final system"
         endchoice

         config  OPTIMIZE
@@ -1093,6 +1096,7 @@
                 default "0"     if !CONFIG_OPTIMIZE
                 default "1"     if OPT_1
                 default "2"     if OPT_2
+               default "3"     if OPT_3
  endif
         #--- End Optimizations

Sincerely,

William Harrington



More information about the alfs-discuss mailing list