# HG changeset patch # User Christophe Lincoln # Date 1336676902 -7200 # Node ID ae512633e579ff6559941d777f47211bd18adc87 # Parent 89746392688358bbf5db2952963461c6cc550f25 cook: dont update chroot if target host dont match build host diff -r 897463926883 -r ae512633e579 cook --- a/cook Thu May 10 04:37:24 2012 +0200 +++ b/cook Thu May 10 21:08:22 2012 +0200 @@ -427,10 +427,12 @@ set_paths # Handle cross compilation. - if [ "$HOST_ARCH" ] && [ ! $(echo "$HOST_ARCH" | fgrep $ARCH) ]; then - echo "ERROR: This package dont cook or is not include in: $ARCH" - [ "$CROSS_BUGS" ] && echo "Bug: $CROSS_BUGS" - exit 1 + if [ "$HOST_ARCH" ]; then + if ! echo "$HOST_ARCH" | fgrep -q $ARCH; then + echo "ERROR: This package dont cook or is not include in: $ARCH" + [ "$CROSS_BUGS" ] && echo "Bug: $CROSS_BUGS" + exit 1 + fi fi case "$ARCH" in arm|x86_64) @@ -833,8 +835,10 @@ fi fi + # Skip install if target host dont match build system. + build=$(echo $BUILD_SYSTEM | cut -d "-" -f 1) # Install package if part of the chroot to keep env up-to-date. - if [ -d "$INSTALLED/$pkg" ]; then + if [ -d "$INSTALLED/$pkg" ] && [ "$build" != "$ARCH" ]; then . /etc/slitaz/cook.conf . $WOK/$pkg/taz/$pkg-*/receipt echo "Updating chroot environment..." @@ -926,7 +930,7 @@ # Setup fro cross ARM compiling. sed -i \ -e s'/ARCH=.*/ARCH="arm"/' \ - -e s'/CFLAGS=.*/CFLAGS=""/' \ + -e s'/CFLAGS=.*/CFLAGS="-march=armv6"/' \ -e s'/BUILD_SYSTEM=.*/BUILD_SYSTEM=i486-slitaz-linux/' \ -e s'/HOST_SYSTEM=.*/HOST_SYSTEM=$ARCH-slitaz-linux-gnueabi/' \ /etc/slitaz/cook.conf @@ -1246,8 +1250,11 @@ fi fi + # Skip install if target host dont match build system. + build=$(echo $BUILD_SYSTEM | cut -d "-" -f 1) # Install package if part of the chroot to keep env up-to-date. - if [ -d "$INSTALLED/$PACKAGE" ] && [ -z "$AUFS_MOUNTS" ]; then + if [ -d "$INSTALLED/$PACKAGE" ] && [ -z "$AUFS_MOUNTS" ] && \ + [ "$build" != "$ARCH" ]; then echo "Updating chroot environment..." echo "Updating chroot: $PACKAGE (${VERSION}${EXTRAVERSION})" | log cd $PKGS && tazpkg install \ diff -r 897463926883 -r ae512633e579 cook.conf --- a/cook.conf Thu May 10 04:37:24 2012 +0200 +++ b/cook.conf Thu May 10 21:08:22 2012 +0200 @@ -47,8 +47,13 @@ BUILD_HOST="$HOST_SYSTEM" # SliTaz optimisation flags - Wide compatibility & optimized for ARCH. +# # With -O2: binutils: Produce 14.0M Packed 5.5M Compressed 1.2M # With -Os: binutils: Produce 13.4M Packed 4.9M Compressed 1.1M +# +# ARM: dont use -0s but -02 +# ARM: -mcpu=name [arm9|xscale|...] or -march=name [armv4|armv6|...] +# MAKEFLAGS="-j$(($(grep processor /proc/cpuinfo | wc -l)+1))" CFLAGS="-march=$ARCH -Os -pipe -fomit-frame-pointer" CXXFLAGS="$CFLAGS" @@ -76,4 +81,5 @@ # List of filesystems into the aufs chroot (to protect / against modifications) # Default tank config: -AUFS_MOUNTS="/ /proc /sys /dev/shm /dev/pts /var/cache/tazpkg /home /home/slitaz/src /home/slitaz/packages" +AUFS_MOUNTS="/ /proc /sys /dev/shm /dev/pts /var/cache/tazpkg \ +/home /home/slitaz/src /home/slitaz/packages"