Changeset 71642ef


Ignore:
Timestamp:
10/01/2005 12:21:30 PM (19 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
0.2, 1.0, 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
d310939
Parents:
3eb60fa
Message:

Trying to manage the retaining of Binutils pass1 and TCL sources, the run of the Adjusting phase, and the set of TCLPATH envar for Expect issues.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • dump-commands.xsl

    r3eb60fa r71642ef  
    4545      <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
    4646        <xsl:text>#!/bin/sh&#xA;&#xA;</xsl:text>
    47         <xsl:if test="sect2[@role='installation'] and
     47        <xsl:if test="(sect2[@role='installation'] or
     48            @id='ch-tools-adjusting') and
    4849            ancestor::chapter[@id='chapter-temporary-tools']">
    4950          <xsl:text>cd $PKGDIR &amp;&amp;&#xA;</xsl:text>
  • jhalfs

    r3eb60fa r71642ef  
    275275
    276276  for file in chapter05/* ; do
    277   # Keep the script file name
    278   i=`basename $file`
    279 
    280   # First append each name of the script files to a list (this will become
    281   # the names of the targets in the Makefile
    282   chapter5="$chapter5 $i"
    283 
    284   # Grab the name of the target (minus the -pass1 or -pass2 in the case of gcc
    285   # and binutils in chapter 5)
    286   name=`echo $i | sed -e 's@[0-9]\{3\}-@@' -e 's@-pass[0-9]\{1\}@@'`
    287 
    288   # Drop in the name of the target on a new line, and the
    289   # pevious target as a dependency.
    290   echo -e "\n$i:" >> $MKFILE.tmp
    291 
    292   # Find the version of the command files, if it corresponds with the building of
    293   # a specific package
    294   vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    295 
    296   # If $vrs isn't empty, we've got a package...
    297   if [ "$vrs" != "" ] ; then
    298     if [ "$name" = "tcl" ] ; then
    299       FILE="$name$vrs-src.tar.bz2"
    300     else
    301       FILE="$name-$vrs.tar.bz2"
    302     fi
    303 
    304     # Insert instructions for unpacking the package and to set
    305     # the PKGDIR variable.
    306     echo -e "\t\$(call unpack-lfs,$FILE)" >> $MKFILE.tmp
    307     echo -e "\t-ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
    308     echo -e "\tchown -R lfs \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
    309     echo -e "\techo \"PKGDIR=\$(LFS)\$(SRC)/\$\$ROOT\" > envars && \\" >> $MKFILE.tmp
    310     echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
    311   fi
    312 
    313   # Inser date and disk usage at the top of the log file.
    314   echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >\$(LOGDIR)/$i && \\" >> $MKFILE.tmp
    315 
    316   # Insert the script run
    317   echo -e "\tsu - lfs -c \". /home/lfs/.bashrc && $JHALFSDIR/commands/$file\" >>\$(LOGDIR)/$i 2>&1 && \\" >> $MKFILE.tmp
    318 
    319   # Inser date and disk usage at the bottom of the log file.
    320   echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >>\$(LOGDIR)/$i && \\" >> $MKFILE.tmp
    321 
    322   # Include a touch of the target name so make can check
    323   # if it's already been made.
    324   echo -e "\ttouch \$@" >> $MKFILE.tmp
    325 
    326   # Remove the build directory(ies) even if the package build fails.
    327   if [ "$vrs" != "" ] ; then
    328     echo -e "\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
    329     echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
    330     echo -e "\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp
    331     echo -e "\t\trm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp
     277    # Keep the script file name
     278    i=`basename $file`
     279
     280    # First append each name of the script files to a list (this will become
     281    # the names of the targets in the Makefile
     282    chapter5="$chapter5 $i"
     283
     284    # Grab the name of the target (minus the -pass1 or -pass2 in the case of gcc
     285    # and binutils in chapter 5)
     286    name=`echo $i | sed -e 's@[0-9]\{3\}-@@' -e 's@-pass[0-9]\{1\}@@'`
     287
     288    # Drop in the name of the target on a new line.
     289    echo -e "\n$i:" >> $MKFILE.tmp
     290
     291    # Find the version of the command files, if it corresponds with the building of
     292    # a specific package
     293    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
     294
     295    # If $vrs isn't empty, we've got a package...
     296    if [ "$vrs" != "" ] ; then
     297      if [ "$name" = "tcl" ] ; then
     298        FILE="$name$vrs-src.tar.bz2"
     299      else
     300        FILE="$name-$vrs.tar.bz2"
     301      fi
     302
     303      # Insert instructions for unpacking the package and to set
     304      # the PKGDIR variable.
     305      echo -e "\t\$(call unpack-lfs,$FILE)" >> $MKFILE.tmp
     306      echo -e "\t-ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
     307      echo -e "\tchown -R lfs \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
     308      echo -e "\techo \"PKGDIR=\$(LFS)\$(SRC)/\$\$ROOT\" > envars && \\" >> $MKFILE.tmp
     309      echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
     310    fi
     311
     312    # Dump the path to the Binutils and TCL sources
     313    if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then
     314      echo -e "\techo \"\$(LFS)\$(SRC)/\$\$ROOT\" > sources-dir && \\" >> $MKFILE.tmp
     315    fi
     316
     317    # Inser date and disk usage at the top of the log file.
     318    echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >\$(LOGDIR)/$i && \\" >> $MKFILE.tmp
     319
     320    # For the Adjusting phase we must to cd to the binutils-build directory.
     321    if [ "$i" = "031-adjusting" ] ; then
     322      echo -e "\techo \"PKGDIR=\`cat sources-dir\`\" > envars && \\" >> $MKFILE.tmp
     323      echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
     324    fi
     325
     326    # For the Exp0ect build we need to set the TCLPATH envar.
     327    if [ "$i" = "033-expect" ] ; then
     328      echo -e "\techo \"TCLPATH=\`cat sources-dir\`\" >> envars && \\" >> $MKFILE.tmp
     329      echo -e "\techo \"export TCLPATH\" >> envars && \\" >> $MKFILE.tmp
     330    fi
     331
     332    # Insert the script run
     333    echo -e "\tsu - lfs -c \". /home/lfs/.bashrc && $JHALFSDIR/commands/$file\" >>\$(LOGDIR)/$i 2>&1 && \\" >> $MKFILE.tmp
     334
     335    # Inser date and disk usage at the bottom of the log file.
     336    echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >>\$(LOGDIR)/$i && \\" >> $MKFILE.tmp
     337
     338    # Include a touch of the target name so make can check
     339    # if it's already been made.
     340    echo -e "\ttouch \$@" >> $MKFILE.tmp
     341
     342    # Remove the build directory(ies) even if the package build fails, except for
     343    # Binutils pass1 and TCL. In that cases the sources directories are removed
     344    # only if the build fails.
     345    if [ "$vrs" != "" ] ; then
     346      if [ "$i" != "027-binutils-pass1" ] && [ "$i" != "032-tcl" ] ; then
     347        echo -e "\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
     348        echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
     349        echo -e "\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp
     350        echo -e "\t\trm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp
     351        echo -e "\tfi;" >> $MKFILE.tmp
     352      fi
     353    fi
     354    if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then
     355      echo -e "\tif [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp
     356      echo -e "\t\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
     357      echo -e "\t\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
     358      echo -e "\t\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp
     359      echo -e "\t\t\trm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp
     360      echo -e "\t\tfi;" >> $MKFILE.tmp
     361      echo -e "\tfi;" >> $MKFILE.tmp
     362    fi
     363
     364    # Remove the Binutils sources after a sucessfull adjusting phase.
     365    if [ "$i" = "031-adjusting" ] ; then
     366      echo -e "\tif [ -e \$@ ] ; then \\" >> $MKFILE.tmp
     367      echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp
     368      echo -e "\t\trm -r \$(LFS)\$(SRC)/binutils-build; && \\" >> $MKFILE.tmp
     369      echo -e "\t\trm sources-dir && \\" >> $MKFILE.tmp
     370      echo -e "\tfi;" >> $MKFILE.tmp
     371    fi
     372
     373    # Remove the TCL sources after a sucessfull Expect build.
     374    if [ "$i" = "033-expect" ] ; then
     375      echo -e "\tif [ -e \$@ ] ; then \\" >> $MKFILE.tmp
     376      echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp
     377      echo -e "\t\trm sources-dir && \\" >> $MKFILE.tmp
     378      echo -e "\tfi;" >> $MKFILE.tmp
     379    fi
     380
     381    # Check if the package has been sucessfully build.
     382    echo -e "\tif [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp
     383    echo -e "\t\techo \"The build of \$@ has failed\" && exit 1; \\" >> $MKFILE.tmp
    332384    echo -e "\tfi;" >> $MKFILE.tmp
    333   fi
    334 
    335   # Check if the package has been sucessfully build.
    336   echo -e "\tif [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp
    337   echo -e "\t\techo \"The build of \$@ has failed\" && exit 1; \\" >> $MKFILE.tmp
    338   echo -e "\tfi;" >> $MKFILE.tmp
    339 
    340   # Keep the script file name in a second variable for Makefile dependencies.
    341   PREV=$i
    342 
    343385  done
    344386
     
    411453  echo -e "\ttouch \$@" >> $MKFILE
    412454
    413 
    414455  # Bring over the items from the Makefile.tmp
    415456  cat $MKFILE.tmp >> $MKFILE
     
    443484get_book
    444485build_Makefile
    445 #run_make
     486run_make
Note: See TracChangeset for help on using the changeset viewer.