cookutils rev 369
cook: dont update chroot if target host dont match build host
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu May 10 21:08:22 2012 +0200 (2012-05-10) |
parents | 897463926883 |
children | 0c0e4f64389a |
files | cook cook.conf |
line diff
1.1 --- a/cook Thu May 10 04:37:24 2012 +0200 1.2 +++ b/cook Thu May 10 21:08:22 2012 +0200 1.3 @@ -427,10 +427,12 @@ 1.4 set_paths 1.5 1.6 # Handle cross compilation. 1.7 - if [ "$HOST_ARCH" ] && [ ! $(echo "$HOST_ARCH" | fgrep $ARCH) ]; then 1.8 - echo "ERROR: This package dont cook or is not include in: $ARCH" 1.9 - [ "$CROSS_BUGS" ] && echo "Bug: $CROSS_BUGS" 1.10 - exit 1 1.11 + if [ "$HOST_ARCH" ]; then 1.12 + if ! echo "$HOST_ARCH" | fgrep -q $ARCH; then 1.13 + echo "ERROR: This package dont cook or is not include in: $ARCH" 1.14 + [ "$CROSS_BUGS" ] && echo "Bug: $CROSS_BUGS" 1.15 + exit 1 1.16 + fi 1.17 fi 1.18 case "$ARCH" in 1.19 arm|x86_64) 1.20 @@ -833,8 +835,10 @@ 1.21 fi 1.22 fi 1.23 1.24 + # Skip install if target host dont match build system. 1.25 + build=$(echo $BUILD_SYSTEM | cut -d "-" -f 1) 1.26 # Install package if part of the chroot to keep env up-to-date. 1.27 - if [ -d "$INSTALLED/$pkg" ]; then 1.28 + if [ -d "$INSTALLED/$pkg" ] && [ "$build" != "$ARCH" ]; then 1.29 . /etc/slitaz/cook.conf 1.30 . $WOK/$pkg/taz/$pkg-*/receipt 1.31 echo "Updating chroot environment..." 1.32 @@ -926,7 +930,7 @@ 1.33 # Setup fro cross ARM compiling. 1.34 sed -i \ 1.35 -e s'/ARCH=.*/ARCH="arm"/' \ 1.36 - -e s'/CFLAGS=.*/CFLAGS=""/' \ 1.37 + -e s'/CFLAGS=.*/CFLAGS="-march=armv6"/' \ 1.38 -e s'/BUILD_SYSTEM=.*/BUILD_SYSTEM=i486-slitaz-linux/' \ 1.39 -e s'/HOST_SYSTEM=.*/HOST_SYSTEM=$ARCH-slitaz-linux-gnueabi/' \ 1.40 /etc/slitaz/cook.conf 1.41 @@ -1246,8 +1250,11 @@ 1.42 fi 1.43 fi 1.44 1.45 + # Skip install if target host dont match build system. 1.46 + build=$(echo $BUILD_SYSTEM | cut -d "-" -f 1) 1.47 # Install package if part of the chroot to keep env up-to-date. 1.48 - if [ -d "$INSTALLED/$PACKAGE" ] && [ -z "$AUFS_MOUNTS" ]; then 1.49 + if [ -d "$INSTALLED/$PACKAGE" ] && [ -z "$AUFS_MOUNTS" ] && \ 1.50 + [ "$build" != "$ARCH" ]; then 1.51 echo "Updating chroot environment..." 1.52 echo "Updating chroot: $PACKAGE (${VERSION}${EXTRAVERSION})" | log 1.53 cd $PKGS && tazpkg install \
2.1 --- a/cook.conf Thu May 10 04:37:24 2012 +0200 2.2 +++ b/cook.conf Thu May 10 21:08:22 2012 +0200 2.3 @@ -47,8 +47,13 @@ 2.4 BUILD_HOST="$HOST_SYSTEM" 2.5 2.6 # SliTaz optimisation flags - Wide compatibility & optimized for ARCH. 2.7 +# 2.8 # With -O2: binutils: Produce 14.0M Packed 5.5M Compressed 1.2M 2.9 # With -Os: binutils: Produce 13.4M Packed 4.9M Compressed 1.1M 2.10 +# 2.11 +# ARM: dont use -0s but -02 2.12 +# ARM: -mcpu=name [arm9|xscale|...] or -march=name [armv4|armv6|...] 2.13 +# 2.14 MAKEFLAGS="-j$(($(grep processor /proc/cpuinfo | wc -l)+1))" 2.15 CFLAGS="-march=$ARCH -Os -pipe -fomit-frame-pointer" 2.16 CXXFLAGS="$CFLAGS" 2.17 @@ -76,4 +81,5 @@ 2.18 2.19 # List of filesystems into the aufs chroot (to protect / against modifications) 2.20 # Default tank config: 2.21 -AUFS_MOUNTS="/ /proc /sys /dev/shm /dev/pts /var/cache/tazpkg /home /home/slitaz/src /home/slitaz/packages" 2.22 +AUFS_MOUNTS="/ /proc /sys /dev/shm /dev/pts /var/cache/tazpkg \ 2.23 +/home /home/slitaz/src /home/slitaz/packages"