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:apply-templates select="userinput" mode="screen"/>
<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:if>
<xsl:text>&#xA;</xsl:text>
@ -71,12 +73,12 @@
</xsl:template>
<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'))">
<xsl:value-of select="substring-before(string(),'make')"/>
<xsl:text>make -k</xsl:text>
<xsl:value-of select="substring-after(string(),'make')"/>
<xsl:text> &amp;&amp;&#xA;</xsl:text>
<xsl:text> &#xA;</xsl:text>
</xsl:if>
</xsl:template>

65
jhalfs
View file

@ -22,8 +22,9 @@ Options:
DIR/jhalfs
-D, --download-client=CLIENT use CLIENT as the program for retrieving
packages
-T, --no-testsuites don't run the package's testsuites
-P, --have-packages don't download the packages
-T, --testsuites run the optional testsuites
-P, --get-packages download the packages
-M, --run-make run make on the generated Makefile
"
help="\
@ -79,18 +80,21 @@ while test $# -gt 0 ; do
shift
;;
--no-testsuites | -T )
shift
--testsuites | -T )
TEST=1
shift
;;
--have-packages | -P )
shift
--get-packages | -P )
HPKG=1
shift
;;
--run-make | -M )
RUNMAKE=1
shift
;;
* )
echo "$usage"
exit 1
@ -230,7 +234,7 @@ download() {
get_sources() {
# 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`
# 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
fi
# Dump the path to the Binutils and TCL sources
if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then
# Dump the path to the Binutils or TCL sources directory.
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
fi
@ -319,7 +323,7 @@ build_Makefile() {
# 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 \"PKGDIR=\$(LFS)\$(SRC)/binutils-build\" > envars && \\" >> $MKFILE.tmp
echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
fi
@ -340,33 +344,37 @@ build_Makefile() {
echo -e "\ttouch \$@" >> $MKFILE.tmp
# 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.
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 "\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 "\tif [ -e \$(LFS)\$(SRC)/$name-build ]; then \\" >> $MKFILE.tmp
echo -e "\t\trm -r \$(LFS)\$(SRC)/$name-build; \\" >> $MKFILE.tmp
echo -e "\tfi;" >> $MKFILE.tmp
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 "\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 "\t\trm -r \$(LFS)\$(SRC)/binutils-build; \\" >> $MKFILE.tmp
echo -e "\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
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
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 "\t\trm -r \$(LFS)\$(SRC)/binutils-build && \\" >> $MKFILE.tmp
echo -e "\t\trm sources-dir; \\" >> $MKFILE.tmp
echo -e "\tfi;" >> $MKFILE.tmp
fi
@ -374,7 +382,7 @@ build_Makefile() {
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 "\t\trm sources-dir; \\" >> $MKFILE.tmp
echo -e "\tfi;" >> $MKFILE.tmp
fi
@ -459,11 +467,14 @@ build_Makefile() {
}
run_make() {
# Build the system
if [ -e $MKFILE ] ; then
echo -ne "Building the LFS system\n"
cd $JHALFSDIR && make
echo -ne "done\n"
# Test if make must be run.
if [ "$RUNMAKE" = "1" ] ; then
# Build the system
if [ -e $MKFILE ] ; then
echo -ne "Building the LFS system\n"
cd $JHALFSDIR && make
echo -ne "done\n"
fi
fi
}