tazwok rev 548

Fix: -pipe compile flag shouldn't make compilation fails because of low ram anymore (+ cosmetic change)
author Antoine Bodin <gokhlayeh@slitaz.org>
date Fri Dec 09 22:43:04 2011 +0100 (2011-12-09)
parents f2d78e18fc10
children c7c055498940
files chroot-scripts/cook-toolchain tazwok
line diff
     1.1 --- a/chroot-scripts/cook-toolchain	Fri Dec 09 20:49:42 2011 +0100
     1.2 +++ b/chroot-scripts/cook-toolchain	Fri Dec 09 22:43:04 2011 +0100
     1.3 @@ -88,7 +88,7 @@
     1.4  	report open-bloc
     1.5  	prepare_package
     1.6  	report step "Running compilation rules"
     1.7 -	cook_cross_toolchain
     1.8 +	precook_tmp_toolchain
     1.9  	report end-step || exit 1
    1.10  	report close-bloc
    1.11  	report end-sublog
     2.1 --- a/tazwok	Fri Dec 09 20:49:42 2011 +0100
     2.2 +++ b/tazwok	Fri Dec 09 22:43:04 2011 +0100
     2.3 @@ -635,14 +635,13 @@
     2.4  		ulimit -d unlimited
     2.5  		ulimit -m unlimited
     2.6  
     2.7 -		# Free some RAM by cleaning cache if option is enabled.
     2.8 -		freeram=$(free | fgrep '/+ buffers' | tr -s ' ' | cut -f 4 -d ' ')
     2.9 +		freeram=$(free -m | fgrep 'Mem:' | tr -s ' ' | cut -f 4 -d ' ')
    2.10  
    2.11 -		# Disable -pipe in CFLAGS/CXXFLAGS if less than 512Mb of free
    2.12 +		# Disable -pipe in CFLAGS/CXXFLAGS if less than 512MB of free
    2.13  		# RAM are available.
    2.14 -		if [ "$freeram" -lt 524288 ] && [ "$CFLAGS" != "${CFLAGS/-pipe}" -o \
    2.15 +		if [ "$freeram" -lt 512 ] && [ "$CFLAGS" != "${CFLAGS/-pipe}" -o \
    2.16  			"$CXXFLAGS" != "${CXXFLAGS/-pipe}" ]; then
    2.17 -				tazwok_warning "Disabling -pipe compile flag because only ${freeram}b of RAM is available."
    2.18 +				tazwok_warning "Disabling -pipe compile flag because of low memory: $freeram MB available."
    2.19  				CFLAGS="${CFLAGS/-pipe}"
    2.20  				CXXFLAGS="${CXXFLAGS/-pipe}"
    2.21  		fi