On 7/12/2019 5:53 PM, DJ Lucas via lfs-dev wrote:

I did have a patch for jhalfs that was relatively simple for Thomas's build, but it's went away with last cleanup, but was not difficult. I think all I had to do was to expand the glibc-* target
I had to add -32 to the sed for the package titles to extract the package name.
so that the multiple builds were possible, but with the multiple copies of the book, amd64+i686/x32, it has to be expanded again to cope. I'll take a stab at adding it back this weekend if somebody else hasn't already.

The additional options aren't so easy as I would have had to modify lfs.xsl extensively to account for all of the arch= parts. Ultimately, I changed the method used to extract commands to a profiled two pass of xsltproc (as is already done with the books themselves). I'm going to suggest this to Pierre when he gets back as it'll ultimately simply lfs.xsl, removing 20 unneeded lines, 6 of which are an entire xsl:select on sect1). I did not do this for the chapter03.xml (for the tarballs) in LFS, just left a FIXME in there temporarily. Also, I do not know if it is possible to test for a specific value of BRANCH="branch-multilib" to further limit the unneeded options (I can't really do anything about WORKING_COPY -- the option needs to be there as we have no idea what is going on with a local copy).

Anyway, see attached.

--DJ

Index: Config.in
===================================================================
--- Config.in   (revision 4110)
+++ Config.in   (working copy)
@@ -11,7 +11,7 @@
         config    BOOK_LFS
             bool "Linux From Scratch System V"
             help
-                Set up the tools to build LFS with Sys V init.
+                Set up the tools to build LFS with SysV init.
 
         config    BOOK_LFS_SYSD
             bool "Linux From Scratch systemd"
@@ -45,9 +45,9 @@
     prompt "Init system"
 
         config BLFS_SYSV
-        bool "BLFS Sys V"
+        bool "BLFS SysV"
         help
-            Extract the Sys V flavour of the BLFS book
+            Extract the SysV flavour of the BLFS book
 
         config BLFS_SYSD
         bool "BLFS systemd"
@@ -61,6 +61,13 @@
         default "sysv"         if BOOK_LFS || BLFS_SYSV
         default "systemd"      if BOOK_LFS_SYSD || BLFS_SYSD
 
+    config    MULTILIB
+        string
+        default "default"      if LFS_MULTILIB_NO
+        default "ml_32"        if LFS_MULTILIB_I686
+        default "ml_x32"       if LFS_MULTILIB_X32
+        default "ml_all"       if LFS_MULTILIB_ALL
+
     config    PROGNAME
         string
         default "lfs"          if BOOK_LFS || BOOK_LFS_SYSD
@@ -122,6 +129,39 @@
         help
             The full path to a local copy of the book XML sources
 
+    choice
+    depends on BOOK_LFS || BOOK_LFS_SYSD && BRANCH || WORKING_COPY
+    prompt "Mutilib"
+        config LFS_MULTILIB_NO
+        bool "Standard LFS on i686 or amd64"
+        help
+            Ues standard LFS book (choose this if not multilib source)
+
+        config LFS_MULTILIB_I686
+        bool "Multilib LFS on amd64 with i686 libraries"
+        help
+            Use Multilib LFS book with i686 libraries
+
+        config LFS_MULTILIB_X32
+        bool "Multilib LFS on amd64 with x32 libraries"
+        help
+            Use Multilib LFS book with x32 libraries
+
+        config LFS_MULTILIB_ALL
+        bool "Multilib LFS on amd64 with i686 and x32 libraries"
+        help
+            Use Multilib LFS book with i686 and x32 libraries
+
+    endchoice
+
+    config    MULTILIB
+        depends on LFS_MULTILIB_I686 || LFS_MULTILIB_X32 || LFS_MULTILIB_ALL
+        string
+        default "default"      if LFS_MULTILIB_NO
+        default "ml_32"        if LFS_MULTILIB_I686
+        default "ml_x32"       if LFS_MULTILIB_X32
+        default "ml_all"       if LFS_MULTILIB_ALL
+
     #--- End BOOK version
 
     #--- CLFS specific params
Index: LFS/master.sh
===================================================================
--- LFS/master.sh       (revision 4110)
+++ LFS/master.sh       (working copy)
@@ -103,10 +103,11 @@
     esac
 
     # Grab the name of the target (minus the -pass1 or -pass2 in the case of 
gcc
-    # and binutils in chapter 5)
+    # and binutils in chapter 5, and -32 for multilib glibc)
     name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@' \
                                     -e 's@-pass[0-9]\{1\}@@' \
-                                    -e 's@-libstdc++@@'`
+                                    -e 's@-libstdc++@@' \
+                                    -e 's@-32@@'`
 
     # Set the dependency for the first target.
     if [ -z $PREV ] ; then PREV=022-settingenvironment ; fi
Index: common/libs/func_book_parser
===================================================================
--- common/libs/func_book_parser        (revision 4110)
+++ common/libs/func_book_parser        (working copy)
@@ -164,9 +164,26 @@
         fi
         popd > /dev/null
 
+        # Test for both so that it works for both multilib and regular books
+        if [ "x$MULTILIB" == "x" -o "x$MULTILB" == "default"]; then
+          xsltproc --nonet                                    \
+                   --xinclude                                 \
+                   --stringparam profile.revision "$INITSYS"  \
+                   --output $BOOK/pbook.xml                   \
+                   $BOOK/stylesheets/lfs-xsl/profile.xsl      \
+                   $BOOK/index.xml >> $LOGDIR/$LOG 2>&1
+        else
+          xsltproc --nonet                                    \
+                   --xinclude                                 \
+                   --stringparam profile.revision "$INITSYS"  \
+                   --stringparam profile.arch     "$MULTILIB" \
+                   --output $BOOK/pbook.xml                   \
+                   $BOOK/stylesheets/lfs-xsl/profile.xsl      \
+                   $BOOK/index.xml >> $LOGDIR/$LOG 2>&1
+        fi
+
         xsltproc --nonet                                      \
                  --xinclude                                   \
-                 --stringparam revision       "$INITSYS"      \
                  --stringparam testsuite      "$TEST"         \
                  --stringparam bomb-testsuite "$BOMB_TEST"    \
                  --stringparam vim-lang       "$VIMLANG"      \
@@ -196,7 +213,7 @@
                  --stringparam script-root    "$SCRIPT_ROOT"  \
                  --output ./${PROGNAME}-commands/             \
                  $XSL                                         \
-                 $BOOK/index.xml >> $LOGDIR/$LOG 2>&1
+                 $BOOK/pbook.xml >> $LOGDIR/$LOG 2>&1
 # Remove flags requesting user action in some cases. Much easier here than
 # in the stylesheet...
         sed -i 's/-iv /-v /' ./${PROGNAME}-commands/chapter08/*kernel*
@@ -247,6 +264,8 @@
                  $BOOK/chapter04/chapter04.xml >>$LOGDIR/$LOG 2>&1
       ;;
     lfs)
+        ## FIXME - Use profling here instead of one pass to cleanup lfs.xsl
+        ##         and remove all then unneeded revision cases
         xsltproc --nonet --xinclude                \
                  --stringparam pkgmngt "$PKGMNGT"  \
                  --stringparam revision "$INITSYS" \
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to