For CLFS 3.0, variable setting is now in final-prep chapter.
Adapt CLFS for that
This commit is contained in:
parent
659be15f60
commit
3f83cb0f8e
3 changed files with 97 additions and 12 deletions
|
@ -46,6 +46,12 @@
|
|||
<!-- Sparc64 processor type -->
|
||||
<xsl:param name="sparc" select="none"/>
|
||||
|
||||
<!-- x86 32 bit target triplet -->
|
||||
<xsl:param name="x86" select="i686-pc-linux-gnu"/>
|
||||
|
||||
<!-- mips target triplet -->
|
||||
<xsl:param name="mips" select="mips-unknown-linux-gnu"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="//sect1"/>
|
||||
</xsl:template>
|
||||
|
@ -53,8 +59,7 @@
|
|||
<xsl:template match="sect1">
|
||||
<xsl:choose>
|
||||
<xsl:when test="../@id='chapter-partitioning' or
|
||||
../@id='chapter-getting-materials' or
|
||||
../@id='chapter-final-preps'"/>
|
||||
../@id='chapter-getting-materials'"/>
|
||||
<xsl:when test="../@id='chapter-testsuite-tools' and $testsuite='0'"/>
|
||||
<xsl:when test="../@id='chapter-boot' and $method='chroot'"/>
|
||||
<xsl:when test="../@id='chapter-chroot' and $method='boot'"/>
|
||||
|
@ -393,6 +398,46 @@
|
|||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="ancestor::sect1[@id='ch-final-preps-variables']">
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(string(),'target triplet')">
|
||||
<xsl:value-of select="$x86"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains(string(),'mips')">
|
||||
<xsl:value-of select="$mips"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains(string(),'BUILD32')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$sparc = '1' or $sparc = '2'">
|
||||
<xsl:text>-m32 -mcpu=ultrasparc -mtune=ultrasparc</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$sparc = '3'">
|
||||
<xsl:text>-m32 -mcpu=ultrasparc3 -mtune=ultrasparc3</xsl:text>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains(string(),'BUILD64')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$sparc = '1' or $sparc = '2'">
|
||||
<xsl:text>-m64 -mcpu=ultrasparc -mtune=ultrasparc</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$sparc = '3'">
|
||||
<xsl:text>-m64 -mcpu=ultrasparc3 -mtune=ultrasparc3</xsl:text>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains(string(),'GCCTARGET')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$sparc = '1' or $sparc = '2'">
|
||||
<xsl:text>-mcpu=ultrasparc -mtune=ultrasparc</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$sparc = '3'">
|
||||
<xsl:text>-mcpu=ultrasparc3 -mtune=ultrasparc3</xsl:text>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>**EDITME</xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
|
|
|
@ -64,9 +64,19 @@ cat << EOF
|
|||
echo "unset CFLAGS" >> \$(LUSER_HOME)/.bashrc && \\
|
||||
echo "unset CXXFLAGS" >> \$(LUSER_HOME)/.bashrc && \\
|
||||
echo "" >> \$(LUSER_HOME)/.bashrc && \\
|
||||
EOF
|
||||
) >> $MKFILE.tmp
|
||||
if ! [ -e final-preps/*variables ]; then
|
||||
(
|
||||
cat << EOF
|
||||
echo "export CLFS_HOST=\"${CLFS_HOST}\"" >> \$(LUSER_HOME)/.bashrc && \\
|
||||
echo "export CLFS_TARGET=\"${TARGET}\"" >> \$(LUSER_HOME)/.bashrc && \\
|
||||
echo "export CLFS_TARGET32=\"${TARGET32}\"" >> \$(LUSER_HOME)/.bashrc && \\
|
||||
EOF
|
||||
) >> $MKFILE.tmp
|
||||
fi
|
||||
(
|
||||
cat << EOF
|
||||
echo "source $JHALFSDIR/envars" >> \$(LUSER_HOME)/.bashrc
|
||||
@chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bashrc && \\
|
||||
chmod a+wt \$(MOUNT_PT) && \\
|
||||
|
@ -82,6 +92,33 @@ EOF
|
|||
|
||||
}
|
||||
|
||||
#--------------------------------------#
|
||||
final_preps_Makefiles() {
|
||||
#--------------------------------------#
|
||||
echo "${tab_}${GREEN}Processing... ${L_arrow}variables ( LUSER ) ${R_arrow}"
|
||||
for file in final-preps/* ; do
|
||||
this_script=`basename $file`
|
||||
case $this_script in
|
||||
*variables )
|
||||
;;
|
||||
*) continue; ;;
|
||||
esac
|
||||
# Set the dependency for the first target.
|
||||
if [ -z $PREV ] ; then PREV=026-settingenvironment ; fi
|
||||
|
||||
# First append each name of the script files to a list (this will become
|
||||
# the names of the targets in the Makefile
|
||||
final_preps="$final_preps $this_script"
|
||||
|
||||
# No need to grab the package name
|
||||
|
||||
LUSER_wrt_target "${this_script}" "$PREV"
|
||||
LUSER_wrt_RunAsUser "${file}"
|
||||
wrt_touch
|
||||
PREV=$this_script
|
||||
done # for file in ....
|
||||
}
|
||||
|
||||
#--------------------------------------#
|
||||
cross_tools_Makefiles() { #
|
||||
#--------------------------------------#
|
||||
|
@ -946,6 +983,7 @@ build_Makefile() { # Construct a Makefile from the book scri
|
|||
method_cmds=${METHOD}_Makefiles
|
||||
|
||||
host_prep_Makefiles # mk_SETUP (SETUP) $host_prep
|
||||
final_preps_Makefiles # mk_F_PREPS (LUSER) $final_preps
|
||||
cross_tools_Makefiles # mk_CROSS (LUSER) $cross_tools
|
||||
temptools_Makefiles # mk_TEMP (LUSER) $temptools
|
||||
$method_cmds # mk_SYSTOOLS (CHROOT) $chroottools/$boottools
|
||||
|
@ -994,7 +1032,7 @@ if [[ "${METHOD}" = "chroot" ]]; then
|
|||
(
|
||||
cat << EOF
|
||||
|
||||
all: ck_UID mk_SETUP mk_CROSS mk_SUDO mk_SYSTOOLS create-sbu_du-report mk_CUSTOM_TOOLS mk_BLFS_TOOL
|
||||
all: ck_UID mk_SETUP mk_F_PREPS mk_SUDO mk_SYSTOOLS create-sbu_du-report mk_CUSTOM_TOOLS mk_BLFS_TOOL
|
||||
@sudo make do-housekeeping
|
||||
@echo "$VERSION - jhalfs build" > clfs-release && \\
|
||||
sudo mv clfs-release \$(MOUNT_PT)/etc && \\
|
||||
|
@ -1016,13 +1054,13 @@ mk_SETUP:
|
|||
@touch \$@
|
||||
|
||||
#---------------AS LUSER
|
||||
mk_CROSS: mk_SETUP
|
||||
@\$(call echo_PHASE,Cross and Temporary Tools)
|
||||
mk_F_PREPS: mk_SETUP
|
||||
@\$(call echo_PHASE,Final Preparations Cross and Temporary Tools)
|
||||
@( \$(SU_LUSER) "make -C \$(MOUNT_PT)/\$(SCRIPT_ROOT) BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
|
||||
@sudo make restore-luser-env
|
||||
@touch \$@
|
||||
|
||||
mk_SUDO: mk_CROSS
|
||||
mk_SUDO: mk_F_PREPS
|
||||
@sudo make BREAKPOINT=\$(BREAKPOINT) SUDO
|
||||
@touch \$@
|
||||
|
||||
|
@ -1050,7 +1088,7 @@ mk_CUSTOM_TOOLS: mk_BLFS_TOOL
|
|||
@touch \$@
|
||||
|
||||
SETUP: $host_prep
|
||||
AS_LUSER: $cross_tools $temptools
|
||||
AS_LUSER: $final_preps $cross_tools $temptools
|
||||
SUDO: $orphan_scripts
|
||||
PREP_CHROOT_JAIL: SHELL=/tools/bin/bash
|
||||
PREP_CHROOT_JAIL: ${chroottools}
|
||||
|
@ -1096,7 +1134,7 @@ if [[ "${METHOD}" = "boot" ]]; then
|
|||
(
|
||||
cat << EOF
|
||||
|
||||
all: ck_UID mk_SETUP mk_CROSS mk_SUDO
|
||||
all: ck_UID mk_SETUP mk_F_PREPS mk_SUDO
|
||||
@sudo make restore-luser-env
|
||||
@sudo make do-housekeeping
|
||||
@\$(call echo_boot_finished,$VERSION)
|
||||
|
@ -1127,12 +1165,12 @@ mk_SETUP:
|
|||
|
||||
#---------------AS LUSER
|
||||
|
||||
mk_CROSS: mk_SETUP
|
||||
@\$(call echo_PHASE,Cross Tool)
|
||||
mk_F_PREPS: mk_SETUP
|
||||
@\$(call echo_PHASE,Final Preparations and Cross Tools)
|
||||
@( \$(SU_LUSER) "make -C \$(MOUNT_PT)/\$(SCRIPT_ROOT) BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
|
||||
@touch \$@
|
||||
|
||||
mk_SUDO: mk_CROSS
|
||||
mk_SUDO: mk_F_PREPS
|
||||
@sudo make BREAKPOINT=\$(BREAKPOINT) SUDO
|
||||
@touch \$@
|
||||
|
||||
|
@ -1159,7 +1197,7 @@ mk_CUSTOM_TOOLS: mk_BLFS_TOOL
|
|||
@touch \$@
|
||||
|
||||
SETUP: $host_prep
|
||||
AS_LUSER: $cross_tools $temptools ${boottools}
|
||||
AS_LUSER: $final_preps $cross_tools $temptools ${boottools}
|
||||
SUDO: $orphan_scripts
|
||||
AS_ROOT: SHELL=/tools/bin/bash
|
||||
AS_ROOT: $testsuitetools $basicsystem $bootscripttools $bootabletools
|
||||
|
|
|
@ -82,6 +82,8 @@ extract_commands() { #
|
|||
--stringparam page $PAGE \
|
||||
--stringparam lang $LANG \
|
||||
--stringparam sparc $SPARC64_PROC \
|
||||
--stringparam x86 $TARGET \
|
||||
--stringparam mips $TARGET \
|
||||
-o ./${PROGNAME}-commands/ $XSL $BOOK/BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
|
||||
;;
|
||||
|
||||
|
|
Reference in a new issue