# HG changeset patch # User Antoine Bodin # Date 1322322897 -3600 # Node ID 44e24b12e9dd9fc3fe84ca8f798dcfe63b58f601 # Parent a1fb349257d86a57b428913e6818af6b73a84a79 Fixes: minor compatibility fixes & a change in extract_tarball which make it quicker and more reliable. diff -r a1fb349257d8 -r 44e24b12e9dd chroot-scripts/cook-toolchain --- a/chroot-scripts/cook-toolchain Sat Jun 18 19:05:21 2011 +0000 +++ b/chroot-scripts/cook-toolchain Sat Nov 26 16:54:57 2011 +0100 @@ -6,6 +6,12 @@ source /usr/lib/slitaz/libtaz source /etc/slitaz/tazwok.conf +LOCAL_REPOSITORY=$SLITAZ_DIR/${undigest:-$SLITAZ_VERSION} +if [ -f $LOCAL_REPOSITORY/tazwok.conf ]; then + source $LOCAL_REPOSITORY/tazwok.conf +fi +WOK=$LOCAL_REPOSITORY/wok + # Report progress on webserver. log_step="$LOCAL_REPOSITORY/log/step" run_on_exit="$run_on_exit @@ -18,10 +24,10 @@ report step "Cooking temporary toolchain" report open-bloc -report step "Configuring repositories" +report step "Configuring packages repositories" # Incoming packages as the only source for packages. rm -r /var/lib/tazpkg/undigest -tazpkg setup-mirror $SLITAZ_DIR/${undigest:-$SLITAZ_VERSION}/packages-incoming +tazpkg setup-mirror $LOCAL_REPOSITORY/packages-incoming tazpkg recharge report step "Refreshing SliTaz tools" @@ -39,22 +45,18 @@ LANG=POSIX LC_ALL=POSIX -# Set BUILD_HOST to something like $ARCH-tmp-linux-gnu to enable +# Set HOST_SYSTEM to something like $ARCH-tmp-linux-gnu to enable # the temporary toolchain. -BUILD_HOST=$(echo $BUILD_HOST | sed 's/\(.*\)-\(.*\)-linux-gnu/\1-tmp-linux-gnu/') +HOST_SYSTEM=$(echo $HOST_SYSTEM | sed 's/\(.*\)-\(.*\)-linux-gnu/\1-tmp-linux-gnu/') PATH=/tools/bin:/tools/usr/bin:/tools/sbin:/tools/usr/sbin:/bin:/usr/bin:/sbin:/usr/sbin CONFIG_SITE="/etc/config.site.tmptoolchain" -echo 'prefix=/tools' > /etc/config.site.tmptoolchain +echo "prefix=/tools" > /etc/config.site.tmptoolchain export LANG LC_ALL PATH PS1 MAKEFLAGS CONFIG_SITE unset CC CXX CPP CFLAGS CXXFLAGS LD_LIBRARY_PATH LD_PRELOAD DESTDIR -LOCAL_REPOSITORY=$SLITAZ_DIR/$SLITAZ_VERSION -[ "$undigest" ] && LOCAL_REPOSITORY=$SLITAZ_DIR/$undigest -WOK=$LOCAL_REPOSITORY/wok - -# Create the dir for the temporary toolchain and link in root of host +# Create the dir for the temporary toolchain and link in root of build # system. rm -rf /tools mkdir /tools @@ -76,6 +78,7 @@ cd $WOK/$PACKAGE } + # Binutils and gcc need to be compiled twice. for PACKAGE in binutils gcc; do rm $LOCAL_REPOSITORY/log/tmp-toolchain-$PACKAGE-firstpass.html 2>/dev/null @@ -85,7 +88,7 @@ report open-bloc prepare_package report step "Running compilation rules" - precook_tmp_toolchain + cook_cross_toolchain report end-step || exit 1 report close-bloc report end-sublog diff -r a1fb349257d8 -r 44e24b12e9dd examples/config.site --- a/examples/config.site Sat Jun 18 19:05:21 2011 +0000 +++ b/examples/config.site Sat Nov 26 16:54:57 2011 +0100 @@ -48,7 +48,7 @@ { [ "$build" = NONE ] || [ ! "$build" ] ; } && build=$default_build { [ "$host" = NONE ] || [ ! "$host" ] ; } && host=$default_host -# Print information about these variables. +# Print information about those variables. echo "prefix = $prefix datarootdir = $datarootdir datadir = $datadir @@ -59,5 +59,6 @@ host = $host " -# config.site is used by tazwok to check that the config.site script has been used. +# /tmp/config.site is used by tazwok to check that the config.site +# script has been used. touch /tmp/config.site diff -r a1fb349257d8 -r 44e24b12e9dd examples/tazwok.conf --- a/examples/tazwok.conf Sat Jun 18 19:05:21 2011 +0000 +++ b/examples/tazwok.conf Sat Nov 26 16:54:57 2011 +0100 @@ -10,7 +10,12 @@ HG_WOK="http://hg.slitaz.org/wok" # Default makeflags. -MAKEFLAGS="-j$((`grep processor /proc/cpuinfo | wc -l`+1))" +# This one make compilation use all cpu when possible, and have +# priority hover other processes. +# MAKEFLAGS="-j$((`grep processor /proc/cpuinfo | wc -l`+1))" +# This one makes use of all cpu but without priority, so if you +# run something else it can run smoothly even while compiling. +MAKEFLAGS="-j`grep processor /proc/cpuinfo | wc -l`" # Default architecture. ARCH="i486" @@ -18,12 +23,8 @@ # Build and host. These options are for cross-compiling. If you specify # both options and BUILD_SYSTEM is different from HOST_SYSTEM, configure # will prepare to cross-compile from BUILD_SYSTEM to be used on HOST_SYSTEM. -BUILD_SYSTEM="$(uname -m)-slitaz-linux" -#BUILD_SYSTEM="$ARCH-slitaz-linux" -HOST_SYSTEM="$ARCH-slitaz-linux" - -# Default build host. -BUILD_HOST="$HOST_SYSTEM" +BUILD_SYSTEM="$ARCH-pc-linux-gnu" +HOST_SYSTEM="$ARCH-pc-linux-gnu" # Default compilation flags. # More details at : diff -r a1fb349257d8 -r 44e24b12e9dd tazwok --- a/tazwok Sat Jun 18 19:05:21 2011 +0000 +++ b/tazwok Sat Nov 26 16:54:57 2011 +0100 @@ -127,6 +127,7 @@ check_dir $SOURCES_REPOSITORY check_dir $INCOMING_REPOSITORY check_dir $LOCAL_REPOSITORY/log + check_dir $LOCAL_REPOSITORY/tmp [ -f $dep_db ] || touch $dep_db [ -f $wan_db ] || touch $wan_db [ -f $PACKAGES_REPOSITORY/cookorder.txt ] || touch $PACKAGES_REPOSITORY/cookorder.txt @@ -450,7 +451,7 @@ [ "$WGET_URL" ] || return 0 [ "$WANTED" ] && return 0 report step "Checking for source tarball: $PACKAGE" - local repack_src=$repack_src TARBALL=$TARBALL local nounpack=$nounpack + local repack_src=$repack_src TARBALL=$TARBALL nounpack=$nounpack look_for_cookopt !unpack && nounpack=yes if [ "$repack_src" = yes ] && look_for_cookopt !repack_src; then repack_src=no @@ -460,7 +461,7 @@ else set_src_path fi - tmp_src=$tmp/tarball-$$ + tmp_src=$LOCAL_REPOSITORY/tmp/tarball-$$ if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && \ [ ! -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-${KBASEVER:-$VERSION}.tar.lzma" ] ; then cd $SOURCES_REPOSITORY @@ -654,7 +655,7 @@ [ "$CONFIG_SITE" ] || CONFIG_SITE=/etc/config.site export CFLAGS=$(echo "$CFLAGS" | tr -s ' ') \ CXXFLAGS=$(echo "$CXXFLAGS" | tr -s ' ') \ - MAKEFLAGS DESTDIR BUILD_HOST CONFIG_SITE default_prefix \ + MAKEFLAGS DESTDIR CONFIG_SITE default_prefix \ default_datarootdir default_datadir default_localedir \ default_infodir default_mandir default_build default_host \ BUILD_SYSTEM HOST_SYSTEM