From 81da365042d1bf4354e0480d888fe3b8425c47c7 Mon Sep 17 00:00:00 2001 From: gobo72 Date: Sun, 7 Nov 2010 01:37:02 +0000 Subject: [PATCH] Completed transition to new ipkg method (ipkg.def), successfully booting after stage 1 --- functions | 32 ++++++++++++++++-- functions-ac | 24 +++++++------ stage0/INSTALL | 11 ++---- stage0/install-1 | 1 - stage0/ipkg.def | 2 ++ stage0/pkg/binutils | 37 ++++++++++---------- stage0/pkg/eglibc | 65 ++++++++++++++++++++---------------- stage0/pkg/gcc | 28 ++++++++-------- stage0/pkg/ncurses | 11 +++--- stage0/stage.def | 2 +- stage1/INSTALL | 12 +------ stage1/install-2 | 9 +---- stage1/ipkg.def | 9 +++-- stage1/pkg/binutils | 20 +++++------ stage1/pkg/coreutils | 12 +++---- stage1/pkg/e2fsprogs | 29 ++++++++++------ stage1/pkg/flex | 12 +++---- stage1/pkg/gcc | 30 ++++++++--------- stage1/pkg/gettext | 18 ++++------ stage1/pkg/m4 | 12 +++---- stage1/pkg/module-init-tools | 17 +++++----- stage1/pkg/sysvinit | 2 +- stage1/pkg/udev | 24 ++++++------- stage1/pkg/util-linux-ng | 16 ++++----- stage1/pkg/zlib | 7 ++-- stage1/stage.def | 2 +- stage2/INSTALL | 2 +- stage2/install-1 | 2 +- {stage0 => stage2}/ipkg.def | 3 +- stage2/ipkg.sh | 26 --------------- stage2/pkg/binutils | 24 ++++++++----- stage2/pkg/coreutils | 9 +++-- stage2/pkg/e2fsprogs | 26 ++++++++++----- stage2/pkg/eglibc | 11 ++++-- stage2/pkg/findutils | 11 +++--- stage2/pkg/gcc | 42 +++++++++++++---------- stage2/pkg/groff | 18 +++++++--- stage2/pkg/gzip | 9 +++-- stage2/pkg/inetutils | 19 ++++++----- stage2/pkg/kbd | 12 +++---- stage2/pkg/module-init-tools | 17 +++++----- stage2/pkg/ncurses | 17 ++++++---- stage2/pkg/readline | 8 ++--- stage2/pkg/shadow | 8 ++--- stage2/pkg/util-linux-ng | 17 ++++------ stage2/pkg/zlib | 22 +++++++----- stage2/stage.def | 2 +- 47 files changed, 401 insertions(+), 348 deletions(-) copy {stage0 => stage2}/ipkg.def (69%) delete mode 100755 stage2/ipkg.sh diff --git a/functions b/functions index 7497f3a..2ccd965 100644 --- a/functions +++ b/functions @@ -1,6 +1,6 @@ #!/bin/bash -# This file is 'sourced' by other scripts, therefore the above line is of no -# use, except when modifying the file in emacs to have syntax highlighting. +set -o errtrace # Let shell functions inherit ERR trap. +set -o errexit # Constants for return codes EXIT_SUCCESS=0 @@ -733,6 +733,28 @@ ipkg_trap_handler() exit 1 } +ipkg_display_build_infos() +{ + echo "hvlinux: configure options:" + for opt in ${CONFIGURE_OPTS}; do + echo " ${opt}" + done + echo "hvlinux: environment variables:" + echo " HOST: ${CLFS_HOST}" + echo " TARGET: ${CLFS_TARGET}" + echo " BUILD64: ${BUILD64}" + echo " CFLAGS: ${CFLAGS}" + echo " CPPFLAGS: ${CPPFLAGS}" + echo " CXXFLAGS: ${CFLAGS}" + echo " LDFLAGS: ${LDFLAGS}" + echo " RANLIB: ${RANLIB}" + echo " CC: ${CC}" + echo " CXX: ${CXX}" + echo " AR: ${AR}" + echo " AS: ${AS}" + echo " PATH: ${PATH}" +} + # Installation of a package # Arg. #1: Package name and version (ex: gcc-4.5.1) # Remaining arguments: Additional configure options @@ -832,6 +854,12 @@ ipkg() echo "------------------------" 1>> ${LFS_LOG_FILE} echo "${MSGSTRING}" 1>> ${LFS_LOG_FILE} + exec 7>&1 # Save current "value" of stdout. + # All output from commands in this block sent to file $LFS_LOG_FILE. + exec >> ${LFS_LOG_FILE} 2>&1 + ipkg_display_build_infos + exec 1>&7 7>&- # Restore stdout and close file descriptor #7. + # All output from commands in this block sent to file $PACKAGE_LOG. exec > ${PACKAGE_LOG} 2>&1 diff --git a/functions-ac b/functions-ac index d4b3fbf..618c47f 100644 --- a/functions-ac +++ b/functions-ac @@ -11,8 +11,8 @@ function_exists() return $? } -unset -f hvconfig_cache unset -f hvconfig_pre +unset -f hvconfig_cache unset -f hvconfig_post unset -f hvbuild_post @@ -44,9 +44,6 @@ ipkg_decompress_package() # Default configure function hvconfig() { - echo "Running configure with options:" - echo " <${CONFIGURE_OPTS}>" - if [ "x${IPKG_MODE}" = "xacnb" ]; then # Broken autoconf package that must build in source dir cd ${LFS_TMP}/${PACKAGE} @@ -113,19 +110,22 @@ ipkg_script() hvpatch + # Execute pre-configure function if applicable + if function_exists hvconfig_pre ; then + echo "Running configure pre-script" + hvconfig_pre + fi + # Execute config-cache function if applicable if function_exists hvconfig_cache ; then echo "Running configure cache script" hvconfig_cache - - CONFIGURE_OPTS="${CONFIGURE_OPTS} --cache-file=${LFS_TMP}/${PACKAGE}-build/config.cache" + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --cache-file=${LFS_TMP}/${PACKAGE}-build/config.cache" fi - # Execute pre-configure function if applicable - if function_exists hvconfig_pre ; then - echo "Running configure pre-script" - hvconfig_pre - fi + ipkg_display_build_infos if [ "x${IPKG_MODE}" = "xnoac" ]; then echo "Not calling configure because ${PACKAGE} has no configure script" @@ -146,4 +146,6 @@ ipkg_script() echo "Running build post-script" hvbuild_post fi + + ipkg_finish } diff --git a/stage0/INSTALL b/stage0/INSTALL index acebe70..fa2a3eb 100644 --- a/stage0/INSTALL +++ b/stage0/INSTALL @@ -4,14 +4,7 @@ Installation instructions 1. Create your destination partition and make sure that it is formatted and mounted. -2. Create the LFS user. - -3. Copy the hvlinux-src directory, containing packages and installation - scripts, anywhere in your LFS partition (usually in root directory). - If installing from a CD-ROM, mount it under your LFS partition. - Make sure that your files are owned by the LFS user. - -4. Modify the 'sysinfos' configuration file to reflect your +2. Modify the 'sysinfos' configuration file to reflect your system configuration. -5. Launch './stage0-install' +3. Launch './install-1' diff --git a/stage0/install-1 b/stage0/install-1 index 22fb3aa..1d6b6c8 100755 --- a/stage0/install-1 +++ b/stage0/install-1 @@ -1,5 +1,4 @@ #!/bin/bash -set -o errtrace # Let shell functions inherit ERR trap. Same as `set -E'. # Reading system configuration informations, functions and package versions. source ../sysinfos diff --git a/stage0/ipkg.def b/stage0/ipkg.def index 2f22bfe..312982d 100644 --- a/stage0/ipkg.def +++ b/stage0/ipkg.def @@ -1,5 +1,7 @@ #!/bin/bash +export BUILD64="-m64" + # Setting default configure options for all scripts CONFIGURE_OPTS="\ --prefix=/cross-tools \ diff --git a/stage0/pkg/binutils b/stage0/pkg/binutils index 922e22c..443714d 100644 --- a/stage0/pkg/binutils +++ b/stage0/pkg/binutils @@ -1,33 +1,36 @@ #!/bin/bash -export AR=ar -export AS=as - -CONFIGURE_OPTS="\ - --host=${CLFS_HOST} \ - --target=${CLFS_TARGET} \ - --with-sysroot=${CLFS} \ - --with-lib-path=/tools/lib \ - --disable-nls \ - --enable-shared \ - --disable-multilib \ - ${CONFIGURE_OPTS}" - hvconfig_pre() { + export AR=ar + export AS=as + + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --host=${CLFS_HOST} \ + --target=${CLFS_TARGET} \ + --with-sysroot=${CLFS} \ + --with-lib-path=/tools/lib \ + --disable-nls \ + --enable-shared \ + --disable-multilib" + case "${HVL_TARGET}" in "x86_64") # This adds 64 bit support to Binutils. CONFIGURE_OPTS="${CONFIGURE_OPTS} --enable-64-bit-bfd" ;; esac - } -hvbuild() +hvconfig_post() { + unset AR + unset AS ${HVMAKE} configure-host - ${HVMAKE} - ${HVMAKE} install +} + +hvbuild_post() +{ cp -v ../${PACKAGE}/include/libiberty.h /tools/include } diff --git a/stage0/pkg/eglibc b/stage0/pkg/eglibc index fe9dfe2..268e0b9 100644 --- a/stage0/pkg/eglibc +++ b/stage0/pkg/eglibc @@ -1,35 +1,24 @@ #!/bin/bash -BUILD_CC="gcc" -CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}" -AR="${CLFS_TARGET}-ar" -RANLIB="${CLFS_TARGET}-ranlib" - -CONFIGURE_OPTS="\ - --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" - -# For Glibc to support NPTL: -hvconfig_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 -} - hvconfig_pre() { + export BUILD_CC="gcc" + export CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}" + export AR="${CLFS_TARGET}-ar" + export RANLIB="${CLFS_TARGET}-ranlib" + + CONFIGURE_OPTS="\ + --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" + case "${HVL_TARGET}" in "x86") CFLAGS="-march=$(cut -d- -f1 <<< ${CLFS_TARGET}) -mtune=native -g -O2" @@ -46,3 +35,23 @@ hvconfig_pre() # Disable linking to libgcc_eh: sed -e 's/-lgcc_eh//g' -i Makeconfig } + +# For Glibc to support NPTL: +hvconfig_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 +} + +hvconfig_post() +{ + unset BUILD_CC + unset CC + unset AR + unset RANLIB + unset CFLAGS +} diff --git a/stage0/pkg/gcc b/stage0/pkg/gcc index 423b932..433e601 100644 --- a/stage0/pkg/gcc +++ b/stage0/pkg/gcc @@ -1,8 +1,5 @@ #!/bin/bash -AR=ar -LDFLAGS="-Wl,-rpath,/cross-tools/lib" - hvpatch() { # Manually applying patches if specified @@ -24,8 +21,12 @@ hvpatch() hvconfig_pre() { + export AR=ar + export LDFLAGS="-Wl,-rpath,/cross-tools/lib" + # Common options for passes 1 & 2 - CONFIGURE_OPTS="${CONFIGURE_OPTS} \ + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ --build=${CLFS_HOST} \ --host=${CLFS_HOST} \ --target=${CLFS_TARGET} \ @@ -33,7 +34,10 @@ hvconfig_pre() --with-local-prefix=/tools \ --disable-nls \ --with-mpfr=/cross-tools \ - --with-gmp=/cross-tools" + --with-gmp=/cross-tools \ + --with-ppl=/cross-tools \ + --with-cloog=/cross-tools \ + --disable-multilib" if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then CONFIGURE_OPTS="${CONFIGURE_OPTS} \ @@ -56,14 +60,6 @@ hvconfig_pre() --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: @@ -83,6 +79,12 @@ hvconfig_pre() fi } +hvconfig_post() +{ + unset AR + unset LDFLAGS +} + hvbuild() { if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then diff --git a/stage0/pkg/ncurses b/stage0/pkg/ncurses index 846af37..52fce24 100644 --- a/stage0/pkg/ncurses +++ b/stage0/pkg/ncurses @@ -1,9 +1,12 @@ #!/bin/bash -CONFIGURE_OPTS="\ - --without-debug \ - --without-shared \ - ${CONFIGURE_OPTS}" +hvconfig_pre() +{ + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --without-debug \ + --without-shared" +} hvbuid() { diff --git a/stage0/stage.def b/stage0/stage.def index 32f39f9..de61a29 100644 --- a/stage0/stage.def +++ b/stage0/stage.def @@ -1,3 +1,3 @@ #!/bin/bash -LFS_STAGE=stage0 +export LFS_STAGE=stage0 diff --git a/stage1/INSTALL b/stage1/INSTALL index 78eff66..4b18f88 100644 --- a/stage1/INSTALL +++ b/stage1/INSTALL @@ -2,17 +2,7 @@ Installation instructions ------------------------- -1. Create your destination partition and make sure that it is - formatted and mounted. - -2. Copy the hvlinux-src directory, containing packages and installation - scripts, anywhere in your LFS partition (usually in root directory). - If installing from a CD-ROM, mount it under your LFS partition. - -3. Modify the 'sysinfos' configuration file to reflect your - system configuration. - -4. Launch './stage1-install' +1. Launch './install-1' Post-install guide ------------------ diff --git a/stage1/install-2 b/stage1/install-2 index 4dfe6e7..d2d11c7 100755 --- a/stage1/install-2 +++ b/stage1/install-2 @@ -11,13 +11,6 @@ source ../packages-list init_log_file # Building temporary system -export CC="${CLFS_TARGET}-gcc" -export CXX="${CLFS_TARGET}-g++" -export AR="${CLFS_TARGET}-ar" -export AS="${CLFS_TARGET}-as" -export RANLIB="${CLFS_TARGET}-ranlib" -export LD="${CLFS_TARGET}-ld" -export STRIP="${CLFS_TARGET}-strip" HOST_CC=gcc CPPFLAGS=-fexceptions \ ipkg ${GMP} "--enable-cxx" @@ -52,7 +45,7 @@ ipkg ${FINDUTILS} ipkg ${FILE_PKG} ipkg ${FLEX} ipkg ${GAWK} -ipkg ${GETTEXT} "--disable-shared" +ipkg ${GETTEXT} ipkg ${GREP} "\ --disable-perl-regexp \ --without-included-regex" diff --git a/stage1/ipkg.def b/stage1/ipkg.def index 7545a87..46cd0ba 100644 --- a/stage1/ipkg.def +++ b/stage1/ipkg.def @@ -7,5 +7,10 @@ CONFIGURE_OPTS="\ --host=${CLFS_TARGET} \ ${CONFIGURE_OPTS}" -CC="${CC} ${CLFS_BUILDFLAGS}" -CXX="${CXX} ${CLFS_BUILDFLAGS}" +export CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}" +export CXX="${CLFS_TARGET}-g++ ${CLFS_BUILDFLAGS}" +export AR="${CLFS_TARGET}-ar" +export AS="${CLFS_TARGET}-as" +export RANLIB="${CLFS_TARGET}-ranlib" +export LD="${CLFS_TARGET}-ld" +export STRIP="${CLFS_TARGET}-strip" diff --git a/stage1/pkg/binutils b/stage1/pkg/binutils index cc0ae1b..9ea2aad 100644 --- a/stage1/pkg/binutils +++ b/stage1/pkg/binutils @@ -1,15 +1,15 @@ #!/bin/bash -CONFIGURE_OPTS="\ - ${CONFIGURE_OPTS} \ - --target=${CLFS_TARGET} \ - --with-lib-path=/tools/lib \ - --disable-nls \ - --enable-shared \ - --disable-multilib" - hvconfig_pre() { + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --target=${CLFS_TARGET} \ + --with-lib-path=/tools/lib \ + --disable-nls \ + --enable-shared \ + --disable-multilib" + case "${HVL_TARGET}" in "x86_64") # This adds 64 bit support to Binutils. @@ -18,9 +18,7 @@ hvconfig_pre() esac } -hvbuild() +hvconfig_post() { ${HVMAKE} configure-host - ${HVMAKE} - ${HVMAKE} install } diff --git a/stage1/pkg/coreutils b/stage1/pkg/coreutils index d454d93..2895591 100644 --- a/stage1/pkg/coreutils +++ b/stage1/pkg/coreutils @@ -1,5 +1,11 @@ #!/bin/bash +hvconfig_pre() +{ + # Fix a bug when the uname patch is automatically applied + touch ${LFS_TMP}/${PACKAGE}/man/{uname,hostname}.1 +} + # 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: @@ -10,9 +16,3 @@ fu_cv_sys_stat_statfs2_bsize=yes gl_cv_func_working_mkstemp=yes EOF } - -hvconfig_pre() -{ - # Fix a bug when the uname patch is automatically applied - touch ${LFS_TMP}/${PACKAGE}/man/{uname,hostname}.1 -} diff --git a/stage1/pkg/e2fsprogs b/stage1/pkg/e2fsprogs index 49f5977..df03725 100644 --- a/stage1/pkg/e2fsprogs +++ b/stage1/pkg/e2fsprogs @@ -1,17 +1,24 @@ #!/bin/bash -CC="${CC} ${CLFS_BUILDFLAGS}" -PKG_CONFIG=true +hvconfig_pre() +{ + export PKG_CONFIG=true + + CONFIGURE_OPTS="\ + --prefix=/tools \ + --enable-elf-shlibs \ + --with-linker=${LD} \ + --host=${CLFS_TARGET} \ + --disable-libblkid \ + --disable-libuuid \ + --disable-fsck \ + --disable-uuidd" +} -CONFIGURE_OPTS="\ - --prefix=/tools \ - --enable-elf-shlibs \ - --with-linker=${LD} \ - --host=${CLFS_TARGET} \ - --disable-libblkid \ - --disable-libuuid \ - --disable-fsck \ - --disable-uuidd" +hvconfig_post() +{ + unset PKG_CONFIG +} hvbuild() { diff --git a/stage1/pkg/flex b/stage1/pkg/flex index 0d60fdc..63c19d8 100644 --- a/stage1/pkg/flex +++ b/stage1/pkg/flex @@ -1,5 +1,11 @@ #!/bin/bash +hvconfig_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 +} + # When Cross Compiling the configure script does not determine the correct # values for the following, Set the values manually: hvconfig_cache() @@ -9,9 +15,3 @@ ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes EOF } - -hvconfig_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 -} diff --git a/stage1/pkg/gcc b/stage1/pkg/gcc index eccf480..2a2c2ea 100644 --- a/stage1/pkg/gcc +++ b/stage1/pkg/gcc @@ -1,20 +1,5 @@ #!/bin/bash -CONFIGURE_OPTS="\ - ${CONFIGURE_OPTS} \ - --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++" - hvpatch() { # Manually applying patches if specified @@ -36,6 +21,21 @@ hvpatch() hvconfig_pre() { + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --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++" + cd ${LFS_TMP}/${PACKAGE} # Change the StartFile Spec to point to the correct library location: diff --git a/stage1/pkg/gettext b/stage1/pkg/gettext index 7bcd57a..afe372d 100644 --- a/stage1/pkg/gettext +++ b/stage1/pkg/gettext @@ -1,10 +1,11 @@ #!/bin/bash -CONFIGURE_OPTS="\ - --prefix=/tools \ - --build=${CLFS_HOST} \ - --host=${CLFS_TARGET} \ - ${CONFIGURE_OPTS}" +hvconfig_pre() +{ + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --disable-shared" +} # When cross-compiling the Gettext configure script assumes we don't have a # working wcwidth when we do. The following will fix possible compilation @@ -19,12 +20,7 @@ EOF hvconfig() { cd ${LFS_TMP}/${PACKAGE}/gettext-tools - - echo "Running configure with options:" - echo " <${CONFIGURE_OPTS}>" - - CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \ - ./configure ${CONFIGURE_OPTS} + ./configure ${CONFIGURE_OPTS} } hvbuild() diff --git a/stage1/pkg/m4 b/stage1/pkg/m4 index d3ef530..9319388 100644 --- a/stage1/pkg/m4 +++ b/stage1/pkg/m4 @@ -1,5 +1,11 @@ #!/bin/bash +hvconfig_pre() +{ + # Add a missing include statement into one of the source files: + sed -e '/"m4.h"/i\#include ' -i ${LFS_TMP}/${PACKAGE}/src/path.c +} + # Configure can not properly determine the results of the following tests: hvconfig_cache() { @@ -14,9 +20,3 @@ gl_cv_func_wcrtomb_retval=yes gl_cv_func_wctob_works=yes EOF } - -hvconfig_pre() -{ - # Add a missing include statement into one of the source files: - sed -e '/"m4.h"/i\#include ' -i ${LFS_TMP}/${PACKAGE}/src/path.c -} diff --git a/stage1/pkg/module-init-tools b/stage1/pkg/module-init-tools index d05c66f..c3fea6a 100644 --- a/stage1/pkg/module-init-tools +++ b/stage1/pkg/module-init-tools @@ -1,13 +1,14 @@ #!/bin/bash -CC="${CC} ${CLFS_BUILDFLAGS}" - -CONFIGURE_OPTS="\ - --prefix=/ \ - --bindir=/bin \ - --sbindir=/sbin \ - --build=${CLFS_HOST} \ - --host=${CLFS_TARGET}" +hvconfig_pre() +{ + CONFIGURE_OPTS="\ + --prefix=/ \ + --bindir=/bin \ + --sbindir=/sbin \ + --build=${CLFS_HOST} \ + --host=${CLFS_TARGET}" +} hvbuild() { diff --git a/stage1/pkg/sysvinit b/stage1/pkg/sysvinit index 0716d41..a8a546c 100644 --- a/stage1/pkg/sysvinit +++ b/stage1/pkg/sysvinit @@ -11,7 +11,7 @@ hvbuild() -i src/Makefile make -C src clobber - make -C src CC="${CC} ${CLFS_BUILDFLAGS}" + make -C src CC="${CC} ${BUILD64}" make -C src install INSTALL=install ROOT=${LFS} install -m644 ${SCRDIR}/misc/inittab ${LFS}/etc diff --git a/stage1/pkg/udev b/stage1/pkg/udev index 3dc3776..d120b14 100644 --- a/stage1/pkg/udev +++ b/stage1/pkg/udev @@ -1,20 +1,18 @@ #!/bin/bash -CC="${CC} ${CLFS_BUILDFLAGS}" - -CONFIGURE_OPTS="\ - --prefix=/usr \ - --build=${CLFS_HOST} \ - --host=${CLFS_TARGET} \ - --exec-prefix="" \ - --sysconfdir=/etc \ - --libexecdir=/lib/udev \ - --libdir=/usr/lib \ - --disable-extras \ - --disable-introspection" - hvconfig_pre() { + CONFIGURE_OPTS="\ + --prefix=/usr \ + --build=${CLFS_HOST} \ + --host=${CLFS_TARGET} \ + --exec-prefix="" \ + --sysconfdir=/etc \ + --libexecdir=/lib/udev \ + --libdir=/usr/lib \ + --disable-extras \ + --disable-introspection" + cd ${LFS_TMP}/${PACKAGE} install -dv ${LFS}/lib/{firmware,udev/devices/{pts,shm}} } diff --git a/stage1/pkg/util-linux-ng b/stage1/pkg/util-linux-ng index ad66e53..079a343 100644 --- a/stage1/pkg/util-linux-ng +++ b/stage1/pkg/util-linux-ng @@ -1,13 +1,13 @@ #!/bin/bash -CC="${CC} ${CLFS_BUILDFLAGS}" -CXX="${CXX} ${CLFS_BUILDFLAGS}" - -CONFIGURE_OPTS="\ - --build=${CLFS_HOST} \ - --host=${CLFS_TARGET} \ - --enable-login-utils \ - --disable-makeinstall-chown" +hvconfig_pre() +{ + CONFIGURE_OPTS="\ + --build=${CLFS_HOST} \ + --host=${CLFS_TARGET} \ + --enable-login-utils \ + --disable-makeinstall-chown" +} hvbuild() { diff --git a/stage1/pkg/zlib b/stage1/pkg/zlib index a1da1ca..82e58f5 100644 --- a/stage1/pkg/zlib +++ b/stage1/pkg/zlib @@ -1,6 +1,7 @@ #!/bin/bash -CC="${CC} ${CLFS_BUILDFLAGS}" - -CONFIGURE_OPTS="\ +hvconfig_pre() +{ + CONFIGURE_OPTS="\ --prefix=/tools" +} diff --git a/stage1/stage.def b/stage1/stage.def index 7c4ff90..9d0af52 100644 --- a/stage1/stage.def +++ b/stage1/stage.def @@ -1,3 +1,3 @@ #!/bin/bash -LFS_STAGE=stage1 +export LFS_STAGE=stage1 diff --git a/stage2/INSTALL b/stage2/INSTALL index b3d9e44..ec32eea 100644 --- a/stage2/INSTALL +++ b/stage2/INSTALL @@ -30,7 +30,7 @@ Note: In this example, the destination partition is /dev/hda6, and under ${LFS}/boot. 8. Launch the installation of stage 2: - >$ /mnt/linux/mnt/hvlinux/scripts/stage2/stage2-install + >$ /mnt/linux/mnt/hvlinux/scripts/stage2/install-1 9. After that, compile a fresh kernel. diff --git a/stage2/install-1 b/stage2/install-1 index abc1b9b..61b542c 100755 --- a/stage2/install-1 +++ b/stage2/install-1 @@ -38,7 +38,7 @@ unset CC unset CXX unset LDFLAGS -ipkg ${ZLIB} +ipkg -m acnb ${ZLIB} ipkg ${BINUTILS} ipkg ${GCC} rscr mult "Testing toolchain" toolchain-test diff --git a/stage0/ipkg.def b/stage2/ipkg.def similarity index 69% copy from stage0/ipkg.def copy to stage2/ipkg.def index 2f22bfe..135c8da 100644 --- a/stage0/ipkg.def +++ b/stage2/ipkg.def @@ -2,5 +2,6 @@ # Setting default configure options for all scripts CONFIGURE_OPTS="\ - --prefix=/cross-tools \ + --prefix=/usr \ + --sysconfdir=/etc \ ${CONFIGURE_OPTS}" diff --git a/stage2/ipkg.sh b/stage2/ipkg.sh deleted file mode 100755 index 41f028d..0000000 --- a/stage2/ipkg.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/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 - -# Setting default configure options for all scripts -CONFIGURE_OPTS="\ - --prefix=/usr \ - --sysconfdir=/etc \ - ${CONFIGURE_OPTS}" - -source ${SCRDIR}/../functions-ac - -ldconfig - -exit $? diff --git a/stage2/pkg/binutils b/stage2/pkg/binutils index dabcf14..c9522c1 100644 --- a/stage2/pkg/binutils +++ b/stage2/pkg/binutils @@ -1,16 +1,16 @@ #!/bin/bash -CC="gcc -isystem /usr/include" -LDFLAGS="-Wl,-rpath-link,/lib" - -CONFIGURE_OPTS="\ - --libdir=/usr/lib \ - --enable-shared \ - --disable-multilib \ - ${CONFIGURE_OPTS}" - hvconfig_pre() { + export CC="gcc -isystem /usr/include" + export LDFLAGS="-Wl,-rpath-link,/lib" + + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --libdir=/usr/lib \ + --enable-shared \ + --disable-multilib" + case "${HVL_TARGET}" in "x86_64") # Libiberty uses gcc -print-multi-os-directory to determine where to @@ -26,6 +26,12 @@ hvconfig_pre() esac } +hvconfig_post() +{ + unset CC + unset LDFLAGS +} + hvbuild() { make configure-host diff --git a/stage2/pkg/coreutils b/stage2/pkg/coreutils index b60e9e8..80fc9ca 100644 --- a/stage2/pkg/coreutils +++ b/stage2/pkg/coreutils @@ -1,8 +1,11 @@ #!/bin/bash -CONFIGURE_OPTS="\ - --enable-no-install-program=kill,uptime \ - ${CONFIGURE_OPTS}" +hvconfig_pre() +{ + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --enable-no-install-program=kill,uptime" +} hvbuild_post() { diff --git a/stage2/pkg/e2fsprogs b/stage2/pkg/e2fsprogs index 99f7e68..4e6bc37 100644 --- a/stage2/pkg/e2fsprogs +++ b/stage2/pkg/e2fsprogs @@ -1,15 +1,23 @@ #!/bin/bash -PKG_CONFIG=true +hvconfig_pre() +{ + export PKG_CONFIG=true + + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --with-root-prefix="" \ + --enable-elf-shlibs \ + --disable-libblkid \ + --disable-libuuid \ + --disable-fsck \ + --disable-uuidd" +} -CONFIGURE_OPTS="\ - --with-root-prefix="" \ - --enable-elf-shlibs \ - --disable-libblkid \ - --disable-libuuid \ - --disable-fsck \ - --disable-uuidd \ - ${CONFIGURE_OPTS}" +hvconfig_post() +{ + unset PKG_CONFIG +} hvbuild_post() { diff --git a/stage2/pkg/eglibc b/stage2/pkg/eglibc index a4ebe94..d53de20 100644 --- a/stage2/pkg/eglibc +++ b/stage2/pkg/eglibc @@ -2,14 +2,14 @@ hvconfig_pre() { - CFLAGS="-mtune=generic -g -O2" + export CFLAGS="-mtune=generic -g -O2" CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ --disable-profile \ --enable-add-ons \ --enable-kernel=$(get_pkg_ver ${KERNEL}) \ - --libexecdir=/usr/lib/eglibc \ - ${CONFIGURE_OPTS}" + --libexecdir=/usr/lib/eglibc" case "${HVL_TARGET}" in "x86") @@ -39,6 +39,11 @@ hvconfig_pre() esac } +hvconfig_post() +{ + unset CFLAGS +} + hvbuild() { make diff --git a/stage2/pkg/findutils b/stage2/pkg/findutils index 4bdfba7..fcb4b36 100755 --- a/stage2/pkg/findutils +++ b/stage2/pkg/findutils @@ -1,9 +1,12 @@ #!/bin/bash -CONFIGURE_OPTS="\ - --libexecdir=/usr/lib/findutils \ - --localstatedir=/var/lib/locate \ - ${CONFIGURE_OPTS}" +hvconfig_pre() +{ + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --libexecdir=/usr/lib/findutils \ + --localstatedir=/var/lib/locate" +} hvbuild_post() { diff --git a/stage2/pkg/gcc b/stage2/pkg/gcc index c73c30d..865f6cd 100644 --- a/stage2/pkg/gcc +++ b/stage2/pkg/gcc @@ -1,20 +1,27 @@ #!/bin/bash -CC="gcc -Wl,-rpath-link,/lib -isystem /usr/include" -CXX="g++ -Wl,-rpath-link,/lib -isystem /usr/include" +hvconfig_pre() +{ + export CC="gcc -Wl,-rpath-link,/lib -isystem /usr/include" + export CXX="g++ -Wl,-rpath-link,/lib -isystem /usr/include" -CONFIGURE_OPTS="\ - --libexecdir=/usr/lib \ - --enable-shared \ - --enable-threads=posix \ - --enable-__cxa_atexit \ - --enable-c99 \ - --enable-long-long \ - --enable-clocale=gnu \ - --enable-languages=c,c++ \ - --disable-multilib \ - --disable-libstdcxx-pch \ - ${CONFIGURE_OPTS}" + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --libexecdir=/usr/lib \ + --enable-shared \ + --enable-threads=posix \ + --enable-__cxa_atexit \ + --enable-c99 \ + --enable-long-long \ + --enable-clocale=gnu \ + --enable-languages=c,c++ \ + --disable-multilib \ + --disable-libstdcxx-pch" + + # Applying a sed substitution that will suppress the installation of + # libiberty.a. We want to use the Binutils version of libiberty.a + sed -i 's/install_to_$(INSTALL_DEST) //' ${LFS_TMP}/${PACKAGE}/libiberty/Makefile.in +} hvpatch() { @@ -33,11 +40,10 @@ hvpatch() esac } -hvconfig_pre() +hvconfig_post() { - # Applying a sed substitution that will suppress the installation of - # libiberty.a. We want to use the Binutils version of libiberty.a - sed -i 's/install_to_$(INSTALL_DEST) //' ${LFS_TMP}/${PACKAGE}/libiberty/Makefile.in + unset CC + unset CXX } hvbuild_post() diff --git a/stage2/pkg/groff b/stage2/pkg/groff index 9c4a6a2..2f052fb 100755 --- a/stage2/pkg/groff +++ b/stage2/pkg/groff @@ -1,12 +1,20 @@ #!/bin/bash -PAGE=letter +# Groff does not like to be made in parallel??? -CONFIGURE_OPTS="\ - --enable-multibyte - ${CONFIGURE_OPTS}" +hvconfig_pre() +{ + export PAGE=letter + + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --enable-multibyte" +} -# Groff does not like to be made in parallel. +hvconfig_post() +{ + unset PAGE +} hvbuild_post() { diff --git a/stage2/pkg/gzip b/stage2/pkg/gzip index fa9a1cf..341a13f 100755 --- a/stage2/pkg/gzip +++ b/stage2/pkg/gzip @@ -1,8 +1,11 @@ #!/bin/bash -CONFIGURE_OPTS="\ - --bindir=/bin - ${CONFIGURE_OPTS}" +hvconfig_pre() +{ + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --bindir=/bin" +} hvbuild_post() { diff --git a/stage2/pkg/inetutils b/stage2/pkg/inetutils index b1ad3c1..5d9b3f2 100755 --- a/stage2/pkg/inetutils +++ b/stage2/pkg/inetutils @@ -1,13 +1,16 @@ #!/bin/bash -CONFIGURE_OPTS="\ - --libexecdir=/usr/sbin \ - --localstatedir=/var \ - --disable-ifconfig \ - --disable-logger \ - --disable-syslogd \ - --disable-whois \ - --disable-servers" +hvconfig_pre() +{ + CONFIGURE_OPTS="\ + --libexecdir=/usr/sbin \ + --localstatedir=/var \ + --disable-ifconfig \ + --disable-logger \ + --disable-syslogd \ + --disable-whois \ + --disable-servers" +} hvbuild_post() { diff --git a/stage2/pkg/kbd b/stage2/pkg/kbd index 060a57c..9e4dc22 100755 --- a/stage2/pkg/kbd +++ b/stage2/pkg/kbd @@ -1,11 +1,11 @@ #!/bin/bash -# --datadir=/lib/kbd -# This option puts keyboard layout data in a directory that will -# always be on the root partition instead of the default /usr/share/kbd -CONFIGURE_OPTS="\ - --datadir=/lib/kbd - ${CONFIGURE_OPTS}" +hvconfig_pre() +{ + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --datadir=/lib/kbd" +} hvbuild_post() { diff --git a/stage2/pkg/module-init-tools b/stage2/pkg/module-init-tools index 44a2aa6..08d6a25 100755 --- a/stage2/pkg/module-init-tools +++ b/stage2/pkg/module-init-tools @@ -1,10 +1,13 @@ #!/bin/bash -# --enable-zlib-dynamic: To handle compressed kernel modules. -CONFIGURE_OPTS="\ - --enable-zlib-dynamic \ - --mandir=/usr/share/man \ - ${CONFIGURE_OPTS}" +hvconfig_pre() +{ + # --enable-zlib-dynamic: To handle compressed kernel modules. + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --enable-zlib-dynamic \ + --mandir=/usr/share/man" +} hvbuild() { @@ -19,7 +22,5 @@ hvbuild() hvbuild_post() { - cat > /etc/modprobe.conf << "EOF" -# modprobe.conf -EOF + install -dv ${LFS}/etc/modprobe.d } diff --git a/stage2/pkg/ncurses b/stage2/pkg/ncurses index 69433cf..739a4a2 100644 --- a/stage2/pkg/ncurses +++ b/stage2/pkg/ncurses @@ -1,12 +1,15 @@ #!/bin/bash -CONFIGURE_OPTS="\ - --libdir=/lib \ - --with-shared \ - --without-debug \ - --enable-widec \ - --with-manpage-format=normal \ - ${CONFIGURE_OPTS}" +hvconfig_pre() +{ + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --libdir=/lib \ + --with-shared \ + --without-debug \ + --enable-widec \ + --with-manpage-format=normal" +} hvbuild_post() { diff --git a/stage2/pkg/readline b/stage2/pkg/readline index 9097481..03a69d0 100644 --- a/stage2/pkg/readline +++ b/stage2/pkg/readline @@ -1,11 +1,11 @@ #!/bin/bash -CONFIGURE_OPTS="\ - --libdir=/lib - ${CONFIGURE_OPTS}" - hvconfig_pre() { + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --libdir=/lib" + cd ${LFS_TMP}/${PACKAGE} # Reinstalling Readline will cause the old libraries to be moved to diff --git a/stage2/pkg/shadow b/stage2/pkg/shadow index 5dbd099..723f5e7 100755 --- a/stage2/pkg/shadow +++ b/stage2/pkg/shadow @@ -1,11 +1,11 @@ #!/bin/bash -CONFIGURE_OPTS="\ - --without-selinux - ${CONFIGURE_OPTS}" - hvconfig_pre() { + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --without-selinux" + cd ${LFS_TMP}/${PACKAGE} # Disable the installation of the groups program and its man page, as diff --git a/stage2/pkg/util-linux-ng b/stage2/pkg/util-linux-ng index e46e5c3..081181e 100644 --- a/stage2/pkg/util-linux-ng +++ b/stage2/pkg/util-linux-ng @@ -2,6 +2,12 @@ hvconfig_pre() { + CONFIGURE_OPTS="\ + --enable-arch \ + --enable-partx \ + --enable-write \ + --disable-wall" + # The FHS recommends that we use /var/lib/hwclock, instead of the usual # /etc, as the location for the adjtime file. To make the hwclock program # FHS-compliant, run the following: @@ -9,17 +15,6 @@ hvconfig_pre() mkdir -pv /var/lib/hwclock } -hvconfig() -{ - cd ${LFS_TMP}/${PACKAGE} - - ./configure \ - --enable-arch \ - --enable-partx \ - --enable-write \ - --disable-wall -} - hvbuild_post() { # Move the logger binary to /bin as it is needed by the CLFS-Bootscripts package: diff --git a/stage2/pkg/zlib b/stage2/pkg/zlib index 0106d36..1b4a57b 100644 --- a/stage2/pkg/zlib +++ b/stage2/pkg/zlib @@ -1,17 +1,21 @@ #!/bin/bash -CC="gcc -isystem /usr/include" -CXX="g++ -isystem /usr/include" -LDFLAGS="-Wl,-rpath-link,/lib" +hvconfig_pre() +{ + export CC="gcc -isystem /usr/include" + export CXX="g++ -isystem /usr/include" + export LDFLAGS="-Wl,-rpath-link,/lib" -CONFIGURE_OPTS="\ - --shared \ - ${CONFIGURE_OPTS}" + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --shared" +} -hvconfig() +hvconfig_post() { - cd ${LFS_TMP}/${PACKAGE} - ./configure ${CONFIGURE_OPTS} + unset CC + unset CXX + unset LDFLAGS } hvbuild_post() diff --git a/stage2/stage.def b/stage2/stage.def index 6f7260f..1664849 100644 --- a/stage2/stage.def +++ b/stage2/stage.def @@ -1,3 +1,3 @@ #!/bin/bash -LFS_STAGE=stage2 +export LFS_STAGE=stage2 -- 2.20.1