From: gobo72 Date: Tue, 2 Nov 2010 00:04:35 +0000 (+0000) Subject: Added support for pre/post configure and build functions and automatic config.cache... X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=0fa81f8a4a562821caa5aa763597d9d1de4984e5;p=hvlinux.git Added support for pre/post configure and build functions and automatic config.cache files --- diff --git a/functions b/functions index 3ca8396..10c5693 100644 --- a/functions +++ b/functions @@ -70,6 +70,17 @@ export CLFS_BUILDFLAGS CLFS_TARGET CLFS_ARCH CLFS_HOST CLFS_ENDIAN CLFS_NOT_ENDI CLFS=${LFS} +function function_exists +{ + local FUNCTION_NAME=$1 + + [ -z "$FUNCTION_NAME" ] && return 1 + + declare -F "$FUNCTION_NAME" > /dev/null 2>&1 + + return $? +} + # Extracting the version number from a complete package name. # Arg. #1: Complete package name with version (ex: firefox-3.5.5.source will output 3.5.5) get_pkg_ver() @@ -714,6 +725,12 @@ ipkg() 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 @@ -788,6 +805,7 @@ ipkg() } # Installation of a package, removing source and build directories after. +# Try to merge this function with static_ipkg()??? # # First argument: package name # Second argument: script name @@ -803,8 +821,8 @@ ipkg_cust() fi local PACKAGE=${1} - local CUSTOM_SCRIPT=${2} local LABEL=${PACKAGE} + local CUSTOM_SCRIPT=${2} shift shift local CONFIGURE_OPTS=${*} @@ -812,28 +830,44 @@ ipkg_cust() ipkg ${PACKAGE} ${CUSTOM_SCRIPT} ${LABEL} ${CONFIGURE_OPTS} } -# Installation of a package conforming to GNU autotools. -# The package must be able to be built outside the -# source directory. +# Static function called by: +# ipkg_ac +# ipkg_ac_nb +# ipkg_gnome # -# First argument: package name +# First argument: script name +# Second argument: package name # Remaining arguments: additional configure options -ipkg_ac() +static_ipkg() { # Checking for correct number of arguments - if [ $# -lt 1 ]; then + if [ $# -lt 2 ]; then echo echo "${FUNCNAME}(): Wrong number of arguments" echo " command was: \"${FUNCNAME}() $*\"" exit ${EXIT_FAILURE} fi - local PACKAGE=${1} + local SCRIPT=${1} + local PACKAGE=${2} local LABEL=${PACKAGE} shift + shift local CONFIGURE_OPTS=${*} - ipkg ${PACKAGE} cis-ac ${LABEL} ${CONFIGURE_OPTS} + ipkg ${PACKAGE} ${SCRIPT} ${LABEL} ${CONFIGURE_OPTS} +} + + +# Installation of a package conforming to GNU autotools. +# The package must be able to be built outside the +# source directory. +# +# First argument: package name +# Remaining arguments: additional configure options +ipkg_ac() +{ + static_ipkg cis-ac ${*} } # Installation of a package conforming to GNU autotools, @@ -843,20 +877,7 @@ ipkg_ac() # Remaining arguments: additional configure options ipkg_ac_nb() { - # Checking for correct number of arguments - if [ $# -lt 1 ]; then - echo - echo "${FUNCNAME}(): Wrong number of arguments" - echo " command was: \"${FUNCNAME}() $*\"" - exit ${EXIT_FAILURE} - fi - - local PACKAGE=${1} - local LABEL=${PACKAGE} - shift - local CONFIGURE_OPTS=${*} - - ipkg ${PACKAGE} cis-ac-nobuild ${LABEL} ${CONFIGURE_OPTS} + static_ipkg cis-ac-nobuild ${*} } # Installation of a GNOME package. @@ -865,20 +886,7 @@ ipkg_ac_nb() # Remaining arguments: additional configure options ipkg_gnome() { - # Checking for correct number of arguments - if [ $# -ne 1 ]; then - echo - echo "${FUNCNAME}(): Wrong number of arguments" - echo " command was: \"${FUNCNAME}() $*\"" - exit ${EXIT_FAILURE} - fi - - local PACKAGE=${1} - local LABEL=${PACKAGE} - shift - local CONFIGURE_OPTS=${*} - - ipkg ${PACKAGE} cis-gnome ${LABEL} ${CONFIGURE_OPTS} + static_ipkg cis-gnome ${*} } # Installation of a PERL module diff --git a/packages-list b/packages-list index ad511bb..475eaee 100644 --- a/packages-list +++ b/packages-list @@ -21,9 +21,9 @@ AUTOCONF="autoconf-2.65" AUTOMAKE="automake-1.11.1" BABL="babl-0.1.2" -BASH="bash-4.0" +BASH="bash-4.1" BC="bc-1.06" -BISON="bison-2.4.1" +BISON="bison-2.4.2" BIND="bind-9.6.1-P3" BINUTILS="binutils-2.20.1" ARM_BINUTILS=${BINUTILS} @@ -39,7 +39,7 @@ CKERMIT="ckermit-8.0.211" CLAMAV="clamav-0.93.3" CLOOG_PPL="cloog-ppl-0.15.9" CONSOLEKIT="ConsoleKit-0.4.1" -COREUTILS="coreutils-7.6" +COREUTILS="coreutils-8.5" CPIO="cpio-2.9" CUPS="cups-1.4.2" CUPS_PDF="cups-pdf-2.5.0" @@ -52,7 +52,7 @@ DDCLIENT="ddclient-3.6.7" DEJAGNU="dejagnu-1.4.4" DESKTOP_FILE_UTILS="desktop-file-utils-0.15" DHCP="dhcp-3.0.6" -DIFFUTILS="diffutils-2.8.7" +DIFFUTILS="diffutils-3.0" DOCBOOK_DSSSL_VER="1.79" DOCBOOK_DSSSL="docbook-dsssl-${DOCBOOK_DSSSL_VER}" DOCBOOK_UTILS="docbook-utils-0.6.14" @@ -65,7 +65,7 @@ DOSFSTOOLS="dosfstools-3.0.9" DVDFS="dvdfs-0.2" DVDRWTOOLS="dvd+rw-tools-7.1" -E2FSPROGS="e2fsprogs-1.41.9" +E2FSPROGS="e2fsprogs-1.41.12" EASYTAG="easytag-2.1" ED="ed-1.4" EGGDBUS="eggdbus-0.6" @@ -89,7 +89,7 @@ FREETYPE="freetype-2.3.11" FRIBIDI="fribidi-0.10.9" FUSE="fuse-2.8.3" -GAWK="gawk-3.1.7" +GAWK="gawk-3.1.8" GC="gc6.8" GCC="gcc-4.5.1" # Specify bug-fixing patches manually @@ -105,7 +105,7 @@ GEDA_SYMCHECK="geda-gsymcheck-1.2.0" GEDA_GATTRIB="geda-gattrib-1.2.0" GEGL="gegl-0.1.2" GETDATE="getdate_rfc868-1.2" -GETTEXT="gettext-0.17" +GETTEXT="gettext-0.18.1.1" GHOSTSCRIPT="ghostscript-8.71" GHOSTSCRIPT_FONTS_STD="ghostscript-fonts-std-8.11" GHOSTSCRIPT_FONTS_OTHER="ghostscript-fonts-other-6.0" @@ -191,7 +191,7 @@ GOBJECT_INSTROSPECTION="gobject-introspection-0.6.5" GOFFICE="goffice-0.2.2" GNUMERIC="gnumeric-1.6.3" GNUPG="gnupg-1.4.9" -GREP="grep-2.5.4" +GREP="grep-2.6.3" GRIP="grip-3.3.1" GROFF="groff-1.20.1" GRUB="grub-0.97" @@ -207,7 +207,7 @@ GTK_DOC="gtk-doc-1.12" GTK_ENGINES="gtk-engines-2.18.5" GTKMM="gtkmm-2.18.2" GUILE="guile-1.8.7" -GZIP="gzip-1.3.12" +GZIP="gzip-1.4" HAL="hal-0.5.14" HAL_INFO="hal-info-20091130" @@ -293,14 +293,14 @@ LILYPOND="lilypond-2.12.3" LTSP_UTILS="ltsp-utils-0.25-0" MAILMAN="mailman-2.1.8" -MAKE_PACKAGE="make-3.81" +MAKE_PACKAGE="make-3.82" MAN_DB="man-db-2.5.6" MANPAGES="man-pages-3.23" METACITY="metacity-2.18.5" -MFOUR="m4-1.4.13" +MFOUR="m4-1.4.14" MILTER_GREYLIST="milter-greylist-4.0" MILTER_SPF="smf-spf-2.0.1" -MODULE_INIT_TOOLS="module-init-tools-3.11.1" +MODULE_INIT_TOOLS="module-init-tools-3.12" MPC="mpc-0.8.2" MPFR="mpfr-3.0.0" MUTT="mutt-1.5.20" @@ -326,7 +326,7 @@ PAM="Linux-PAM-1.1.0" PANGO="pango-1.26.2" PANGOMM="pangomm-2.26.0" PARTED="parted-1.9.0" -PATCH_PACKAGE="patch-2.5.9" +PATCH_PACKAGE="patch-2.6" PCIUTILS="pciutils-3.1.4" PCMANFM="pcmanfm-0.5" PCRE="pcre-8.00" @@ -401,7 +401,7 @@ SYSVINIT="sysvinit-2.86" T1LIB="t1lib-5.1.2" TANGO_ICON_THEME="tango-icon-theme-0.8.90" TANGO_ICON_THEME_EXTRAS="tango-icon-theme-extras-0.1.0" -TAR_PACKAGE="tar-1.22" +TAR_PACKAGE="tar-1.23" TCPDUMP="tcpdump-4.0.0" TCL="tcl8.5.8-src" TCPWRAPPERS="tcp_wrappers_7.6" @@ -415,14 +415,14 @@ TIFF="tiff-3.8.2" TK="tk8.5.8-src" TRANSMISSION="transmission-1.34" -UDEV="udev-151" +UDEV="udev-160" UDEV_CONFIG="udev-config-20100128" UML_UTILITIES="uml_utilities_20070815" UNRAR="unrar-3.7.8" UNZIP="unzip-5.52" UPSTART="upstart-0.6.3" USBUTILS="usbutils-0.86" -UTIL_LINUX_NG="util-linux-ng-2.16.1" +UTIL_LINUX_NG="util-linux-ng-2.18" UW_IMAP="imap-2004g" VORBIS_TOOLS="vorbis-tools-1.1.1" @@ -461,4 +461,4 @@ YELP="yelp-2.28.0" ZIP="zip-3.0" -ZLIB="zlib-1.2.3" +ZLIB="zlib-1.2.5" diff --git a/stage0/cis-cloog-ppl b/stage0/cis-cloog-ppl index 66d2946..e4bad6d 100755 --- a/stage0/cis-cloog-ppl +++ b/stage0/cis-cloog-ppl @@ -18,9 +18,7 @@ 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: -cd ${LFS_TMP}/${PACKAGE} -cp -v configure{,.orig} -sed "/LD_LIBRARY_PATH=/d" configure.orig > configure +sed -e "/LD_LIBRARY_PATH=/d" -i ${LFS_TMP}/${PACKAGE}/configure cd ${LFS_TMP}/${PACKAGE}-build ../${PACKAGE}/configure \ diff --git a/stage0/install-1 b/stage0/install-1 index 3207709..4b7a85a 100755 --- a/stage0/install-1 +++ b/stage0/install-1 @@ -21,31 +21,36 @@ ipkg_cust ${KERNEL} cis-linux-api-headers case "${HVL_TARGET}" in x86*) ipkg_ac ${FILE_PKG} - ipkg_cust ${NCURSES} cis-ncurses "--without-debug --without-shared" + ipkg_cust ${NCURSES} cis-ncurses "\ + --without-debug \ + --without-shared" ;; esac CPPFLAGS=-fexceptions \ ipkg_ac ${GMP} "--enable-cxx" -LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ - ipkg_ac ${MPFR} "--enable-shared --with-gmp=/cross-tools" - -LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ - ipkg_ac ${MPC} "--enable-shared \ - --with-gmp=/cross-tools \ - --with-mpfr=/cross-tools" - -LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ - ipkg_ac ${PPL} "--enable-shared \ - --enable-interfaces=c,cxx \ - --disable-optimization \ - --with-libgmp-prefix=/cross-tools \ - --with-libgmpxx-prefix=/cross-tools" - -LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ - ipkg_cust ${CLOOG_PPL} cis-cloog-ppl "--enable-shared --with-bits=gmp \ - --with-gmp=/cross-tools --with-ppl=/cross-tools" +export LDFLAGS="-Wl,-rpath,/cross-tools/lib" + +ipkg_ac ${MPFR} "\ + --enable-shared \ + --with-gmp=/cross-tools" +ipkg_ac ${MPC} "\ + --with-gmp=/cross-tools \ + --with-mpfr=/cross-tools" +ipkg_ac ${PPL} "\ + --enable-shared \ + --enable-interfaces=c,cxx \ + --disable-optimization \ + --with-libgmp-prefix=/cross-tools \ + --with-libgmpxx-prefix=/cross-tools" +ipkg_cust ${CLOOG_PPL} cis-cloog-ppl "\ + --enable-shared \ + --with-bits=gmp \ + --with-gmp=/cross-tools \ + --with-ppl=/cross-tools" + +LDFLAGS="" ipkg_cust ${BINUTILS} cis-binutils ipkg ${GCC} cis-gcc-pass1 "${GCC}-pass1" diff --git a/stage1/build.bash b/stage1/build.bash new file mode 100755 index 0000000..520600d --- /dev/null +++ b/stage1/build.bash @@ -0,0 +1,9 @@ +#!/bin/bash + +build_custom() +{ + ${HVMAKE} + ${HVMAKE} install + + ln -svfT bash /tools/bin/sh +} diff --git a/stage1/build.binutils b/stage1/build.binutils new file mode 100755 index 0000000..2c97380 --- /dev/null +++ b/stage1/build.binutils @@ -0,0 +1,8 @@ +#!/bin/bash + +build_custom() +{ + ${HVMAKE} configure-host + ${HVMAKE} + ${HVMAKE} install +} diff --git a/stage1/build.ppl b/stage1/build.ppl new file mode 100644 index 0000000..d956d1d --- /dev/null +++ b/stage1/build.ppl @@ -0,0 +1,12 @@ +#!/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 +} diff --git a/stage1/build.texinfo b/stage1/build.texinfo new file mode 100755 index 0000000..7dce23f --- /dev/null +++ b/stage1/build.texinfo @@ -0,0 +1,9 @@ +#!/bin/bash + +build_custom() +{ + ${HVMAKE} -C tools/gnulib/lib + ${HVMAKE} -C tools + ${HVMAKE} + ${HVMAKE} install +} diff --git a/stage1/cis-ac-nobuild b/stage1/cis-ac-nobuild new file mode 100755 index 0000000..475733b --- /dev/null +++ b/stage1/cis-ac-nobuild @@ -0,0 +1,30 @@ +#!/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 $? diff --git a/stage1/cis-bash b/stage1/cis-bash deleted file mode 100755 index cac852b..0000000 --- a/stage1/cis-bash +++ /dev/null @@ -1,46 +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 ../sysinfos -source ../functions -source ../packages-list - -# Applying patches (if any) -apply_patches ${PACKAGE} - -cd ${LFS_TMP}/${PACKAGE}-build - -# 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: -cat > 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 - -${SCRDIR}/cis-common ${PACKAGE} "${CONFIGURE_OPTS} --without-bash-malloc --cache-file=config.cache" - -ln -svfT bash /tools/bin/sh - -exit $? diff --git a/stage1/cis-binutils b/stage1/cis-binutils deleted file mode 100755 index a7306ae..0000000 --- a/stage1/cis-binutils +++ /dev/null @@ -1,51 +0,0 @@ -#!/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=/tools -# This tells the configure script to prepare to install the package in the /tools directory. -# --host=${CLFS_HOST} -# --target=${CLFS_TARGET} -# Creates a cross-architecture executable that creates files for ${CLFS_TARGET} but runs on ${CLFS_HOST}. -# --with-lib-path=/tools/lib -# 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. -# --enable-64-bit-bfd -# This adds 64 bit support to Binutils. -cd ${LFS_TMP}/${1}-build -CC="${CC} ${CLFS_BUILDFLAGS}" \ - ../${1}/configure \ - --prefix=/tools \ - --build=${CLFS_HOST} \ - --host=${CLFS_TARGET} \ - --target=${CLFS_TARGET} \ - --with-lib-path=/tools/lib \ - --disable-nls \ - --enable-shared \ - --disable-multilib \ - ${TARGET_CONFIGURE_OPTS} -${HVMAKE} configure-host -${HVMAKE} -${HVMAKE} install - -exit $? diff --git a/stage1/cis-bzip2 b/stage1/cis-bzip2 index 619a739..ab48063 100755 --- a/stage1/cis-bzip2 +++ b/stage1/cis-bzip2 @@ -13,8 +13,7 @@ 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: -cp -v Makefile{,.orig} -sed -e 's@^\(all:.*\) test@\1@g' Makefile.orig > Makefile +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}" diff --git a/stage1/cis-common b/stage1/cis-common index 394d28d..3d55ae9 100755 --- a/stage1/cis-common +++ b/stage1/cis-common @@ -13,15 +13,38 @@ 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} -${HVMAKE} -${HVMAKE} install + +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 $? diff --git a/stage1/cis-common2 b/stage1/cis-common2 deleted file mode 100755 index de32d7a..0000000 --- a/stage1/cis-common2 +++ /dev/null @@ -1,24 +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 - -cd ${LFS_TMP}/${PACKAGE}-build - -CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \ - ../${PACKAGE}/configure \ - --build=${CLFS_HOST} \ - --host=${CLFS_TARGET} \ - ${CONFIGURE_OPTS} - -exit $? diff --git a/stage1/cis-coreutils b/stage1/cis-coreutils deleted file mode 100755 index f7a0a27..0000000 --- a/stage1/cis-coreutils +++ /dev/null @@ -1,38 +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 ../sysinfos -source ../functions -source ../packages-list - -# Applying patches (if any) -apply_patches ${PACKAGE} - -# Fix a bug with help2man??? -cd ${LFS_TMP}/${PACKAGE} -touch man/hostname.1 -touch man/uname.1 - -cd ${LFS_TMP}/${PACKAGE}-build - -# 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: -cat > config.cache << EOF -fu_cv_sys_stat_statfs2_bsize=yes -gl_cv_func_rename_trailing_slash_bug=no -gl_cv_func_working_mkstemp=yes -EOF - -${SCRDIR}/cis-common ${PACKAGE} "${CONFIGURE_OPTS} --enable-install-program=hostname --cache-file=config.cache" - -exit $? diff --git a/stage1/cis-e2fsprogs b/stage1/cis-e2fsprogs index 0532f02..716a1c1 100755 --- a/stage1/cis-e2fsprogs +++ b/stage1/cis-e2fsprogs @@ -22,7 +22,6 @@ CC="${CC} ${CLFS_BUILDFLAGS}" PKG_CONFIG=true \ ../${PACKAGE}/configure \ --prefix=/tools \ --enable-elf-shlibs \ - --with-cc="${CC} ${CLFS_BUILDFLAGS}" \ --with-linker=${LD} \ --host=${CLFS_TARGET} \ --disable-libblkid \ diff --git a/stage1/cis-findutils b/stage1/cis-findutils deleted file mode 100755 index 403df4e..0000000 --- a/stage1/cis-findutils +++ /dev/null @@ -1,30 +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 ../sysinfos -source ../functions -source ../packages-list - -# Applying patches (if any) -apply_patches ${PACKAGE} - -cd ${LFS_TMP}/${PACKAGE}-build - -# The following cache entries set the values for tests that do not run while -# cross-compiling: -cat > config.cache << EOF -gl_cv_func_wcwidth_works=yes -ac_cv_func_fnmatch_gnu=yes -EOF - -${SCRDIR}/cis-common ${PACKAGE} "${CONFIGURE_OPTS} --cache-file=config.cache" - -exit $? diff --git a/stage1/cis-flex b/stage1/cis-flex deleted file mode 100755 index 40886e1..0000000 --- a/stage1/cis-flex +++ /dev/null @@ -1,36 +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 ../sysinfos -source ../functions -source ../packages-list - -# Applying patches (if any) -apply_patches ${PACKAGE} - -cd ${LFS_TMP}/${PACKAGE} - -# Make sure that Flex doesn't try to include headers from /usr/include. -cp -v Makefile.in{,.orig} -sed "s/-I@includedir@//g" Makefile.in.orig > Makefile.in - -cd ${LFS_TMP}/${PACKAGE}-build - -# When Cross Compiling the configure script does not determine the correct -# values for the following, Set the values manually: -cat > config.cache << EOF -ac_cv_func_malloc_0_nonnull=yes -ac_cv_func_realloc_0_nonnull=yes -EOF - -${SCRDIR}/cis-common ${PACKAGE} "${CONFIGURE_OPTS} --cache-file=config.cache" - -exit $? diff --git a/stage1/cis-gcc b/stage1/cis-gcc index 445bc89..ae99b97 100755 --- a/stage1/cis-gcc +++ b/stage1/cis-gcc @@ -6,8 +6,12 @@ source ../sysinfos source ../functions source ../packages-list -# Manually applying patches -apply_patch ${1}-branch_update-1.patch ${1} +# 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") @@ -60,9 +64,8 @@ CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \ --enable-__cxa_atexit \ --enable-languages=c,c++ # Prevent GCC from looking in the wrong directories for headers and libraries: -cp Makefile{,.orig} -sed "/^HOST_\(GMP\|PPL\|CLOOG\)\(LIBS\|INC\)/s:-[IL]/\(lib\|include\)::" \ - Makefile.orig > Makefile +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 diff --git a/stage1/cis-m4 b/stage1/cis-m4 deleted file mode 100755 index 92338db..0000000 --- a/stage1/cis-m4 +++ /dev/null @@ -1,35 +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 ../sysinfos -source ../functions -source ../packages-list - -# Applying patches (if any) -apply_patches ${PACKAGE} - -cd ${LFS_TMP}/${PACKAGE}-build - -# Configure can not properly determine the results of the following tests: -cat > 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 - -${SCRDIR}/cis-common ${PACKAGE} "${CONFIGURE_OPTS} --cache-file=config.cache" - -exit $? diff --git a/stage1/cis-ppl b/stage1/cis-ppl new file mode 100755 index 0000000..d09b5b6 --- /dev/null +++ b/stage1/cis-ppl @@ -0,0 +1,35 @@ +#!/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 $? diff --git a/stage1/cis-tar b/stage1/cis-tar deleted file mode 100755 index 4feb5c4..0000000 --- a/stage1/cis-tar +++ /dev/null @@ -1,36 +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 ../sysinfos -source ../functions -source ../packages-list - -# Applying patches (if any) -apply_patches ${PACKAGE} - -cd ${LFS_TMP}/${PACKAGE}-build - -# Configure can not properly determine the results of a few tests. Set them manually: -cat > 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 - -${SCRDIR}/cis-common ${PACKAGE} "${CONFIGURE_OPTS} --cache-file=config.cache" - -exit $? diff --git a/stage1/cis-texinfo b/stage1/cis-texinfo deleted file mode 100755 index ca87926..0000000 --- a/stage1/cis-texinfo +++ /dev/null @@ -1,32 +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 ../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} -${HVMAKE} -C tools/gnulib/lib -${HVMAKE} -C tools -${HVMAKE} -${HVMAKE} install - -exit $? diff --git a/stage1/cis-util-linux-ng b/stage1/cis-util-linux-ng index f86916c..18c8d34 100755 --- a/stage1/cis-util-linux-ng +++ b/stage1/cis-util-linux-ng @@ -16,8 +16,14 @@ source ../packages-list # Applying patches (if any) apply_patches ${PACKAGE} -${SCRDIR}/cis-common2 ${PACKAGE} "${CONFIGURE_OPTS} --enable-login-utils --disable-makeinstall-chown" 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 diff --git a/stage1/cis-zlib b/stage1/cis-zlib index b3bbb71..b5ba571 100755 --- a/stage1/cis-zlib +++ b/stage1/cis-zlib @@ -13,8 +13,7 @@ apply_patches ${1} cd ${LFS_TMP}/${1} CC="${CC} ${CLFS_BUILDFLAGS}" ./configure \ - --prefix=/tools \ - --shared + --prefix=/tools ${HVMAKE} # Installing the shared library diff --git a/stage1/config.cache.bash b/stage1/config.cache.bash new file mode 100755 index 0000000..fe0f9e9 --- /dev/null +++ b/stage1/config.cache.bash @@ -0,0 +1,19 @@ +# 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 diff --git a/stage1/config.cache.coreutils b/stage1/config.cache.coreutils new file mode 100644 index 0000000..6094db5 --- /dev/null +++ b/stage1/config.cache.coreutils @@ -0,0 +1,6 @@ +# 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 diff --git a/stage1/config.cache.findutils b/stage1/config.cache.findutils new file mode 100755 index 0000000..5587147 --- /dev/null +++ b/stage1/config.cache.findutils @@ -0,0 +1,4 @@ +# 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 diff --git a/stage1/config.cache.flex b/stage1/config.cache.flex new file mode 100755 index 0000000..179e8d5 --- /dev/null +++ b/stage1/config.cache.flex @@ -0,0 +1,4 @@ +# 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 diff --git a/stage1/config.cache.gettext b/stage1/config.cache.gettext new file mode 100755 index 0000000..302f11e --- /dev/null +++ b/stage1/config.cache.gettext @@ -0,0 +1,4 @@ +# 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 diff --git a/stage1/config.cache.grep b/stage1/config.cache.grep new file mode 100644 index 0000000..0ce838e --- /dev/null +++ b/stage1/config.cache.grep @@ -0,0 +1,2 @@ +ac_cv_func_malloc_0_nonnull=yes +ac_cv_func_realloc_0_nonnull=yes diff --git a/stage1/config.cache.m4 b/stage1/config.cache.m4 new file mode 100755 index 0000000..e4dc725 --- /dev/null +++ b/stage1/config.cache.m4 @@ -0,0 +1,9 @@ +# 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 diff --git a/stage1/config.cache.tar b/stage1/config.cache.tar new file mode 100755 index 0000000..803877e --- /dev/null +++ b/stage1/config.cache.tar @@ -0,0 +1,10 @@ +# 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 diff --git a/stage1/configure.pre.binutils b/stage1/configure.pre.binutils new file mode 100644 index 0000000..4a9a672 --- /dev/null +++ b/stage1/configure.pre.binutils @@ -0,0 +1,11 @@ +#!/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 +} diff --git a/stage1/configure.pre.cloog-ppl b/stage1/configure.pre.cloog-ppl new file mode 100755 index 0000000..6e06827 --- /dev/null +++ b/stage1/configure.pre.cloog-ppl @@ -0,0 +1,8 @@ +#!/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 +} diff --git a/stage1/configure.pre.coreutils b/stage1/configure.pre.coreutils new file mode 100644 index 0000000..12198fd --- /dev/null +++ b/stage1/configure.pre.coreutils @@ -0,0 +1,7 @@ +#!/bin/bash + +configure_pre() +{ + # Fix a bug when the uname patch is automatically applied + touch ${LFS_TMP}/${PACKAGE}/man/{uname,hostname}.1 +} diff --git a/stage1/configure.pre.flex b/stage1/configure.pre.flex new file mode 100755 index 0000000..37f8735 --- /dev/null +++ b/stage1/configure.pre.flex @@ -0,0 +1,7 @@ +#!/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 +} diff --git a/stage1/configure.pre.m4 b/stage1/configure.pre.m4 new file mode 100755 index 0000000..6b59f81 --- /dev/null +++ b/stage1/configure.pre.m4 @@ -0,0 +1,7 @@ +#!/bin/bash + +configure_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/install-1 b/stage1/install-1 index 479496f..c23163a 100755 --- a/stage1/install-1 +++ b/stage1/install-1 @@ -30,6 +30,7 @@ export SCRDIR=$(pwd) HOST_CC=gcc CPPFLAGS=-fexceptions \ ipkg_ac ${GMP} "--enable-cxx" ipkg_ac ${MPFR} "--enable-shared" +ipkg_ac ${MPC} ipkg_ac ${PPL} "\ --enable-shared \ --enable-interfaces=c,cxx \ @@ -42,34 +43,46 @@ ipkg_ac ${CLOOG_PPL} "\ --with-gmp=/tools \ --with-ppl=/tools" ipkg_cust ${ZLIB} cis-zlib -ipkg_cust ${BINUTILS} cis-binutils +ipkg_ac ${BINUTILS} "\ + --target=${CLFS_TARGET} \ + --with-lib-path=/tools/lib \ + --disable-nls \ + --enable-shared \ + --disable-multilib" ipkg_cust ${GCC} cis-gcc -ipkg_ac ${NCURSES} "--with-shared --without-debug --without-ada --enable-overwrite --with-build-cc=gcc" -ipkg_cust ${BASH} cis-bash +ipkg_ac ${NCURSES} "\ + --with-shared \ + --without-debug \ + --without-ada \ + --enable-overwrite \ + --with-build-cc=gcc" +ipkg_ac ${BASH} "--without-bash-malloc" ipkg_ac ${BISON} ipkg_cust ${BZIP2} cis-bzip2 -ipkg_cust ${COREUTILS} cis-coreutils +ipkg_ac ${COREUTILS} "--enable-install-program=hostname" ipkg_ac ${DIFFUTILS} -ipkg_cust ${FINDUTILS} cis-findutils +ipkg_ac ${FINDUTILS} ipkg_ac ${FILE_PKG} -ipkg_cust ${FLEX} cis-flex -ipkg_ac ${GAWK} "--disable-libsigsegv" +ipkg_ac ${FLEX} +ipkg_ac ${GAWK} ipkg_cust ${GETTEXT} cis-gettext -ipkg_ac ${GREP} "--disable-perl-regexp --without-included-regex" +ipkg_ac ${GREP} "\ + --disable-perl-regexp \ + --without-included-regex" ipkg_ac ${GZIP} -ipkg_cust ${MFOUR} cis-m4 +ipkg_ac ${MFOUR} ipkg_ac ${MAKE_PACKAGE} ipkg_ac ${PATCH_PACKAGE} ipkg_ac ${SED} -ipkg_cust ${TAR_PACKAGE} cis-tar -ipkg_cust ${TEXINFO} cis-texinfo +ipkg_ac ${TAR_PACKAGE} +ipkg_ac ${TEXINFO} ipkg_ac ${XZ_UTILS} # Chapter 7 rscr once "Creating directory structure" create-directories rscr once "Creating symbolic links" create-symlinks -ipkg_ac ${NANO} --enable-color --enable-multibuffer +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 diff --git a/stage1/packages-update b/stage1/packages-update index 9702fcf..3fc5ac0 100755 --- a/stage1/packages-update +++ b/stage1/packages-update @@ -19,6 +19,7 @@ fi # These packages are already downloaded for stage0: lpkg 0 ${GMP} lpkg 0 ${MPFR} +lpkg 0 ${MPC} lpkg 0 ${PPL} lpkg 0 ${CLOOG_PPL} lpkg 0 ${BINUTILS} @@ -33,7 +34,7 @@ fpkg_gnu ${BASH} fpkg_gnu ${BISON} fpkg ${BZIP2} "http://www.bzip.org/$(get_pkg_ver ${BZIP2})" fpkg_gnu ${COREUTILS} -fpkg ${DIFFUTILS} "ftp://alpha.gnu.org/gnu/diffutils" +fpkg_gnu ${DIFFUTILS} fpkg_gnu ${FINDUTILS} fpkg_sf ${FLEX} fpkg_gnu ${GAWK}