6. Temptools Phase - Original Build Method (Deprecated)

[Warning] Warning -- Original Build Method Now Deprecated

What follows is the original build method which is now deprecated. It no longer receives any testing from the author and it only receives mechanical updates which renders it essentially unmaintained. In particular, the original method will not be updated for GCC 4.3. Please note that it will be removed entirely in due course. The Next Generation build method is now the preferred option.

6.1. Bash-3.2 Pass 1

[Important] Important

This first pass of Bash is the only package we install "by hand". Everything else after this point is expected to be automated via a build script. However, you can still drive the build manually by typing in all the commands on the interactive shell command line if you prefer. Note: Do not skip Bash Pass 1. It used to be optional but is now a requirement of the build method due to our use of CONFIG_SHELL (see below).

patch -p1 -i ${TT_PFX}/src/patches/bash-3.2-official-039-combined-1.patch &&
sh -c "unset CONFIG_SHELL; ./configure" &&
make &&
install -dv ${TT_PFX}/bin &&
cp -v bash ${TT_PFX}/bin/bash-pass1 &&
ln -sv bash-pass1 ${TT_PFX}/bin/bash &&
ln -sv bash ${TT_PFX}/bin/sh

Rationale Notes

  • Installing Bash as the very first package allows us to specify the "configure shell" to be used by all Autoconf-produced configure scripts during the Temptools phase. This is achieved via the CONFIG_SHELL environment variable mentioned earlier. It serves to enhance the robustness of the build method by reducing reliance on the host's /bin/sh thus avoiding potential breakage when bootstrapping from older distros.

  • Another reason for installing Bash first up is that we can write our build script using all the features of modern Bash without having to worry about which shell is installed as /bin/sh on the host. Simply launch your build script like this: `bash-pass1 myscript.sh'.

    [Tip] Tip

    There is additional benefit to using this technique in that it allows greater flexibility for handling the transition between the Temptools and Chroot phases. For example, you can set the interpreter path in your build script to `#!/temptools/bin/bash' which allows easy re-execution of the same script upon entering the chroot environment without having to fuss over having a `$SYSROOT/bin/sh' symlink already set up. Please refer to the author's own gsbuild scripts for a sample implementation. Naturally, this point is moot if you script in pure Bourne or handle the Temptools/Chroot phases transition using a different method.

  • For our purposes of bootstrapping a new Linux system within the Reference Build context, Bash should build fine on any sane distro made within the last 5 years.

  • The "unset CONFIG_SHELL" in the configure invocation is needed for configure to succeed because the shell pointed to by CONFIG_SHELL doesn't exist yet i.e. we are installing it here.

  • Note: some older hosts have `libtermcap' installed and Bash will prefer it over Ncurses if found by configure unless `--with-curses' is given. Bash also comes with its own Termcap. Rather than tinker with configure switches, it's actually more robust to just let configure work it out for itself. This Pass 1 of Bash is simply for running scripts during the Temptools phase so it shouldn't really matter which Termcap is used.

  • Double ampersands are used here because we're still operating in an interactive shell session at this point. We recommend that you employ a proper error trapping strategy in your build script (eg: set -e). Therefore, double ampersands are not provided in the build commands from this point onwards.

6.2. Make-3.81 Pass 1

./configure
make
cp -v make ${TT_PFX}/bin
ln -sv make ${TT_PFX}/bin/gmake

Rationale Notes

  • for bootstrapping purposes, Make should build fine on any sane distro made from 1999 onwards.

  • the Glibc build needs a version of `make' 3.79 or newer which older distros don't have. We remove all doubts by installing the current version. Why install it now rather than just prior to the Glibc build? Well, it makes sense to integrate it from the outset so that we can start using it immediately.

  • the `gmake' symlink is needed for robustness. `gmake' already exists on some hosts which will prevent Glibc's configure script from finding the `make' we install here.

6.3. Sed-4.1.5 Pass 1

./configure \
	ac_cv_header_stdbool_h=yes
make
cp -v sed/sed ${TT_PFX}/bin

Rationale Notes

  • for bootstrapping purposes, Sed should build fine on any sane distro made from 1999 onwards.

  • The ac_cv_header_stdbool_h=yes tweak is needed when building on older hosts. Please read this bug report for details. Note that on newer hosts the variable is set automatically by configure thus making the tweak unnecessary, but it's perfectly fine to leave it there in all circumstances.

  • Why do we install a Pass 1 of Sed here? There have been reported problems where the Glibc build chokes with older Sed versions. The author hasn't personally seen any such problem but feels it's safer to just install a current Sed from the outset. An added bonus is that we can rely on using `sed -i' during the entire Temptools phase thus simplifying scripting.

6.4. Binutils Pass 1 (2.16.1 through 2.18)

mkdir ../binutils-build
cd ../binutils-build

../binutils-${BINUTILS_VER}/configure \
	--disable-werror
echo "MAKEINFO = :" >> Makefile
make LDFLAGS=${LDFLAGS}

[ "$DIY_ARCH" = x86_64 ] && {
	mkdir -pv $TT_PFX/lib; ln -sv lib $TT_PFX/lib64; }

make install

export CC="gcc -B/usr/bin/"
if echo | $CC -E -o /dev/null - 2>&1 | grep never > /dev/null; then
	CC=gcc
fi

make -C ld clean
make -C ld \
	CC="${CC}" \
	LDFLAGS=${LDFLAGS} \
	LIB_PATH=${TT_PFX}/lib
unset CC
cp -v ld/ld-new ${TT_PFX}/bin

Rationale Notes

  • The `echo "MAKEINFO = :" >> Makefile' tweak is used to remove dependence on `makeinfo' and therefore eliminate all associated problems. Please read the mailing list thread starting with this post for details.

  • We create a lib64 -> lib symlink in the x86_64 case because we are not building a multi-arch toolchain. Even in single-arch mode 64-bit architectures tend to hardwire references to "lib64" in many places throughout the toolchain. It's possible to force everything to "lib" but we'd rather keep all the build commands compatible with other architectures. The symlink keeps things sane and everything Just Works™.

  • After the first Binutils are installed, -B/usr/bin/ is temporarily added to the CC definition in order to force the host GCC to use the host Binutils. Without this override, the host GCC will find the newly installed Binutils in the PATH thus causing a toolchain mismatch and potential breakage. This breakage is likely to strike when using a bleeding edge distro as a host (eg: Fedora) and you're building a toolchain comprised of older versions of toolchain components than those on the host. The "if..echo..grep" statement is required on those hosts with GCC-2.95.x or earlier installed. More background on all of this can be found in the mailing list thread starting with this post (continued here).

  • Note: Unlike LFS, we don't statically link the Pass 1 of Binutils because it's simply unnecessary, and in actual fact is a potential source of failure. We therefore link dynamically for robustness reasons. If you still think static linking is a good idea then at least take note of the Glibc maintainer's views on the subject.

  • Because we're linking dynamically, there's no need to specify `make configure-host' after the initial configure. However, when building on SMP the top level Makefile will run the sub-configure scripts for Libiberty and Binutils simultaneously. This is great for speed and efficiency, but unfortunate for the build log which ends up all jumbled. If you'd like the build log to remain neat and tidy (eg: for diffing purposes), run the sub-configure scripts in serial by executing make configure-host -j1 after the initial configure.

6.5. GCC Pass 1 (3.4.6 through 4.2.4)

sed -i.bak \
	-e '/^LIBGCC2_DEBUG/d' \
	-e '/^STAGE1_CHECK/d' \
	gcc/Makefile.in

BOOT_CFLAGS="-O2 -pipe"
[[ $GCC_VER == 4.* && $DIY_ARCH == i386 ]] &&
	BOOT_CFLAGS="$BOOT_CFLAGS -fomit-frame-pointer"

mkdir ../gcc-build
cd ../gcc-build

export CC="gcc -B/usr/bin/"
if echo | $CC -E -o /dev/null - 2>&1 | grep never > /dev/null; then
	CC=gcc
fi

../gcc-${GCC_VER}/configure \
	--with-local-prefix=${TT_PFX} \
	--disable-shared \
	--disable-libmudflap \
	--disable-libssp \
	--disable-libgomp \
	--disable-multilib \
	--disable-checking \
	--disable-stage1-checking \
	--enable-languages=c \
	--with-ld=${TT_PFX}/bin/ld \
	--with-as=${TT_PFX}/bin/as
unset CC

make \
	BOOT_LDFLAGS=${LDFLAGS} \
	BOOT_CFLAGS="${BOOT_CFLAGS}" \
	STAGE1_CFLAGS="-pipe" \
	LDFLAGS=${LDFLAGS} \
	bootstrap

make install -j1

ln -sv libgcc.a `gcc -print-libgcc-file-name | \
	sed 's/libgcc/&_eh/'`
ln -sv gcc ${TT_PFX}/bin/cc

Rationale Notes

  • We apply a sed to remove STAGE1_CHECKING from the GCC Makefile and also pass `--disable-checking' to configure in order to considerably reduce bootstrap time. Please read this mailing list post for some rationale discussion. Note: 4.2.X introduced `--disable-stage1-checking' which achieves the same effect as the sed. The switch is compatible within supported GCC versions ie: earlier versions simply ignore this switch. The sed doesn't work on 4.2.X but is harmless nevertheless. More info in this mailing list post.

  • Just as in Binutils Pass 1, we again need the CC="gcc -B/usr/bin/" tweak for the same reasons mentioned there. Our new GCC will start combining with our new Binutils in stage 2 of the 3 stage GCC bootstrap procedure.

  • No static linking here for the same reasons as mentioned above in Binutils Pass 1. Additionally, the note about `make configure-host' from there also applies here (Binutils and GCC share the same top level build machinery).

  • When building with GCC-4.x the Makefile variable BOOT_CFLAGS contains `-O2 -g -fomit-frame-pointer' by default. Because we are passing BOOT_CFLAGS to `make' by hand (basically to avoid building with debugging information) we must add `-fomit-frame-pointer' to BOOT_CFLAGS to ensure the compiler is built as intended by the GCC developers. Please read this mailing list post for some background discussion.

  • The switches `--disable-libmudflap', `--disable-libssp' and `--disable-libgomp' first appeared in GCC-4.0, GCC-4.1 and GCC-4.2 respectively. They are used here to streamline our initial "bootstrap" GCC. The switches are all compatible within supported GCC versions ie: earlier versions simply ignore the later switches.

  • We pass `--disable-multilib' here (and in subsequent GCC builds) because it's required to achieve a pure 64-bit build on x86_64. It also speeds up the PowerPC build by omitting the "nof" directory (ie: applicable to -msoft-float). The switch has no effect on x86 and is therefore compatible.

  • Note: Starting with GCC-4.2, the top-level bootstrap mechanism became the default. This means a plain "make" will now default to performing a 3 stage bootstrap unless `--disable-bootstrap' is given. The pre-GCC-4.2 method of "make bootstrap" behaves identically. Therefore, we can maintain compatibility with earlier versions by continuing to use "make bootstrap".

  • The libgcc_eh.a symlink is needed to satisfy the upcoming Glibc build. Please read this mailing list post for some rationale discussion.

6.6. Linux-Kernel-Headers-2.6.27

[Warning] Warning

The 2.6.18 kernel introduced the next generation method of obtaining sanitized kernel headers. For some background on the issue please see this mailing list post. When using the new technique you MUST SKIP the Linux-Libc-Headers step which follows next. In other words, choose one or the other, not both. Only use the old method when building a toolchain comprised of older components (see table of toolchain combinations listed earlier).

make mrproper
make headers_install INSTALL_HDR_PATH=temp
cp -rv temp/include $TT_PFX

6.7. Linux-Libc-Headers-2.6.12.0 (Older toolchains only)

patch -p1 -i ${TT_PFX}/src/patches/linux-libc-headers-2.6.12.0-syscalls-3.patch
cp -Rv include/asm-${DIY_ARCH} ${TT_PFX}/include/asm
cp -Rv include/linux ${TT_PFX}/include

6.8. Glibc (2.3.6 through 2.7)

[Caution] Proceed with Caution!

Glibc is possibly the most critical piece of software you will compile in a base Reference Build. There is a high probability of something going wrong. Be sure to heed the advice contained in Section B, “Glibc General Advice” before taking on this monster. Note: the Glibc compiled here in the Temptools phase is merely a "throw away bootstrap" Glibc, but please do read the aforementioned advice anyway.

[[ $GLIBC_VER > 2.5.9 && $DIY_ARCH == i386 ]] &&
	MARCH="-march=i486"

mkdir ../glibc-build
cd ../glibc-build

CFLAGS="-O2 $MARCH -pipe" \
../glibc-${GLIBC_VER}/configure \
	--disable-profile \
	--enable-add-ons \
	--with-binutils=${TT_PFX}/bin \
	--with-headers=${TT_PFX}/include \
	--without-selinux

echo "AUTOCONF=no
MAKEINFO=:" > configparms

make
make install -j1

Rationale Notes

  • We need to fiddle with `-march=' in CFLAGS because as of Glibc-2.6, i486 is the minimum supported configuration on x86. More information here.

  • `--without-selinux' is a workaround needed on Fedora Core 3 hosts (those with the "libselinux-devel" package installed) to prevent build failure caused by a subtle Makefile bug. Upstream have been notified of the issue.

  • `AUTOCONF=no' is used here for robustness. It simply prevents unnecessary Autoconf invocations when the Makefiles detect a `configure' file older than its respective `configure.in'. This is usually the case when working with CVS snapshots, but it also applies to release tarballs prior to glibc-2.3.5 when the issue was finally addressed. These unnecessary Autoconf invocations have been known to cause build failures on Debian hosts. An alternative approach is to run `find . -name configure | xargs touch' in the src dir before running `configure'. Note: `--without-cvs' does not address the issue.

  • `MAKEINFO=:' is used to prevent installation failures when the host has an older `makeinfo'. Problems were first noticed with Glibc-2.7.

6.9. Adjust Toolchain

cp -pv ${TT_PFX}/bin/ld-new ${TT_PFX}/bin/ld
cp -pv ${TT_PFX}/bin/ld-new ${TT_PFX}/`gcc -dumpmachine`/bin/ld

case "$DIY_ARCH" in
  i386)   DL=/lib/ld-linux.so.2 ;;
  ppc)	  DL=/lib/ld.so.1 ;;
  x86_64) DL=/lib64/ld-linux-x86-64.so.2 ;;
esac

gcc -dumpspecs | sed \
	"s,${DL},${TT_PFX}&," > \
	`gcc -print-search-dirs | head -n 1 | awk '{ print $2 }'`specs

[ "$DIY_ARCH" = x86_64 ] &&
	sed -i.bak '/^\*multilib:$/{n;s/.*/. ;/}' `gcc -print-file-name=specs`

I=`gcc -print-file-name=include`
rm -rfv ${I}/*
J=`gcc -print-file-name=install-tools`
cp -pv ${J}/include/* ${I}
cp -pv ${J}/gsyslimits.h ${I}/syslimits.h

echo 'main(){}' | cc -x c -
readelf -l a.out | grep ": ${TT_PFX}"
rm -fv a.out

Rationale Notes

  • For x86_64 we need to empty the "multilib" spec to prevent GCC from searching for libs on the host. The sed simply modifies the spec to mirror how it would appear in a single-arch scenario. More information in this mailing list post.

6.10. GCC Pass 2 (3.4.6 through 4.2.4)

case "$DIY_ARCH" in
  i386)   DL=/lib/ld-linux.so.2;	  DL_HEADER=i386/linux.h ;;
  ppc)	  DL=/lib/ld.so.1;		  DL_HEADER=rs6000/sysv4.h ;;
  x86_64) DL=/lib64/ld-linux-x86-64.so.2; DL_HEADER=i386/linux64.h
	  sed -i.bak '/MULTILIB_OSDIRNAMES/d' gcc/config/i386/t-linux64 ;;
esac

[[ $BINUTILS_VER == 2.18* && $GCC_VER > 4.1.9 && $GLIBC_VER > 2.5.9 ]] &&
	patch -p1 -i ${TT_PFX}/src/patches/gcc-4.2-branch-hash-style-gnu-1.patch

sed -i.bak \
	"s@${DL}@${TT_PFX}&@" gcc/config/${DL_HEADER}

echo "
/* Remove /usr/include from end of include search path.  */
#undef STANDARD_INCLUDE_DIR
#define STANDARD_INCLUDE_DIR 0" >> gcc/config/${DL_HEADER}

sed -i.bak \
	-e 's,\./fixinc\.sh,-c true,' \
	-e '/^LIBGCC2_DEBUG/d' gcc/Makefile.in

[[ $GCC_VER == 4.* && $DIY_ARCH == i386 ]] &&
	sed -i.bak2 's/^XCFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in

mkdir ../gcc-build
cd ../gcc-build

../gcc-${GCC_VER}/configure \
	--with-local-prefix=${TT_PFX} \
	--enable-shared \
	--disable-multilib \
	--disable-bootstrap \
	--enable-languages=c,c++ \
	--enable-clocale=gnu \
	--enable-threads=posix \
	--enable-__cxa_atexit \
	--disable-libstdcxx-pch

make LDFLAGS=${LDFLAGS}

make install -j1

Rationale Notes

  • On x86_64 we sed out the MULTILIB_OSDIRNAMES reference which has the same effect as emptying the "multilib" spec. This is done for the same reason mentioned earlier i.e. prevent GCC from searching for libs on the host. More information in this mailing list post.

  • As mentioned earlier, we need to pass `--disable-bootstrap' here to prevent GCC-4.2 and above from performing a 3 stage bootstrap. The switch is ignored by earlier versions and is therefore compatible.

  • The notes about `make configure-host' from Binutils Pass 1 and GCC Pass 1 also apply here. However, it gets a little more complicated because we're also building Libstdc++. To achieve the same outcome (ie: run sub-configures in serial for neat build logs under SMP), the sequence needs to be like this:

    make configure-host -j1
    make all-host
    make configure-target -j1
    make all-target
  • When building with GCC-4.x we use a sed to add `-fomit-frame-pointer' to the GCC Makefile to address a correctness issue. Please read this mailing list post for some rationale discussion.

6.11. Binutils Pass 2 (2.16.1 through 2.18)

mkdir ../binutils-build
cd ../binutils-build

../binutils-${BINUTILS_VER}/configure \
	--with-lib-path=${TT_PFX}/lib
echo "MAKEINFO = :" >> Makefile
make LDFLAGS=${LDFLAGS}
make install

make -C ld clean
make -C ld \
	LDFLAGS=${LDFLAGS} \
	LIB_PATH=/lib:/usr/lib
cp -v ld/ld-new ${TT_PFX}/bin

6.12. Gawk-3.1.6

./configure
make
cp -v gawk ${TT_PFX}/bin
ln -sv gawk ${TT_PFX}/bin/awk

6.13. Coreutils-6.12

patch -p1 -i $TT_PFX/src/patches/coreutils-6.12-utimensat-1.patch
./configure \
	--enable-install-program=hostname,su
make
make install
cp -v src/su ${TT_PFX}/bin

Rationale Notes

  • For some background on the `--enable-install-program=hostname,su' configure switch, please read this mailing list post.

  • Because we are operating as a non-privileged user, Coreutils will suppress installation of the `su' program. This is signified by a message shown during `make install': "WARNING: insufficient access; not installing su NOTE: to install su, run 'make install-root' as root". The reason for this is `su' needs to be installed setuid root in order to be fully functional. We manually install it here because even without the setuid bit, we can still use it when inside the Chroot environment to (a) run various testsuites as a non-privileged user and (b) employ Package Management techniques that require building sources as a non-privileged user.

[Important] Important

From this point onwards if you need to become root you must call the host's `su' explicitly by running /bin/su. Just running su will call the first `su' in the $PATH which is the one we just installed (it will fail because of the missing setuid bit). This is especially important when we go to enter the Chroot environment at the beginning of the next phase.

6.14. Bzip2-1.0.5

make PREFIX=${TT_PFX} LDFLAGS=${LDFLAGS} install

6.15. Gzip-1.3.12

[[ $GLIBC_VER > 2.5.9 ]] &&
	sed -i.bak 's/futimens/gl_&/' gzip.c lib/utimens.{c,h}

./configure
make
cp -v gunzip gzip ${TT_PFX}/bin

6.16. Diffutils-2.8.1

./configure
make
cp -v src/{cmp,diff} ${TT_PFX}/bin

6.17. Findutils-4.4.0

./configure
make
cp -v find/find xargs/xargs ${TT_PFX}/bin

6.18. Make-3.81 Pass 2

./configure
make
cp -v make ${TT_PFX}/bin

6.19. Grep-2.5.4

./configure \
	--without-included-regex \
	--disable-perl-regexp
make
cp -v src/{,e,f}grep ${TT_PFX}/bin

Rationale Notes

  • The `MISSING=true' tweak is needed to work around a bug in the current release whereby the build will fail if `makeinfo' is unavailable. See here and here for examples.

6.20. Sed-4.1.5 Pass 2

./configure
make
cp -v sed/sed ${TT_PFX}/bin

6.21. Gettext-0.17

cd gettext-tools
./configure \
	--disable-shared
make -C gnulib-lib
make -C src msgfmt
cp -v src/msgfmt ${TT_PFX}/bin

6.22. Ncurses-5.7

./configure \
	--without-debug \
	--without-ada \
	--enable-overwrite
make
make install

6.23. Patch-2.5.4

./configure
make
cp -v patch ${TT_PFX}/bin

6.24. Tar-1.22

./configure
make
cp -v src/tar ${TT_PFX}/bin

6.25. Texinfo-4.13a

./configure
make
make install

6.26. Bash-3.2 Pass 2

patch -p1 -i ${TT_PFX}/src/patches/bash-3.2-official-039-combined-1.patch
./configure \
	--without-bash-malloc
make
install -v bash ${TT_PFX}/bin

Rationale Notes

6.27. M4-1.4.13

[Tip] Tip

It's worth noting the next 3 packages (M4, Bison and Flex) are not strictly necessary in the Temptools phase when using an official FSF Binutils release. However, they are mandatory if using a release from HJL. The reason is that FSF releases are made with a "make dist" style procedure whereby the generated files (from Bison and Flex) are already included in the tarball thus removing the requirement for Bison and Flex at Binutils build time (in the Chroot phase). Our recommendation is to always build M4, Bison and Flex here to ensure the build recipe remains compatible with both FSF and HJL Binutils releases. There is another issue: if you skip M4, Bison and Flex here it's likely you'll run into ICA trouble which will require an additional hack when building Bison in the Chroot phase.

./configure
make V=1
cp -v src/m4 ${TT_PFX}/bin

6.28. Bison-2.4.1

./configure
make
make install

6.29. Flex-2.5.35

./configure
make
cp -v flex ${TT_PFX}/bin

6.30. E2fsprogs-1.41.4

mkdir build
cd build
../configure
make libs -j1
make install-libs

Rationale Notes

  • We install the E2fsprogs libraries here to satisfy the build of `mount' from Util-Linux-ng in the next step. If you choose not to build `mount' then these libraries are naturally not required.

6.31. Util-Linux-ng-2.14.2

./configure
make -C mount
make -C getopt
cp -v mount/{,u}mount getopt/getopt ${TT_PFX}/bin

Rationale Notes

  • We install `mount' here so we can mount the virtual file systems from within the chroot environment. Please read this mailing list post for some rationale discussion.

  • We install `getopt' here because it's needed by the optional Fakeroot package (see below). If you're not installing Fakeroot then you don't need to install `getopt' here.

6.32. Perl-5.10.0

chmod -v u+w hints/linux.sh

cat >> hints/linux.sh << "EOF"
libc=${prefix}/lib/`ls -l ${prefix}/lib/libc.so.6 | awk '{print $NF}'`
locincpth=""
loclibpth=""
usrinc="${prefix}/include"
glibpth="${prefix}/lib"
EOF

./configure.gnu \
	--prefix=${TT_PFX} \
	-Dstatic_ext='IO Fcntl Data/Dumper POSIX'

make perl utilities ext/Errno/pm_to_blib
cp -v perl pod/pod2man ${TT_PFX}/bin
mkdir -pv ${TT_PFX}/lib/perl5/5.10.0
cp -Rv lib/* ${TT_PFX}/lib/perl5/5.10.0

Rationale Notes

  • For some background on the commands containing "static_ext" and "ext/Errno/pm_to_blib" please read the mailing list thread starting with this post.

6.33. Tcl-8.4.19

cd unix
./configure
make
make install
make install-private-headers
ln -sv tclsh8.4 ${TT_PFX}/bin/tclsh

6.34. Expect-5.43.0

patch -p1 -i ${TT_PFX}/src/patches/expect-5.43-spawn-1.patch
sed -i.bak '/echo.*STTY_BIN/i STTY_BIN=stty' configure
./configure \
	--with-tcl=${TT_PFX}/lib \
	--with-tclinclude=${TT_PFX}/include \
	--with-x=no
make
make SCRIPTS="" install -j1

Rationale Notes

  • The sed to `configure' forces Expect to call a plain `stty' instead of `/bin/stty' or even worse, `/usr/local/bin/stty'. In this way the first `stty' in the PATH will always be used. It also avoids the need to create a `/bin/stty' symlink in Section 7.5, “Create Symlinks”.

6.35. DejaGnu-1.4.4

./configure
make install -j1

6.36. Fakeroot-1.11 (Optional)

./configure
make
sed -i.bak \
	's,^PATHS=,&/lib:/usr/lib:,' \
	scripts/fakeroot
make install

Rationale Notes

  • As mentioned in the Introduction, if you're employing Package Management by building and creating archives as a non-privileged user, files in the resultant archives can sometimes end up with wrong file ownerships and permissions. Fakeroot can provide a solution to this problem. It acts as a wrapper around various library functions and a typical invocation is like this: fakeroot commands-you-want-run-under-a-fake-root-environment. Generally, you only want to be performing the commands associated with installation under Fakeroot. Running commands associated with configuring and building usually work, but the Fakeroot documentation recommends against it. Never run the testsuites for Glibc, Coreutils and Perl under Fakeroot because you will experience failures. The Bash testsuite can also be problematic. Consider this package optional if you're a) not employing Package Management b) building as root or c) using a Package Manager that doesn't require assistance from Fakeroot.

  • The sed is needed to force Fakeroot to load the correct Glibc when inside the Chroot environment. Without it, Fakeroot will load the Temptools Glibc.

  • Another package with similar functionality but having a slightly different feature set is Pretendroot. Details on this package can be found here. Note: we haven't tested Pretendroot in the context of a Reference Build so your mileage may vary.

6.37. Zlib-1.2.3 (Optional)

[Note] Note -- Optional Package Management with Pacman

Only install the next 3 packages (Zlib, Libtar and Pacman) if you intend implementing Pacman based package management. Pacman is a simple tar.gz-based package manager for Linux originally written for the Arch Linux distro. Please refer to the gsbuild scripts for a sample Pacman implementation. It's worth noting the author personally uses Pacman which means it receives regular testing within the Reference Build context.

./configure --prefix=${TT_PFX}
make
make install

6.38. Libtar-1.2.11 (Optional)

patch -p1 -i ${TT_PFX}/src/patches/libtar-1.2.11-2.patch
./configure
make
make install

6.39. Pacman-2.9.8 (Optional)

patch -p1 -i ${TT_PFX}/src/patches/pacman-2.9.8-custom-mods-2.patch
patch -p1 -i ${TT_PFX}/src/patches/pacman-2.9.6-temptools-1.patch
patch -p1 -i ${TT_PFX}/src/patches/pacman-2.9.8-sep_install-1.patch
./configure
make
cp -v pacman scripts/makepkg ${TT_PFX}/bin
cp -v etc/{makepkg,pacman}.conf ${TT_PFX}/etc

6.40. Ogdlutils-20041124 (Optional)

[Note] Note -- Optional Package Management with BPM

Only install the next 3 packages (Ogdlutils, Cpio and BPM) if you intend implementing BPM based package management. BPM is an extremely compact package manager with the simplest spec file format imaginable. It comes from the Bent Linux distro. Please refer to the gsbuild scripts for a sample BPM implementation. BPM only receives occasional testing within the Reference Build context and is included here mainly as a proof of concept. (Note: the gsbuild BPM implementation currently gets some file permissions wrong - FIXME).

make -C c libogdl gpath -j1
cp -v c/gpath ${TT_PFX}/bin

6.41. Cpio-2.9 (Optional)

./configure
make
cp -v src/cpio ${TT_PFX}/bin

6.42. BPM-1.7 (Optional)

cp -v bpm{build,install,pkgfix} ${TT_PFX}/bin

6.43. Remove Cruft

rm -rfv ${TT_PFX}/{,share/}{info,man}