Stage 1 and 2 build ok, and we can boot ok also.
return 1
fi
- # \1 matches anything followed by a dash and a number
- echo ${1} | sed "s!^\(.*\)-[0-9].*!\1!g"
+ # SED do not support non-greedy regexp:
+ # We want to match any characters preceeding a dash followed by a number
+ # (shortest match -> non-greedy)
+ echo ${1} | sed "s!\([^-][^0-9]*\)-[0-9].*!\1!"
}
# Saves the content of CFLAGS and CXXFLAGS environment variables.
exit ${EXIT_FAILURE}
fi
- # Checking if there is a corresponding config.cache file
- local cache_file=$(pwd)/config.cache.$(get_pkg_name ${PACKAGE_NAME})
- if [ -f ${cache_file} ]; then
- CONFIGURE_OPTS="${CONFIGURE_OPTS} --cache-file=${cache_file}"
- fi
-
PACKAGE_LOG=${LFS_LOG_DIR}/${LABEL}.log
# Checking if package was previously successfully installed
CONFIGURE_OPTS=${*}
# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}-build
-../${PACKAGE}/configure \
- --prefix=/cross-tools \
- ${CONFIGURE_OPTS}
-${HVMAKE}
-${HVMAKE} install
+source ${SCRDIR}/../sysinfos
+source ${SCRDIR}/../functions
+source ${SCRDIR}/../packages-list
+
+DEFAULT_CONFIGURE_PREFIX=/cross-tools
+
+# Default configure function
+hvconfigure()
+{
+ cd ${LFS_TMP}/${PACKAGE}-build
+
+ FINAL_CFG_OPTS="\
+ --prefix=${DEFAULT_CONFIGURE_PREFIX} \
+ ${CONFIGURE_OPTS}"
+
+ echo "Running configure with options:"
+ echo " <${FINAL_CFG_OPTS}>"
+
+ ../${PACKAGE}/configure ${FINAL_CFG_OPTS}
+}
+
+# Default build function
+hvbuild()
+{
+ ${HVMAKE}
+ ${HVMAKE} install
+}
+
+hvpatch()
+{
+ # Applying patches (if any)
+ apply_patches ${PACKAGE}
+}
+
+PACKAGE_DEF=${SCRDIR}/pkg/$(get_pkg_name ${PACKAGE})
+
+if [ -f ${PACKAGE_DEF} ]; then
+ echo "Load custom package functions and definitions"
+ source ${PACKAGE_DEF}
+fi
+
+hvpatch
+
+# Execute config-cache function if applicable
+if function_exists config_cache ; then
+ echo "Running configure cache script"
+ config_cache
+
+ CONFIGURE_OPTS="${CONFIGURE_OPTS} --cache-file=${LFS_TMP}/${PACKAGE}-build/config.cache"
+fi
+
+# Execute pre-configure function if applicable
+if function_exists configure_pre ; then
+ echo "Running configure pre-script"
+ configure_pre
+fi
+
+if [ -n "${HV_NO_CONFIGURE_SCRIPT}" ]; then
+ echo "Not calling configure because ${PACKAGE} has no configure script"
+else
+ hvconfigure
+fi
+
+# Execute post-configure function if applicable
+if function_exists configure_post ; then
+ echo "Running configure post-script"
+ configure_post
+fi
+
+hvbuild
exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-case "${HVL_TARGET}" in
- "x86_64")
- # This adds 64 bit support to Binutils.
- TARGET_CONFIGURE_OPTS="--enable-64-bit-bfd"
- ;;
-esac
-
-# --prefix=/cross-tools
-# This tells the configure script to prepare to install the package in the
-# /cross-tools directory.
-# --host=${CLFS_HOST}
-# When used with --target, this creates a cross-architecture executable
-# that creates files for ${CLFS_TARGET} but runs on ${CLFS_HOST}.
-# --target=${CLFS_TARGET}
-# When used with --host, this creates a cross-architecture executable that
-# creates files for ${CLFS_TARGET} but runs on ${CLFS_HOST}.
-# --with-lib-path=/tools/lib
-# This tells the configure script to specify the library search path during
-# the compilation of Binutils, resulting in /tools/lib being passed to the
-# linker. This prevents the linker from searching through library
-# directories on the host.
-# --disable-nls
-# This disables internationalization as i18n is not needed for the
-# cross-compile tools.
-# --enable-shared
-# Enable the creation of the shared libraries.
-# --disable-multilib
-# This option disables the building of a multilib capable Binutils.
-
-cd ${LFS_TMP}/${1}-build
-AR=ar AS=as ../${1}/configure \
- --prefix=/cross-tools \
- --host=${CLFS_HOST} \
- --target=${CLFS_TARGET} \
- --with-sysroot=${CLFS} \
- --with-lib-path=/tools/lib \
- --disable-nls \
- --enable-shared \
- --disable-multilib \
- ${TARGET_CONFIGURE_OPTS}
-${HVMAKE} configure-host
-${HVMAKE}
-${HVMAKE} install
-cp -v ../${1}/include/libiberty.h /tools/include
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-# Prevents the configure script from setting LD_LIBRARY_PATH when it finds PPL.
-# This will prevent any conflicts with libraries from the host system:
-sed -e "/LD_LIBRARY_PATH=/d" -i ${LFS_TMP}/${PACKAGE}/configure
-
-cd ${LFS_TMP}/${PACKAGE}-build
-../${PACKAGE}/configure \
- --prefix=/cross-tools \
- ${CONFIGURE_OPTS}
-${HVMAKE}
-${HVMAKE} install
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-case "${HVL_TARGET}" in
- "x86" | "x86_64")
- # Manually apply patch
- #apply_patch ${1}-rpath.patch ${1}
- ;;
-esac
-
-case "${HVL_TARGET}" in
- "x86")
- TMP_CFLAGS="-march=$(cut -d- -f1 <<< ${CLFS_TARGET}) -mtune=native -g -O2"
- ;;
- "x86_64")
- TMP_CFLAGS="-mtune=native -g -O2"
- ;;
-esac
-
-cd ${LFS_TMP}/${1}
-
-decompress_package ${EGLIBC_PORTS} $(pwd) 1> /dev/null
-
-# Disable linking to libgcc_eh:
-sed -e 's/-lgcc_eh//g' -i Makeconfig
-
-cd ${LFS_TMP}/${1}-build
-
-# The following lines need to be added to config.cache for Glibc to support NPTL:
-cat > config.cache << "EOF"
-libc_cv_forced_unwind=yes
-libc_cv_c_cleanup=yes
-libc_cv_gnu89_inline=yes
-libc_cv_ssp=no
-EOF
-
-# Configure options:
-# BUILD_CC="gcc"
-# This sets Glibc to use the current compiler on our system. This is used to
-# create the tools Glibc uses during its build.
-# CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}"
-# Forces Glibc to build using our target architecture GCC utilizing any
-# special CLFS build flags.
-# AR="${CLFS_TARGET}-ar"
-# This forces Glibc to use the ar utility we made for our target
-# architecture.
-# RANLIB="${CLFS_TARGET}-ranlib"
-# This forces Glibc to use the ranlib utility we made for our target
-# architecture.
-#
-# --disable-profile
-# This builds the libraries without profiling information.
-# --enable-add-ons
-# This tells Glibc to utilize all add-ons that are available.
-# --with-tls
-# This tells Glibc to use Thread Local Storage.
-# --enable-kernel=2.x.x
-# Compile the library for support of linux 2.6.x kernels.
-# The kernel version specified must not be newer than the
-# version of the kernel running on the build machine.
-# --with-headers=/tools/include
-# Forces glibc to use the linux-libc-headers installed
-# in /tools/include, rather than those on the host, which
-# may be too old to support needed functionality.
-# --with-__thread
-# This tells Glibc to use use the __thread for libc and libpthread builds.
-# --with-binutils=/cross-tools/bin
-# This tells Glibc to use the Binutils that are specific to our target
-# architecture.
-# --disable-profile
-# Builds the libraries without profiling information.
-BUILD_CC="gcc" \
- CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}" \
- AR="${CLFS_TARGET}-ar" \
- RANLIB="${CLFS_TARGET}-ranlib" \
- CFLAGS=${TMP_CFLAGS} \
- ../${1}/configure \
- --prefix=/tools \
- --host=${CLFS_TARGET} \
- --build=${CLFS_HOST} \
- --disable-profile \
- --enable-add-ons \
- --with-tls \
- --enable-kernel=$(get_pkg_ver ${KERNEL}) \
- --with-__thread \
- --with-binutils=/cross-tools/bin \
- --with-headers=/tools/include \
- --cache-file=config.cache
-${HVMAKE}
-${HVMAKE} install
-
-exit $?
+++ /dev/null
-#!/bin/bash
-
-# Manually applying patches if specified
-if [ -n "${GCC_PATCHES}" ]; then
- for p in ${GCC_PATCHES}; do
- apply_patch ${1}-${p}.patch ${1}
- done
-fi
-
-case "${HVL_TARGET}" in
- *)
- TARGET_CONFIGURE_OPTS="--with-ppl=/cross-tools \
- --with-cloog=/cross-tools \
- --disable-multilib"
- ;;
-esac
-
-case "${HVL_TARGET}" in
- "x86")
- apply_patch ${1}-specs-1.patch ${1}
- ;;
- "x86_64")
- apply_patch ${1}-pure64_specs-1.patch ${1}
- ;;
-esac
-
-cd ${LFS_TMP}/${1}
-
-# Change the StartFile Spec to point to the correct library location:
-echo -en '#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR "/tools/include/"\n\n' >> gcc/config/linux.h
-echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h
-echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h
-
-# Alter gcc's C preprocessor's default include search path to use /tools only:
-cp -v gcc/Makefile.in{,.orig}
-sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \
- gcc/Makefile.in.orig > gcc/Makefile.in
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-source ./cis-gcc-common
-
-# We will create a dummy limits.h so the build will not use the one provided by the host distro:
-touch /tools/include/limits.h
-
-# Configure options:
-# --with-local-prefix=/tools
-# Remove /usr/local/include from gcc's include search path. This is not
-# absolutely essential, however, it helps to minimize the influence of the
-# host system.
-# --disable-shared
-# Disables the creation of the shared libraries.
-# --disable-threads
-# Prevents GCC from looking for the multi-thread include files, since they
-# haven't been created for this architecture yet. GCC will be able to find
-# the multi-thread information after the libc headers are created.
-# --enable-languages=c
-# This option ensures that only the C compiler is built.
-cd ${LFS_TMP}/${1}-build
-AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
- ../${1}/configure \
- --prefix=/cross-tools \
- --build=${CLFS_HOST} \
- --host=${CLFS_HOST} \
- --target=${CLFS_TARGET} \
- --with-sysroot=${CLFS} \
- --with-local-prefix=/tools \
- --disable-nls \
- --disable-shared \
- --with-mpfr=/cross-tools \
- --with-gmp=/cross-tools \
- --without-headers \
- --with-newlib \
- --disable-decimal-float \
- --disable-libgomp \
- --disable-libmudflap \
- --disable-libssp \
- --disable-threads \
- --enable-languages=c \
- ${TARGET_CONFIGURE_OPTS}
-${HVMAKE} all-gcc all-target-libgcc
-${HVMAKE} install-gcc install-target-libgcc
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-source ./cis-gcc-common
-
-# Configure options:
-# --enable-__cxa_atexit
-# This option allows use of __cxa_atexit, rather than atexit, to register
-# C++ destructors for local
-# statics and global objects and is essential for fully standards-compliant
-# handling of destructors. It also affects the C++ ABI and therefore results
-# in C++ shared libraries and C++ programs that are interoperable with other
-# Linux distributions.
-# --enable-c99
-# Enable C99 support for C programs.
-# --enable-long-long
-# Enables long long support in the compiler.
-# --enable-threads=posix
-# This enables C++ exception handling for multi-threaded code.
-# --enable-languages=c,c++
-# This option ensures that only the C and C++ compilers are built.
-cd ${LFS_TMP}/${1}-build
-AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
- ../${1}/configure \
- --prefix=/cross-tools \
- --build=${CLFS_HOST} \
- --host=${CLFS_HOST} \
- --target=${CLFS_TARGET} \
- --with-sysroot=${CLFS} \
- --with-local-prefix=/tools \
- --disable-nls \
- --enable-shared \
- --enable-languages=c,c++ \
- --enable-__cxa_atexit \
- --with-mpfr=/cross-tools \
- --with-gmp=/cross-tools \
- --enable-c99 \
- --enable-long-long \
- --enable-threads=posix \
- ${TARGET_CONFIGURE_OPTS}
-${HVMAKE} \
- AS_FOR_TARGET="${CLFS_TARGET}-as" \
- LD_FOR_TARGET="${CLFS_TARGET}-ld"
-${HVMAKE} install
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-
-${HVMAKE} mrproper
-${HVMAKE} ARCH=${CLFS_ARCH} headers_check
-${HVMAKE} ARCH=${CLFS_ARCH} INSTALL_HDR_PATH=dest headers_install
-install -dv /tools/include
-cp -rv dest/include/* /tools/include
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}-build
-../${PACKAGE}/configure \
- --prefix=/cross-tools \
- ${CONFIGURE_OPTS}
-
-# Only one binary is needed for the Cross-Tools.
-${HVMAKE} -C include
-${HVMAKE} -C progs tic
-
-# Install tic
-install -m755 progs/tic /cross-tools/bin
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Manually apply patch
-apply_patch ${1}-branch_update-1.patch ${1}
-
-case "${HVL_TARGET}" in
- arm926t)
- apply_patch ${1}-config-arm926t.patch ${1}
- ;;
-esac
-
-cd ${LFS_TMP}/${1}
-
-sed -e "s@\(^CROSS_COMPILER_PREFIX=\).*@\1\"${CLFS_TARGET}-\"@" \
- -e "s@\(^KERNEL_HEADERS=\).*@\1\"/tools/include\"@" \
- -e "s@.*\(DEVEL_PREFIX=\).*@\1\"/tools/\"@" \
- -e "s@.*\(^ARCH_${CLFS_NOT_ENDIAN}_ENDIAN\).*@# \1 is not set@g" \
- -e "s@.*\(ARCH_${CLFS_ENDIAN}_ENDIAN\).*@\1=y@g" \
- -e "s@.*\(ARCH_WANTS_${CLFS_ENDIAN}_ENDIAN\).*@\1=y@g" \
- -i .config
-
-${HVMAKE} CROSS=${CLFS_TARGET}- CC="${CLFS_TARGET}-gcc ${BUILD}"
-${HVMAKE} PREFIX=${CLFS} install
-
-exit $?
init_log_file
-ipkg_cust ${KERNEL} cis-linux-api-headers
+# Scripts directory
+export SCRDIR=$(pwd)
+
+ipkg_ac ${KERNEL}
case "${HVL_TARGET}" in
x86*)
ipkg_ac ${FILE_PKG}
- ipkg_cust ${NCURSES} cis-ncurses "\
+ ipkg_ac ${NCURSES} "\
--without-debug \
--without-shared"
;;
--disable-optimization \
--with-libgmp-prefix=/cross-tools \
--with-libgmpxx-prefix=/cross-tools"
-ipkg_cust ${CLOOG_PPL} cis-cloog-ppl "\
+ipkg_ac ${CLOOG_PPL} "\
--enable-shared \
--with-bits=gmp \
--with-gmp=/cross-tools \
LDFLAGS=""
-ipkg_cust ${BINUTILS} cis-binutils
-ipkg ${GCC} cis-gcc-pass1 "${GCC}-pass1"
-ipkg_cust ${EGLIBC} cis-eglibc
-ipkg ${GCC} cis-gcc-pass2 "${GCC}-pass2"
+AR=ar AS=as \
+ ipkg_ac ${BINUTILS} "\
+ --host=${CLFS_HOST} \
+ --target=${CLFS_TARGET} \
+ --with-sysroot=${CLFS} \
+ --with-lib-path=/tools/lib \
+ --disable-nls \
+ --enable-shared \
+ --disable-multilib"
+
+GCC_PASS1="1" AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
+ ipkg ${GCC} cis-ac "${GCC}-pass1"
+
+BUILD_CC="gcc" \
+ CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}" \
+ AR="${CLFS_TARGET}-ar" \
+ RANLIB="${CLFS_TARGET}-ranlib" \
+ ipkg_ac ${EGLIBC} "\
+ --host=${CLFS_TARGET} \
+ --build=${CLFS_HOST} \
+ --disable-profile \
+ --enable-add-ons \
+ --with-tls \
+ --enable-kernel=$(get_pkg_ver ${KERNEL}) \
+ --with-__thread \
+ --with-binutils=/cross-tools/bin \
+ --with-headers=/tools/include"
+
+GCC_PASS2="1" AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
+ ipkg ${GCC} cis-ac "${GCC}-pass2"
exit $?
--- /dev/null
+#!/bin/bash
+
+configure_pre()
+{
+ case "${HVL_TARGET}" in
+ "x86_64")
+ # This adds 64 bit support to Binutils.
+ CONFIGURE_OPTS="${CONFIGURE_OPTS} --enable-64-bit-bfd"
+ ;;
+ esac
+
+}
+
+hvbuild()
+{
+ ${HVMAKE} configure-host
+ ${HVMAKE}
+ ${HVMAKE} install
+ cp -v ../${PACKAGE}/include/libiberty.h /tools/include
+}
--- /dev/null
+#!/bin/bash
+
+# Prevents the configure script from setting LD_LIBRARY_PATH when it finds PPL.
+# This will prevent any conflicts with libraries from the host system.
+configure_pre()
+{
+ sed -e "/LD_LIBRARY_PATH=/d" -i ${LFS_TMP}/${PACKAGE}/configure
+}
--- /dev/null
+#!/bin/bash
+
+hvpatch()
+{
+ case "${HVL_TARGET}" in
+ "x86" | "x86_64")
+ # Manually apply patch
+ #apply_patch ${1}-rpath.patch ${1}
+ ;;
+ esac
+}
+
+# For Glibc to support NPTL:
+config_cache()
+{
+cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
+libc_cv_forced_unwind=yes
+libc_cv_c_cleanup=yes
+libc_cv_gnu89_inline=yes
+libc_cv_ssp=no
+EOF
+}
+
+configure_pre()
+{
+ case "${HVL_TARGET}" in
+ "x86")
+ CFLAGS="-march=$(cut -d- -f1 <<< ${CLFS_TARGET}) -mtune=native -g -O2"
+ ;;
+ "x86_64")
+ CFLAGS="-mtune=native -g -O2"
+ ;;
+ esac
+
+ cd ${LFS_TMP}/${PACKAGE}
+
+ decompress_package ${EGLIBC_PORTS} $(pwd) 1> /dev/null
+
+ # Disable linking to libgcc_eh:
+ sed -e 's/-lgcc_eh//g' -i Makeconfig
+
+ DEFAULT_CONFIGURE_PREFIX=/tools
+}
--- /dev/null
+#!/bin/bash
+
+hvpatch()
+{
+ # Manually applying patches if specified
+ if [ -n "${GCC_PATCHES}" ]; then
+ for p in ${GCC_PATCHES}; do
+ apply_patch ${PACKAGE}-${p}.patch ${PACKAGE}
+ done
+ fi
+
+ case "${HVL_TARGET}" in
+ "x86")
+ apply_patch ${PACKAGE}-specs-1.patch ${PACKAGE}
+ ;;
+ "x86_64")
+ apply_patch ${PACKAGE}-pure64_specs-1.patch ${PACKAGE}
+ ;;
+ esac
+}
+
+configure_pre()
+{
+ # Common options for passes 1 & 2
+ CONFIGURE_OPTS="${CONFIGURE_OPTS} \
+ --build=${CLFS_HOST} \
+ --host=${CLFS_HOST} \
+ --target=${CLFS_TARGET} \
+ --with-sysroot=${CLFS} \
+ --with-local-prefix=/tools \
+ --disable-nls \
+ --with-mpfr=/cross-tools \
+ --with-gmp=/cross-tools"
+
+ if [ -n "${GCC_PASS1}" ]; then
+ CONFIGURE_OPTS="${CONFIGURE_OPTS} \
+ --disable-shared \
+ --without-headers \
+ --with-newlib \
+ --disable-decimal-float \
+ --disable-libgomp \
+ --disable-libmudflap \
+ --disable-libssp \
+ --disable-threads \
+ --enable-languages=c"
+ else
+ CONFIGURE_OPTS="${CONFIGURE_OPTS} \
+ --enable-shared \
+ --enable-languages=c,c++ \
+ --enable-__cxa_atexit \
+ --enable-c99 \
+ --enable-long-long \
+ --enable-threads=posix"
+ fi
+
+ case "${HVL_TARGET}" in
+ *)
+ CONFIGURE_OPTS="${CONFIGURE_OPTS} --with-ppl=/cross-tools \
+ --with-cloog=/cross-tools \
+ --disable-multilib"
+ ;;
+ esac
+
+ cd ${LFS_TMP}/${PACKAGE}
+
+ # Change the StartFile Spec to point to the correct library location:
+ echo -en '#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR "/tools/include/"\n\n' >> gcc/config/linux.h
+ echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h
+ echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h
+
+ # Alter gcc's C preprocessor's default include search path to use /tools
+ # only:
+ sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \
+ -i gcc/Makefile.in
+
+ if [ -n "${GCC_PASS1}" ]; then
+ # We will create a dummy limits.h so the build will not use the one
+ # provided by the host distro:
+ touch /tools/include/limits.h
+ fi
+}
+
+hvbuild()
+{
+ if [ -n "${GCC_PASS1}" ]; then
+ ${HVMAKE} all-gcc all-target-libgcc
+ ${HVMAKE} install-gcc install-target-libgcc
+ else
+ ${HVMAKE} \
+ AS_FOR_TARGET="${CLFS_TARGET}-as" \
+ LD_FOR_TARGET="${CLFS_TARGET}-ld"
+ ${HVMAKE} install
+ fi
+}
--- /dev/null
+#!/bin/bash
+
+HV_NO_CONFIGURE_SCRIPT=1
+
+hvbuild()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+
+ ${HVMAKE} mrproper
+ ${HVMAKE} ARCH=${CLFS_ARCH} headers_check
+ ${HVMAKE} ARCH=${CLFS_ARCH} INSTALL_HDR_PATH=dest headers_install
+ install -dv /tools/include
+ cp -rv dest/include/* /tools/include
+}
--- /dev/null
+#!/bin/bash
+
+hvbuid()
+{
+ # Only one binary is needed for the Cross-Tools.
+ ${HVMAKE} -C include
+ ${HVMAKE} -C progs tic
+
+ # Install tic
+ install -m755 progs/tic /cross-tools/bin
+}
--- /dev/null
+#!/bin/bash
+
+HV_NO_CONFIGURE_SCRIPT=1
+
+hvpatch()
+{
+ # Manually apply patch
+ apply_patch ${1}-branch_update-1.patch ${PACKAGE}
+
+ case "${HVL_TARGET}" in
+ arm926t)
+ apply_patch ${PACKAGE}-config-arm926t.patch ${PACKAGE}
+ ;;
+ esac
+}
+
+hvbuild()
+{
+ cd ${LFS_TMP}/${1}
+
+ sed -e "s@\(^CROSS_COMPILER_PREFIX=\).*@\1\"${CLFS_TARGET}-\"@" \
+ -e "s@\(^KERNEL_HEADERS=\).*@\1\"/tools/include\"@" \
+ -e "s@.*\(DEVEL_PREFIX=\).*@\1\"/tools/\"@" \
+ -e "s@.*\(^ARCH_${CLFS_NOT_ENDIAN}_ENDIAN\).*@# \1 is not set@g" \
+ -e "s@.*\(ARCH_${CLFS_ENDIAN}_ENDIAN\).*@\1=y@g" \
+ -e "s@.*\(ARCH_WANTS_${CLFS_ENDIAN}_ENDIAN\).*@\1=y@g" \
+ -i .config
+
+ ${HVMAKE} CROSS=${CLFS_TARGET}- CC="${CLFS_TARGET}-gcc ${BUILD}"
+ ${HVMAKE} PREFIX=${CLFS} install
+}
+++ /dev/null
-#!/bin/bash
-
-build_custom()
-{
- ${HVMAKE}
- ${HVMAKE} install
-
- ln -svfT bash /tools/bin/sh
-}
+++ /dev/null
-#!/bin/bash
-
-build_custom()
-{
- ${HVMAKE} configure-host
- ${HVMAKE}
- ${HVMAKE} install
-}
+++ /dev/null
-#!/bin/bash
-
-build_custom()
-{
- # When PPL is cross-compiled, it does not check whether GMP was compiled
- # with support for exceptions, and simply assumes it was not. This
- # assumption is incorrect, so we will fix that:
- echo '#define PPL_GMP_SUPPORTS_EXCEPTIONS 1' >> confdefs.h
-
- ${HVMAKE}
- ${HVMAKE} install
-}
+++ /dev/null
-#!/bin/bash
-
-build_custom()
-{
- ${HVMAKE} -C tools/gnulib/lib
- ${HVMAKE} -C tools
- ${HVMAKE}
- ${HVMAKE} install
-}
CONFIGURE_OPTS=${*}
# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
+source ${SCRDIR}/../sysinfos
+source ${SCRDIR}/../functions
+source ${SCRDIR}/../packages-list
-# Applying patches (if any)
-apply_patches ${PACKAGE}
+DEFAULT_CONFIGURE_PREFIX=/tools
-${SCRDIR}/cis-common ${PACKAGE} ${CONFIGURE_OPTS}
+# Default configure function
+hvconfigure()
+{
+ cd ${LFS_TMP}/${PACKAGE}-build
+
+ FINAL_CFG_OPTS="\
+ --prefix=${DEFAULT_CONFIGURE_PREFIX} \
+ --build=${CLFS_HOST} \
+ --host=${CLFS_TARGET} \
+ ${CONFIGURE_OPTS}"
+
+ echo "Running configure with options:"
+ echo " <${FINAL_CFG_OPTS}>"
+
+ CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \
+ ../${PACKAGE}/configure ${FINAL_CFG_OPTS}
+}
+
+# Default build function
+hvbuild()
+{
+ ${HVMAKE}
+ ${HVMAKE} install
+}
+
+hvpatch()
+{
+ # Applying patches (if any)
+ apply_patches ${PACKAGE}
+}
+
+PACKAGE_DEF=${SCRDIR}/pkg/$(get_pkg_name ${PACKAGE})
+
+if [ -f ${PACKAGE_DEF} ]; then
+ echo "Load custom package functions and definitions"
+ source ${PACKAGE_DEF}
+fi
+
+hvpatch
+
+# Execute config-cache function if applicable
+if function_exists config_cache ; then
+ echo "Running configure cache script"
+ config_cache
+
+ CONFIGURE_OPTS="${CONFIGURE_OPTS} --cache-file=${LFS_TMP}/${PACKAGE}-build/config.cache"
+fi
+
+# Execute pre-configure function if applicable
+if function_exists configure_pre ; then
+ echo "Running configure pre-script"
+ configure_pre
+fi
+
+if [ -n "${HV_NO_CONFIGURE_SCRIPT}" ]; then
+ echo "Not calling configure because ${PACKAGE} has no configure script"
+else
+ hvconfigure
+fi
+
+# Execute post-configure function if applicable
+if function_exists configure_post ; then
+ echo "Running configure post-script"
+ configure_post
+fi
+
+hvbuild
exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-
-CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \
- ./configure \
- --prefix=/tools \
- --build=${CLFS_HOST} \
- --host=${CLFS_TARGET} \
- ${CONFIGURE_OPTS}
-${HVMAKE}
-${HVMAKE} install
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-
-# Bzip2's default Makefile target automatically runs the testsuite as well.
-# Disable the tests since they won't work on a multi-architecture build:
-sed -e 's@^\(all:.*\) test@\1@g' -i Makefile
-
-# This package doesn't have a configure script...
-${HVMAKE} CC="${CC} ${CLFS_BUILDFLAGS}" AR="${AR}" RANLIB="${RANLIB}"
-${HVMAKE} PREFIX=/tools install
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ${SCRDIR}/../sysinfos
-source ${SCRDIR}/../functions
-source ${SCRDIR}/../packages-list
-
-suf=$(get_pkg_name ${PACKAGE})
-for scrtype in configure.pre build; do
- myscr=${SCRDIR}/${scrtype}.${suf}
-
- if [ -f ${myscr} ]; then
- source ${myscr}
- fi
-done
-
-cd ${LFS_TMP}/${PACKAGE}-build
-
-# Execute pre-configure function if applicable
-if function_exists configure_pre ; then
- echo "Running configure pre-script"
- configure_pre
-fi
-
-CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \
- ../${PACKAGE}/configure \
- --prefix=/tools \
- --build=${CLFS_HOST} \
- --host=${CLFS_TARGET} \
- ${CONFIGURE_OPTS}
-
-if function_exists build_custom ; then
- # Execute custom build function if applicable
- echo "Running custom build function"
- build_custom
-else
- # Standard build
- ${HVMAKE}
- ${HVMAKE} install
-fi
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}-build
-
-CC="${CC} ${CLFS_BUILDFLAGS}" PKG_CONFIG=true \
- ../${PACKAGE}/configure \
- --prefix=/tools \
- --enable-elf-shlibs \
- --with-linker=${LD} \
- --host=${CLFS_TARGET} \
- --disable-libblkid \
- --disable-libuuid \
- --disable-fsck \
- --disable-uuidd
-${HVMAKE} LIBUUID="-luuid" STATIC_LIBUUID="-luuid" \
- LIBBLKID="-lblkid" STATIC_LIBBLKID="-lblkid"
-${HVMAKE} install
-# Install the static libraries and headers:
-${HVMAKE} install-libs
-
-# Create needed symlinks for a bootable system:
-LINKS="fsck.ext2 fsck.ext3 fsck.ext4 e2fsck"
-
-for link in ${LINKS}; do
- ln -svfT /tools/sbin/${link} ${LFS}/sbin/${link}
-done
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Manually applying patches if specified
-if [ -n "${GCC_PATCHES}" ]; then
- for p in ${GCC_PATCHES}; do
- apply_patch ${1}-${p}.patch ${1}
- done
-fi
-
-case "${HVL_TARGET}" in
- "x86")
- apply_patch ${1}-specs-1.patch ${1}
- ;;
- "x86_64")
- apply_patch ${1}-pure64_specs-1.patch ${1}
- ;;
-esac
-
-cd ${LFS_TMP}/${1}
-
-# Change the StartFile Spec to point to the correct library location:
-echo -en '#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR "/tools/include/"\n\n' >> gcc/config/linux.h
-echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h
-echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h
-
-# Set the directory searched by the fixincludes process for system headers, so it won't look at the host's headers:
-cp -v gcc/Makefile.in{,.orig}
-sed -e 's@\(^NATIVE_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g' \
- gcc/Makefile.in.orig > gcc/Makefile.in
-
-# --with-local-prefix=/tools
-# The purpose of this switch is to remove /usr/local/include from gcc's include search path.
-# This is not absolutely essential, however, it helps to minimize the influence of the host system.
-# --disable-shared
-# Disables the creation of the shared libraries.
-# --disable-threads
-# This will prevent GCC from looking for the multi-thread include files, since they haven't been
-# created for this architecture yet. GCC will be able to find the multi-thread information after
-# the Glibc headers are created.
-# --enable-languages=c
-# This option ensures that only the C compiler is built.
-cd ${LFS_TMP}/${1}-build
-CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \
- ../${1}/configure \
- --prefix=/tools \
- --build=${CLFS_HOST} \
- --host=${CLFS_TARGET} \
- --target=${CLFS_TARGET} \
- --disable-multilib \
- --with-local-prefix=/tools \
- --libexecdir=/tools/lib \
- --disable-nls \
- --disable-libstdcxx-pch \
- --enable-long-long \
- --enable-c99 \
- --enable-shared \
- --enable-threads=posix \
- --enable-__cxa_atexit \
- --enable-languages=c,c++
-# Prevent GCC from looking in the wrong directories for headers and libraries:
-sed -e "/^HOST_\(GMP\|PPL\|CLOOG\)\(LIBS\|INC\)/s:-[IL]/\(lib\|include\)::" \
- -i Makefile
-${HVMAKE} AS_FOR_TARGET="${AS}" LD_FOR_TARGET="${LD}"
-${HVMAKE} install
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}/gettext-tools
-
-# When cross-compiling the Gettext configure script assumes we don't have a
-# working wcwidth when we do. The following will fix possible compilation
-# errors because of this assumption:
-echo "gl_cv_func_wcwidth_works=yes" > config.cache
-
-CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \
- ./configure \
- --prefix=/tools \
- --build=${CLFS_HOST} \
- --host=${CLFS_TARGET} \
- --disable-shared \
- --cache-file=config.cache
-${HVMAKE} -C gnulib-lib
-${HVMAKE} -C src msgfmt
-cp -v src/msgfmt /tools/bin
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}-build
-CC="${CC} ${CLFS_BUILDFLAGS}" ../${PACKAGE}/configure \
- --prefix=/ \
- --bindir=/bin \
- --sbindir=/sbin \
- --build=${CLFS_HOST} \
- --host=${CLFS_TARGET}
-make DOCBOOKTOMAN=""
-make DESTDIR=${LFS} install
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}-build
-
-CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \
- ../${PACKAGE}/configure \
- --prefix=/tools \
- --build=${CLFS_HOST} \
- --host=${CLFS_TARGET} \
- ${CONFIGURE_OPTS}
-# When PPL is cross-compiled, it does not check whether GMP was compiled with
-# support for exceptions, and simply assumes it was not. This assumption is
-# incorrect, so we will fix that:
-echo '#define PPL_GMP_SUPPORTS_EXCEPTIONS 1' >> confdefs.h
-
-${HVMAKE}
-${HVMAKE} install
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-cp -v src/Makefile src/Makefile.orig
-sed -e 's@root@0@g' \
- -e "s@/dev/initctl@${CLFS}&@g" \
- -e 's@\(mknod \)-m \([0-9]* \)\(.* \)p@\1\3p; chmod \2\3@g' \
- -e "s@/usr/lib@/tools/lib@" \
- src/Makefile.orig > src/Makefile
-make -C src clobber
-make -C src CC="${CC} ${CLFS_BUILDFLAGS}"
-make -C src install INSTALL=install ROOT=${LFS}
-
-install -m644 ${SCRDIR}/misc/inittab ${LFS}/etc
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-
-install -dv ${LFS}/lib/{firmware,udev/devices/{pts,shm}}
-
-cd ${LFS_TMP}/${PACKAGE}-build
-CC="${CC} ${CLFS_BUILDFLAGS}" ../${PACKAGE}/configure \
- --prefix=/usr \
- --build=${CLFS_HOST} \
- --host=${CLFS_TARGET} \
- --exec-prefix="" \
- --sysconfdir=/etc \
- --libexecdir=/lib/udev \
- --libdir=/usr/lib \
- --disable-extras \
- --disable-introspection
-make
-make DESTDIR=${LFS} install
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}-build
-
-CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \
- ../${PACKAGE}/configure \
- --build=${CLFS_HOST} \
- --host=${CLFS_TARGET} \
- --enable-login-utils \
- --disable-makeinstall-chown
-${HVMAKE}
-${HVMAKE} DESTDIR=${LFS} install
-
-# Copy Libraries and includes to /tools:
-rm -fv ${LFS}/usr/lib/lib{blkid,uuid}.la
-cp -v ${LFS}/usr/lib/lib{blkid,uuid}* /tools/lib
-cp -v ${LFS}/lib/lib{blkid,uuid}* /tools/lib
-ln -sfvT libblkid.so.1.1.0 /tools/lib/libblkid.so
-ln -sfvT libuuid.so.1.3.0 /tools/lib/libuuid.so
-install -dv /tools/include/{blkid,uuid}
-cp -av ${LFS}/usr/include/blkid/* /tools/include/blkid/
-cp -av ${LFS}/usr/include/uuid/* /tools/include/uuid/
-
-exit $?
+++ /dev/null
-#!/bin/bash
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-CC="${CC} ${CLFS_BUILDFLAGS}" ./configure \
- --prefix=/tools
-${HVMAKE}
-
-# Installing the shared library
-${HVMAKE} install
-
-exit $?
+++ /dev/null
-# When Bash is cross-compiled, it cannot test for the presence of named pipes,
-# among other things. If you used su to become an unprivileged user, this
-# combination will cause Bash to build without process substitution, which
-# will break one of the C++ test scripts in eglibc. The following prevents
-# future problems by skipping the check for named pipes, as well as other tests
-# that can not run while cross-compiling or that do not run properly:
-
-ac_cv_func_mmap_fixed_mapped=yes
-ac_cv_func_strcoll_works=yes
-ac_cv_func_working_mktime=yes
-bash_cv_func_sigsetjmp=present
-bash_cv_getcwd_malloc=yes
-bash_cv_job_control_missing=present
-bash_cv_printf_a_format=yes
-bash_cv_sys_named_pipes=present
-bash_cv_ulimit_maxfds=yes
-bash_cv_under_sys_siglist=yes
-bash_cv_unusable_rtsigs=no
-gt_cv_int_divbyzero_sigfpe=yes
+++ /dev/null
-# Configure can not properly determine how to get free space when
-# cross-compiling - as a result, the df program will not be built. Add the
-# following entries to config.cache to correct this, and fix various
-# cross-compiling issues:
-fu_cv_sys_stat_statfs2_bsize=yes
-gl_cv_func_working_mkstemp=yes
+++ /dev/null
-# The following cache entries set the values for tests that do not run while
-# cross-compiling:
-gl_cv_func_wcwidth_works=yes
-ac_cv_func_fnmatch_gnu=yes
+++ /dev/null
-# When Cross Compiling the configure script does not determine the correct
-# values for the following, Set the values manually:
-ac_cv_func_malloc_0_nonnull=yes
-ac_cv_func_realloc_0_nonnull=yes
+++ /dev/null
-# When cross-compiling the Gettext configure script assumes we don't have a
-# working wcwidth when we do. The following will fix possible compilation
-# errors because of this assumption:
-gl_cv_func_wcwidth_works=yes
+++ /dev/null
-ac_cv_func_malloc_0_nonnull=yes
-ac_cv_func_realloc_0_nonnull=yes
+++ /dev/null
-# Configure can not properly determine the results of the following tests:
-gl_cv_func_btowc_eof=yes
-gl_cv_func_mbrtowc_incomplete_state=yes
-gl_cv_func_mbrtowc_sanitycheck=yes
-gl_cv_func_mbrtowc_null_arg=yes
-gl_cv_func_mbrtowc_retval=yes
-gl_cv_func_mbrtowc_nul_retval=yes
-gl_cv_func_wcrtomb_retval=yes
-gl_cv_func_wctob_works=yes
+++ /dev/null
-# Configure can not properly determine the results of a few tests.
-gl_cv_func_wcwidth_works=yes
-gl_cv_func_btowc_eof=yes
-ac_cv_func_malloc_0_nonnull=yes
-ac_cv_func_realloc_0_nonnull=yes
-gl_cv_func_mbrtowc_incomplete_state=yes
-gl_cv_func_mbrtowc_nul_retval=yes
-gl_cv_func_mbrtowc_null_arg=yes
-gl_cv_func_mbrtowc_retval=yes
-gl_cv_func_wcrtomb_retval=yes
+++ /dev/null
-#!/bin/bash
-
-configure_pre()
-{
- case "${HVL_TARGET}" in
- "x86_64")
- # This adds 64 bit support to Binutils.
- CONFIGURE_OPTS="${CONFIGURE_OPTS} --enable-64-bit-bfd"
- ;;
- esac
-}
+++ /dev/null
-#!/bin/bash
-
-# Prevents the configure script from setting LD_LIBRARY_PATH when it finds PPL.
-# This will prevent any conflicts with libraries from the host system.
-configure_pre()
-{
- sed -e "/LD_LIBRARY_PATH=/d" -i ${LFS_TMP}/${PACKAGE}/configure
-}
+++ /dev/null
-#!/bin/bash
-
-configure_pre()
-{
- # Fix a bug when the uname patch is automatically applied
- touch ${LFS_TMP}/${PACKAGE}/man/{uname,hostname}.1
-}
+++ /dev/null
-#!/bin/bash
-
-configure_pre()
-{
- # Make sure that Flex doesn't try to include headers from /usr/include.
- sed -e "s/-I@includedir@//g" -i ${LFS_TMP}/${PACKAGE}/Makefile.in
-}
+++ /dev/null
-#!/bin/bash
-
-configure_pre()
-{
- # Add a missing include statement into one of the source files:
- sed -e '/"m4.h"/i\#include <sys/stat.h>' -i ${LFS_TMP}/${PACKAGE}/src/path.c
-}
--with-bits=gmp \
--with-gmp=/tools \
--with-ppl=/tools"
-ipkg_cust ${ZLIB} cis-zlib
+ipkg_ac ${ZLIB}
ipkg_ac ${BINUTILS} "\
--target=${CLFS_TARGET} \
--with-lib-path=/tools/lib \
--disable-nls \
--enable-shared \
--disable-multilib"
-ipkg_cust ${GCC} cis-gcc
+ipkg_ac ${GCC} "\
+ --target=${CLFS_TARGET} \
+ --disable-multilib \
+ --with-local-prefix=/tools \
+ --libexecdir=/tools/lib \
+ --disable-nls \
+ --disable-libstdcxx-pch \
+ --enable-long-long \
+ --enable-c99 \
+ --enable-shared \
+ --enable-threads=posix \
+ --enable-__cxa_atexit \
+ --enable-languages=c,c++"
ipkg_ac ${NCURSES} "\
--with-shared \
--without-debug \
--with-build-cc=gcc"
ipkg_ac ${BASH} "--without-bash-malloc"
ipkg_ac ${BISON}
-ipkg_cust ${BZIP2} cis-bzip2
+ipkg_ac ${BZIP2}
ipkg_ac ${COREUTILS} "--enable-install-program=hostname"
ipkg_ac ${DIFFUTILS}
ipkg_ac ${FINDUTILS}
ipkg_ac ${FILE_PKG}
ipkg_ac ${FLEX}
ipkg_ac ${GAWK}
-ipkg_cust ${GETTEXT} cis-gettext
+ipkg_ac ${GETTEXT} "--disable-shared"
ipkg_ac ${GREP} "\
--disable-perl-regexp \
--without-included-regex"
rscr once "Creating symbolic links" create-symlinks
ipkg_ac ${NANO} "--enable-color --enable-multibuffer"
-ipkg_cust ${UTIL_LINUX_NG} cis-util-linux-ng
-ipkg_cust ${E2FSPROGS} cis-e2fsprogs
-ipkg_cust ${SYSVINIT} cis-sysvinit
-ipkg_cust ${MODULE_INIT_TOOLS} cis-module-init-tools
-ipkg_cust ${UDEV} cis-udev
+ipkg_ac ${UTIL_LINUX_NG}
+ipkg_ac ${E2FSPROGS}
+ipkg_ac ${SYSVINIT}
+ipkg_ac ${MODULE_INIT_TOOLS}
+ipkg_ac ${UDEV}
rscr once "Creating default users" create-users
rscr once "Creating default groups" create-groups
--- /dev/null
+#!/bin/bash
+
+# When Bash is cross-compiled, it cannot test for the presence of named pipes,
+# among other things. If you used su to become an unprivileged user, this
+# combination will cause Bash to build without process substitution, which
+# will break one of the C++ test scripts in eglibc. The following prevents
+# future problems by skipping the check for named pipes, as well as other tests
+# that can not run while cross-compiling or that do not run properly:
+config_cache()
+{
+cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
+ac_cv_func_mmap_fixed_mapped=yes
+ac_cv_func_strcoll_works=yes
+ac_cv_func_working_mktime=yes
+bash_cv_func_sigsetjmp=present
+bash_cv_getcwd_malloc=yes
+bash_cv_job_control_missing=present
+bash_cv_printf_a_format=yes
+bash_cv_sys_named_pipes=present
+bash_cv_ulimit_maxfds=yes
+bash_cv_under_sys_siglist=yes
+bash_cv_unusable_rtsigs=no
+gt_cv_int_divbyzero_sigfpe=yes
+EOF
+}
+
+hvbuild()
+{
+ ${HVMAKE}
+ ${HVMAKE} install
+
+ ln -svfT bash /tools/bin/sh
+}
--- /dev/null
+#!/bin/bash
+
+configure_pre()
+{
+ case "${HVL_TARGET}" in
+ "x86_64")
+ # This adds 64 bit support to Binutils.
+ CONFIGURE_OPTS="${CONFIGURE_OPTS} --enable-64-bit-bfd"
+ ;;
+ esac
+}
+
+hvbuild()
+{
+ ${HVMAKE} configure-host
+ ${HVMAKE}
+ ${HVMAKE} install
+}
--- /dev/null
+#!/bin/bash
+
+# This package doesn't have a configure script...
+hvconfigure()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+
+ # Bzip2's default Makefile target automatically runs the testsuite as well.
+ # Disable the tests since they won't work on a multi-architecture build:
+ sed -e 's@^\(all:.*\) test@\1@g' -i Makefile
+}
+
+hvbuild()
+{
+ ${HVMAKE} CC="${CC} ${CLFS_BUILDFLAGS}" AR="${AR}" RANLIB="${RANLIB}"
+ ${HVMAKE} PREFIX=/tools install
+}
--- /dev/null
+#!/bin/bash
+
+# Prevents the configure script from setting LD_LIBRARY_PATH when it finds PPL.
+# This will prevent any conflicts with libraries from the host system.
+configure_pre()
+{
+ sed -e "/LD_LIBRARY_PATH=/d" -i ${LFS_TMP}/${PACKAGE}/configure
+}
--- /dev/null
+#!/bin/bash
+
+# Configure cannot properly determine how to get free space when cross-compiling
+# and as a result the df program will not be built. Add the following entries to
+# config.cache to correct this, and fix various cross-compiling issues:
+config_cache()
+{
+cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
+fu_cv_sys_stat_statfs2_bsize=yes
+gl_cv_func_working_mkstemp=yes
+EOF
+}
+
+configure_pre()
+{
+ # Fix a bug when the uname patch is automatically applied
+ touch ${LFS_TMP}/${PACKAGE}/man/{uname,hostname}.1
+}
--- /dev/null
+#!/bin/bash
+
+hvconfigure()
+{
+ cd ${LFS_TMP}/${PACKAGE}-build
+
+ CC="${CC} ${CLFS_BUILDFLAGS}" PKG_CONFIG=true \
+ ../${PACKAGE}/configure \
+ --prefix=/tools \
+ --enable-elf-shlibs \
+ --with-linker=${LD} \
+ --host=${CLFS_TARGET} \
+ --disable-libblkid \
+ --disable-libuuid \
+ --disable-fsck \
+ --disable-uuidd
+}
+
+hvbuild()
+{
+ ${HVMAKE} LIBUUID="-luuid" STATIC_LIBUUID="-luuid" \
+ LIBBLKID="-lblkid" STATIC_LIBBLKID="-lblkid"
+ ${HVMAKE} install
+
+ # Install the static libraries and headers:
+ ${HVMAKE} install-libs
+
+ # Create needed symlinks for a bootable system:
+ LINKS="fsck.ext2 fsck.ext3 fsck.ext4 e2fsck"
+
+ for link in ${LINKS}; do
+ ln -svfT /tools/sbin/${link} ${LFS}/sbin/${link}
+ done
+}
--- /dev/null
+#!/bin/bash
+
+# The following cache entries set the values for tests that do not run while
+# cross-compiling:
+config_cache()
+{
+cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
+gl_cv_func_wcwidth_works=yes
+ac_cv_func_fnmatch_gnu=yes
+EOF
+}
--- /dev/null
+#!/bin/bash
+
+# When Cross Compiling the configure script does not determine the correct
+# values for the following, Set the values manually:
+config_cache()
+{
+cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
+ac_cv_func_malloc_0_nonnull=yes
+ac_cv_func_realloc_0_nonnull=yes
+EOF
+}
+
+configure_pre()
+{
+ # Make sure that Flex doesn't try to include headers from /usr/include.
+ sed -e "s/-I@includedir@//g" -i ${LFS_TMP}/${PACKAGE}/Makefile.in
+}
--- /dev/null
+#!/bin/bash
+
+hvpatch()
+{
+ # Manually applying patches if specified
+ if [ -n "${GCC_PATCHES}" ]; then
+ for p in ${GCC_PATCHES}; do
+ apply_patch ${PACKAGE}-${p}.patch ${PACKAGE}
+ done
+ fi
+
+ case "${HVL_TARGET}" in
+ "x86")
+ apply_patch ${PACKAGE}-specs-1.patch ${PACKAGE}
+ ;;
+ "x86_64")
+ apply_patch ${PACKAGE}-pure64_specs-1.patch ${PACKAGE}
+ ;;
+ esac
+}
+
+configure_pre()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+
+ # Change the StartFile Spec to point to the correct library location:
+ echo -en '#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR "/tools/include/"\n\n' >> gcc/config/linux.h
+ echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h
+ echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h
+
+ # Set the directory searched by the fixincludes process for system headers,
+ # so it won't look at the host's headers:
+ cp -v gcc/Makefile.in{,.orig}
+ sed -e 's@\(^NATIVE_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g' \
+ gcc/Makefile.in.orig > gcc/Makefile.in
+}
+
+configure_post()
+{
+ # Prevent GCC from looking in the wrong directories for headers and
+ # libraries:
+ sed -e "/^HOST_\(GMP\|PPL\|CLOOG\)\(LIBS\|INC\)/s:-[IL]/\(lib\|include\)::" \
+ -i Makefile
+}
+
+hvbuild()
+{
+ ${HVMAKE} AS_FOR_TARGET="${AS}" LD_FOR_TARGET="${LD}"
+ ${HVMAKE} install
+}
--- /dev/null
+#!/bin/bash
+
+# When cross-compiling the Gettext configure script assumes we don't have a
+# working wcwidth when we do. The following will fix possible compilation
+# errors because of this assumption:
+config_cache()
+{
+cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
+gl_cv_func_wcwidth_works=yes
+EOF
+}
+
+hvconfigure()
+{
+ cd ${LFS_TMP}/${PACKAGE}/gettext-tools
+
+ FINAL_CFG_OPTS="\
+ --prefix=/tools \
+ --build=${CLFS_HOST} \
+ --host=${CLFS_TARGET} \
+ ${CONFIGURE_OPTS}"
+
+ echo "Running configure with options:"
+ echo " <${FINAL_CFG_OPTS}>"
+
+ CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \
+ ./configure ${FINAL_CFG_OPTS}
+}
+
+hvbuild()
+{
+ cd ${LFS_TMP}/${PACKAGE}/gettext-tools
+
+ ${HVMAKE} -C gnulib-lib
+ ${HVMAKE} -C src msgfmt
+ cp -v src/msgfmt /tools/bin
+}
--- /dev/null
+#!/bin/bash
+
+# When Cross Compiling the configure script does not determine the correct values
+# for the following, Set the values manually:
+config_cache()
+{
+cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
+ac_cv_func_malloc_0_nonnull=yes
+ac_cv_func_realloc_0_nonnull=yes
+EOF
+}
+
--- /dev/null
+#!/bin/bash
+
+# Configure can not properly determine the results of the following tests:
+config_cache()
+{
+cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
+gl_cv_func_btowc_eof=yes
+gl_cv_func_mbrtowc_incomplete_state=yes
+gl_cv_func_mbrtowc_sanitycheck=yes
+gl_cv_func_mbrtowc_null_arg=yes
+gl_cv_func_mbrtowc_retval=yes
+gl_cv_func_mbrtowc_nul_retval=yes
+gl_cv_func_wcrtomb_retval=yes
+gl_cv_func_wctob_works=yes
+EOF
+}
+
+configure_pre()
+{
+ # Add a missing include statement into one of the source files:
+ sed -e '/"m4.h"/i\#include <sys/stat.h>' -i ${LFS_TMP}/${PACKAGE}/src/path.c
+}
--- /dev/null
+#!/bin/bash
+
+hvconfigure()
+{
+ cd ${LFS_TMP}/${PACKAGE}-build
+
+ CC="${CC} ${CLFS_BUILDFLAGS}" \
+ ../${PACKAGE}/configure \
+ --prefix=/ \
+ --bindir=/bin \
+ --sbindir=/sbin \
+ --build=${CLFS_HOST} \
+ --host=${CLFS_TARGET}
+}
+
+hvbuild()
+{
+ make DOCBOOKTOMAN=""
+ make DESTDIR=${LFS} install
+}
--- /dev/null
+#!/bin/bash
+
+configure_post()
+{
+ # When PPL is cross-compiled, it does not check whether GMP was compiled
+ # with support for exceptions, and simply assumes it was not. This
+ # assumption is incorrect, so we will fix that:
+ echo '#define PPL_GMP_SUPPORTS_EXCEPTIONS 1' >> confdefs.h
+}
--- /dev/null
+#!/bin/bash
+
+HV_NO_CONFIGURE_SCRIPT=1
+
+configure_pre()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+
+ sed -e 's@root@0@g' \
+ -e "s@/dev/initctl@${CLFS}&@g" \
+ -e 's@\(mknod \)-m \([0-9]* \)\(.* \)p@\1\3p; chmod \2\3@g' \
+ -e "s@/usr/lib@/tools/lib@" \
+ -i src/Makefile
+}
+
+hvbuild()
+{
+ make -C src clobber
+ make -C src CC="${CC} ${CLFS_BUILDFLAGS}"
+ make -C src install INSTALL=install ROOT=${LFS}
+
+ install -m644 ${SCRDIR}/misc/inittab ${LFS}/etc
+}
--- /dev/null
+#!/bin/bash
+
+# Configure can not properly determine the results of a few tests.
+config_cache()
+{
+cat > ${LFS_TMP}/${PACKAGE}-build/config.cache << EOF
+gl_cv_func_wcwidth_works=yes
+gl_cv_func_btowc_eof=yes
+ac_cv_func_malloc_0_nonnull=yes
+ac_cv_func_realloc_0_nonnull=yes
+gl_cv_func_mbrtowc_incomplete_state=yes
+gl_cv_func_mbrtowc_nul_retval=yes
+gl_cv_func_mbrtowc_null_arg=yes
+gl_cv_func_mbrtowc_retval=yes
+gl_cv_func_wcrtomb_retval=yes
+EOF
+}
--- /dev/null
+#!/bin/bash
+
+hvbuild()
+{
+ ${HVMAKE} -C tools/gnulib/lib
+ ${HVMAKE} -C tools
+ ${HVMAKE}
+ ${HVMAKE} install
+}
--- /dev/null
+#!/bin/bash
+
+configure_pre()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+
+ install -dv ${LFS}/lib/{firmware,udev/devices/{pts,shm}}
+}
+
+hvconfigure()
+{
+ cd ${LFS_TMP}/${PACKAGE}-build
+
+ CC="${CC} ${CLFS_BUILDFLAGS}" ../${PACKAGE}/configure \
+ --prefix=/usr \
+ --build=${CLFS_HOST} \
+ --host=${CLFS_TARGET} \
+ --exec-prefix="" \
+ --sysconfdir=/etc \
+ --libexecdir=/lib/udev \
+ --libdir=/usr/lib \
+ --disable-extras \
+ --disable-introspection
+}
+
+hvbuild()
+{
+ make
+ make DESTDIR=${LFS} install
+}
--- /dev/null
+#!/bin/bash
+
+hvconfigure()
+{
+ cd ${LFS_TMP}/${PACKAGE}-build
+
+ CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \
+ ../${PACKAGE}/configure \
+ --build=${CLFS_HOST} \
+ --host=${CLFS_TARGET} \
+ --enable-login-utils \
+ --disable-makeinstall-chown
+}
+
+hvbuild()
+{
+ ${HVMAKE}
+ ${HVMAKE} DESTDIR=${LFS} install
+
+ # Copy Libraries and includes to /tools:
+ rm -fv ${LFS}/usr/lib/lib{blkid,uuid}.la
+ cp -v ${LFS}/usr/lib/lib{blkid,uuid}* /tools/lib
+ cp -v ${LFS}/lib/lib{blkid,uuid}* /tools/lib
+ ln -sfvT libblkid.so.1.1.0 /tools/lib/libblkid.so
+ ln -sfvT libuuid.so.1.3.0 /tools/lib/libuuid.so
+ install -dv /tools/include/{blkid,uuid}
+ cp -av ${LFS}/usr/include/blkid/* /tools/include/blkid/
+ cp -av ${LFS}/usr/include/uuid/* /tools/include/uuid/
+}
--- /dev/null
+#!/bin/bash
+
+hvconfigure()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+
+ CC="${CC} ${CLFS_BUILDFLAGS}" ./configure \
+ --prefix=/tools
+}