Making the packages dowload and testsuites run optional.

Added a switch to desactivate the automatic run of make.
Fixed some oustanding bugs and chapter05 issues.
This commit is contained in:
Manuel Canales Esparcia 2005-10-02 09:14:02 +00:00
parent 71642ef6ea
commit d31093993a
2 changed files with 43 additions and 30 deletions

View file

@ -61,7 +61,9 @@
<xsl:otherwise> <xsl:otherwise>
<xsl:apply-templates select="userinput" mode="screen"/> <xsl:apply-templates select="userinput" mode="screen"/>
<xsl:if test="position() != last() and <xsl:if test="position() != last() and
not(contains(string(),'EOF'))"> not(contains(string(),'EOF')) and
not(contains(string(),'check')) and
not(ancestor::sect1[@id='ch-tools-stripping'])">
<xsl:text> &amp;&amp;</xsl:text> <xsl:text> &amp;&amp;</xsl:text>
</xsl:if> </xsl:if>
<xsl:text>&#xA;</xsl:text> <xsl:text>&#xA;</xsl:text>
@ -71,12 +73,12 @@
</xsl:template> </xsl:template>
<xsl:template match="para/userinput"> <xsl:template match="para/userinput">
<xsl:if test="$testsuite = '0' and (contains(string(),'test') or <xsl:if test="$testsuite != '0' and (contains(string(),'test') or
contains(string(),'check'))"> contains(string(),'check'))">
<xsl:value-of select="substring-before(string(),'make')"/> <xsl:value-of select="substring-before(string(),'make')"/>
<xsl:text>make -k</xsl:text> <xsl:text>make -k</xsl:text>
<xsl:value-of select="substring-after(string(),'make')"/> <xsl:value-of select="substring-after(string(),'make')"/>
<xsl:text> &amp;&amp;&#xA;</xsl:text> <xsl:text> &#xA;</xsl:text>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>

65
jhalfs
View file

@ -22,8 +22,9 @@ Options:
DIR/jhalfs DIR/jhalfs
-D, --download-client=CLIENT use CLIENT as the program for retrieving -D, --download-client=CLIENT use CLIENT as the program for retrieving
packages packages
-T, --no-testsuites don't run the package's testsuites -T, --testsuites run the optional testsuites
-P, --have-packages don't download the packages -P, --get-packages download the packages
-M, --run-make run make on the generated Makefile
" "
help="\ help="\
@ -79,18 +80,21 @@ while test $# -gt 0 ; do
shift shift
;; ;;
--no-testsuites | -T ) --testsuites | -T )
shift
TEST=1 TEST=1
shift shift
;; ;;
--have-packages | -P ) --get-packages | -P )
shift
HPKG=1 HPKG=1
shift shift
;; ;;
--run-make | -M )
RUNMAKE=1
shift
;;
* ) * )
echo "$usage" echo "$usage"
exit 1 exit 1
@ -230,7 +234,7 @@ download() {
get_sources() { get_sources() {
# Test if the packages must be downloaded # Test if the packages must be downloaded
if [ -z $HPKG ] ; then if [ "$HPKG" = "1" ] ; then
# This variable is necessary to make sure the `cat $JHALFSDIR/packages` # This variable is necessary to make sure the `cat $JHALFSDIR/packages`
# separates each iteration by lines. It is necessary to have the second # separates each iteration by lines. It is necessary to have the second
@ -309,8 +313,8 @@ build_Makefile() {
echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
fi fi
# Dump the path to the Binutils and TCL sources # Dump the path to the Binutils or TCL sources directory.
if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" -o "$i" = "036-binutils-pass2" ] ; then
echo -e "\techo \"\$(LFS)\$(SRC)/\$\$ROOT\" > sources-dir && \\" >> $MKFILE.tmp echo -e "\techo \"\$(LFS)\$(SRC)/\$\$ROOT\" > sources-dir && \\" >> $MKFILE.tmp
fi fi
@ -319,7 +323,7 @@ build_Makefile() {
# For the Adjusting phase we must to cd to the binutils-build directory. # For the Adjusting phase we must to cd to the binutils-build directory.
if [ "$i" = "031-adjusting" ] ; then if [ "$i" = "031-adjusting" ] ; then
echo -e "\techo \"PKGDIR=\`cat sources-dir\`\" > envars && \\" >> $MKFILE.tmp echo -e "\techo \"PKGDIR=\$(LFS)\$(SRC)/binutils-build\" > envars && \\" >> $MKFILE.tmp
echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
fi fi
@ -340,33 +344,37 @@ build_Makefile() {
echo -e "\ttouch \$@" >> $MKFILE.tmp echo -e "\ttouch \$@" >> $MKFILE.tmp
# Remove the build directory(ies) even if the package build fails, except for # 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 # Binutils and TCL. In that cases the sources directories are removed
# only if the build fails. # only if the build fails.
if [ "$vrs" != "" ] ; then if [ "$vrs" != "" ] ; then
if [ "$i" != "027-binutils-pass1" ] && [ "$i" != "032-tcl" ] ; then if [ "$i" != "027-binutils-pass1" ] && [ "$i" != "032-tcl" ] && [ "$i" != "036-binutils-pass2" ] ; then
echo -e "\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp echo -e "\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
echo -e "\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp echo -e "\tif [ -e \$(LFS)\$(SRC)/$name-build ]; then \\" >> $MKFILE.tmp
echo -e "\t\trm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp echo -e "\t\trm -r \$(LFS)\$(SRC)/$name-build; \\" >> $MKFILE.tmp
echo -e "\tfi;" >> $MKFILE.tmp echo -e "\tfi;" >> $MKFILE.tmp
fi fi
fi fi
if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then if [ "$i" = "027-binutils-pass1" -o "$i" = "036-binutils-pass2" ] ; then
echo -e "\tif [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp echo -e "\tif [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp
echo -e "\t\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $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\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
echo -e "\t\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp echo -e "\t\trm -r \$(LFS)\$(SRC)/binutils-build; \\" >> $MKFILE.tmp
echo -e "\t\t\trm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp echo -e "\tfi;" >> $MKFILE.tmp
echo -e "\t\tfi;" >> $MKFILE.tmp fi
if [ "$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 "\tfi;" >> $MKFILE.tmp echo -e "\tfi;" >> $MKFILE.tmp
fi fi
# Remove the Binutils sources after a sucessfull adjusting phase. # Remove the Binutils pass 1 sources after a sucessfull Adjusting phase.
if [ "$i" = "031-adjusting" ] ; then if [ "$i" = "031-adjusting" ] ; then
echo -e "\tif [ -e \$@ ] ; then \\" >> $MKFILE.tmp echo -e "\tif [ -e \$@ ] ; then \\" >> $MKFILE.tmp
echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $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 -r \$(LFS)\$(SRC)/binutils-build && \\" >> $MKFILE.tmp
echo -e "\t\trm sources-dir && \\" >> $MKFILE.tmp echo -e "\t\trm sources-dir; \\" >> $MKFILE.tmp
echo -e "\tfi;" >> $MKFILE.tmp echo -e "\tfi;" >> $MKFILE.tmp
fi fi
@ -374,7 +382,7 @@ build_Makefile() {
if [ "$i" = "033-expect" ] ; then if [ "$i" = "033-expect" ] ; then
echo -e "\tif [ -e \$@ ] ; then \\" >> $MKFILE.tmp echo -e "\tif [ -e \$@ ] ; then \\" >> $MKFILE.tmp
echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp
echo -e "\t\trm sources-dir && \\" >> $MKFILE.tmp echo -e "\t\trm sources-dir; \\" >> $MKFILE.tmp
echo -e "\tfi;" >> $MKFILE.tmp echo -e "\tfi;" >> $MKFILE.tmp
fi fi
@ -459,11 +467,14 @@ build_Makefile() {
} }
run_make() { run_make() {
# Build the system # Test if make must be run.
if [ -e $MKFILE ] ; then if [ "$RUNMAKE" = "1" ] ; then
echo -ne "Building the LFS system\n" # Build the system
cd $JHALFSDIR && make if [ -e $MKFILE ] ; then
echo -ne "done\n" echo -ne "Building the LFS system\n"
cd $JHALFSDIR && make
echo -ne "done\n"
fi
fi fi
} }