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.
This commit is contained in:
parent
3eb60faaa7
commit
71642ef6ea
2 changed files with 98 additions and 56 deletions
|
@ -44,7 +44,8 @@
|
|||
<!-- Creating dirs and files -->
|
||||
<exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
|
||||
<xsl:text>#!/bin/sh

</xsl:text>
|
||||
<xsl:if test="sect2[@role='installation'] and
|
||||
<xsl:if test="(sect2[@role='installation'] or
|
||||
@id='ch-tools-adjusting') and
|
||||
ancestor::chapter[@id='chapter-temporary-tools']">
|
||||
<xsl:text>cd $PKGDIR &&
</xsl:text>
|
||||
</xsl:if>
|
||||
|
|
59
jhalfs
59
jhalfs
|
@ -285,8 +285,7 @@ build_Makefile() {
|
|||
# and binutils in chapter 5)
|
||||
name=`echo $i | sed -e 's@[0-9]\{3\}-@@' -e 's@-pass[0-9]\{1\}@@'`
|
||||
|
||||
# Drop in the name of the target on a new line, and the
|
||||
# pevious target as a dependency.
|
||||
# Drop in the name of the target on a new line.
|
||||
echo -e "\n$i:" >> $MKFILE.tmp
|
||||
|
||||
# Find the version of the command files, if it corresponds with the building of
|
||||
|
@ -310,9 +309,26 @@ build_Makefile() {
|
|||
echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
|
||||
fi
|
||||
|
||||
# Dump the path to the Binutils and TCL sources
|
||||
if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then
|
||||
echo -e "\techo \"\$(LFS)\$(SRC)/\$\$ROOT\" > sources-dir && \\" >> $MKFILE.tmp
|
||||
fi
|
||||
|
||||
# Inser date and disk usage at the top of the log file.
|
||||
echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >\$(LOGDIR)/$i && \\" >> $MKFILE.tmp
|
||||
|
||||
# For the Adjusting phase we must to cd to the binutils-build directory.
|
||||
if [ "$i" = "031-adjusting" ] ; then
|
||||
echo -e "\techo \"PKGDIR=\`cat sources-dir\`\" > envars && \\" >> $MKFILE.tmp
|
||||
echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
|
||||
fi
|
||||
|
||||
# For the Exp0ect build we need to set the TCLPATH envar.
|
||||
if [ "$i" = "033-expect" ] ; then
|
||||
echo -e "\techo \"TCLPATH=\`cat sources-dir\`\" >> envars && \\" >> $MKFILE.tmp
|
||||
echo -e "\techo \"export TCLPATH\" >> envars && \\" >> $MKFILE.tmp
|
||||
fi
|
||||
|
||||
# Insert the script run
|
||||
echo -e "\tsu - lfs -c \". /home/lfs/.bashrc && $JHALFSDIR/commands/$file\" >>\$(LOGDIR)/$i 2>&1 && \\" >> $MKFILE.tmp
|
||||
|
||||
|
@ -323,23 +339,49 @@ build_Makefile() {
|
|||
# if it's already been made.
|
||||
echo -e "\ttouch \$@" >> $MKFILE.tmp
|
||||
|
||||
# Remove the build directory(ies) even if the package build fails.
|
||||
# Remove the build directory(ies) even if the package build fails, except for
|
||||
# Binutils pass1 and TCL. In that cases the sources directories are removed
|
||||
# only if the build fails.
|
||||
if [ "$vrs" != "" ] ; then
|
||||
if [ "$i" != "027-binutils-pass1" ] && [ "$i" != "032-tcl" ] ; then
|
||||
echo -e "\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
|
||||
echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
|
||||
echo -e "\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp
|
||||
echo -e "\t\trm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp
|
||||
echo -e "\tfi;" >> $MKFILE.tmp
|
||||
fi
|
||||
fi
|
||||
if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then
|
||||
echo -e "\tif [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp
|
||||
echo -e "\t\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
|
||||
echo -e "\t\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
|
||||
echo -e "\t\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp
|
||||
echo -e "\t\t\trm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp
|
||||
echo -e "\t\tfi;" >> $MKFILE.tmp
|
||||
echo -e "\tfi;" >> $MKFILE.tmp
|
||||
fi
|
||||
|
||||
# Remove the Binutils sources after a sucessfull adjusting phase.
|
||||
if [ "$i" = "031-adjusting" ] ; then
|
||||
echo -e "\tif [ -e \$@ ] ; then \\" >> $MKFILE.tmp
|
||||
echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp
|
||||
echo -e "\t\trm -r \$(LFS)\$(SRC)/binutils-build; && \\" >> $MKFILE.tmp
|
||||
echo -e "\t\trm sources-dir && \\" >> $MKFILE.tmp
|
||||
echo -e "\tfi;" >> $MKFILE.tmp
|
||||
fi
|
||||
|
||||
# Remove the TCL sources after a sucessfull Expect build.
|
||||
if [ "$i" = "033-expect" ] ; then
|
||||
echo -e "\tif [ -e \$@ ] ; then \\" >> $MKFILE.tmp
|
||||
echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp
|
||||
echo -e "\t\trm sources-dir && \\" >> $MKFILE.tmp
|
||||
echo -e "\tfi;" >> $MKFILE.tmp
|
||||
fi
|
||||
|
||||
# Check if the package has been sucessfully build.
|
||||
echo -e "\tif [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp
|
||||
echo -e "\t\techo \"The build of \$@ has failed\" && exit 1; \\" >> $MKFILE.tmp
|
||||
echo -e "\tfi;" >> $MKFILE.tmp
|
||||
|
||||
# Keep the script file name in a second variable for Makefile dependencies.
|
||||
PREV=$i
|
||||
|
||||
done
|
||||
|
||||
# Stick variables and some defines at the top of the real makefile
|
||||
|
@ -410,7 +452,6 @@ build_Makefile() {
|
|||
echo -e "\ttouch envars && \\" >> $MKFILE
|
||||
echo -e "\ttouch \$@" >> $MKFILE
|
||||
|
||||
|
||||
# Bring over the items from the Makefile.tmp
|
||||
cat $MKFILE.tmp >> $MKFILE
|
||||
rm $MKFILE.tmp
|
||||
|
@ -442,4 +483,4 @@ fi
|
|||
|
||||
get_book
|
||||
build_Makefile
|
||||
#run_make
|
||||
run_make
|
||||
|
|
Reference in a new issue