wok-current diff gcc/receipt @ rev 17832

Up: slitaz-boot-scripts (5.7)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Mar 23 02:04:52 2015 +0200 (2015-03-23)
parents 380ffe05937a
children 1067bb7f1e24
line diff
     1.1 --- a/gcc/receipt	Sat Aug 10 17:00:38 2013 +0000
     1.2 +++ b/gcc/receipt	Mon Mar 23 02:04:52 2015 +0200
     1.3 @@ -10,124 +10,28 @@
     1.4  WEB_SITE="http://gcc.gnu.org/"
     1.5  WGET_URL="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$VERSION/$TARBALL"
     1.6  TAGS="compiler C"
     1.7 +#HOST_ARCH="i486 arm"
     1.8  
     1.9  # We need gawk since busybox awk is not sufficient. We have BUILD_DEPENDS
    1.10  # for cookutils that are not used by tazwok/cook-toolchain since it install
    1.11  # and use it's own copy.
    1.12  DEPENDS="binutils libgomp libobjc gcc-lib-base mpc-library elfutils"
    1.13 -BUILD_DEPENDS="elfutils mpc-library mpfr mpfr-dev gmp gmp-dev \
    1.14 -elfutils-dev"
    1.15 +BUILD_DEPENDS="mpc-library mpfr-dev gmp-dev elfutils-dev"
    1.16  
    1.17 -# Rules to compile & install the temporary toolchain.
    1.18 -precook_tmp_toolchain()
    1.19 -{
    1.20 -	report open-bloc
    1.21 -	cd $src
    1.22 -
    1.23 -	# GCC requires the GMP, MPFR and MPC packages.
    1.24 -	tazwok get-src mpfr --target=$PWD/mpfr || { report close-bloc; return 1; }
    1.25 -	tazwok get-src gmp --target=$PWD/gmp || { report close-bloc; return 1; }
    1.26 -	tazwok get-src mpc-library --target=$PWD/mpc || { report close-bloc; return 1; }
    1.27 -
    1.28 -	report step "Running compilation"
    1.29 -
    1.30 -	# Use libiberty.a from binutils.
    1.31 -	sed -i 's/install_to_$(INSTALL_DEST) //' \
    1.32 -		libiberty/Makefile.in || return 1
    1.33 -
    1.34 -	# Build it in a separate directory.
    1.35 -	mkdir ../gcc-build
    1.36 -	cd ../gcc-build
    1.37 -
    1.38 -	{ $src/configure \
    1.39 -		--target=$HOST_SYSTEM \
    1.40 -		--disable-nls --disable-shared --disable-multilib \
    1.41 -		--disable-decimal-float --disable-threads \
    1.42 -		--disable-libmudflap --disable-libssp \
    1.43 -		--disable-libgomp --enable-languages=c \
    1.44 -		--with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs \
    1.45 -		--without-ppl --without-cloog &&
    1.46 -	make &&
    1.47 -	make install
    1.48 -	} || { report close-bloc; return 1; }
    1.49 -
    1.50 -	# See LFS for more detais about this.
    1.51 -	ln -s libgcc.a `$HOST_SYSTEM-gcc -print-libgcc-file-name | \
    1.52 -    		sed 's/libgcc/&_eh/'`
    1.53 -	report close-bloc
    1.54 -}
    1.55 -
    1.56 -cook_tmp_toolchain()
    1.57 -{
    1.58 -	report open-bloc
    1.59 -	cd $src
    1.60 -	patch -Np1 -i $stuff/gcc-$VERSION-startfiles_fix-1.patch || { report close-bloc; return 1; }
    1.61 -
    1.62 -	# Details about theses lines are in LFS book.
    1.63 -	sed 's@\./fixinc\.sh@-c true@' -i gcc/Makefile.in
    1.64 -	sed 's/^T_CFLAGS =$/& -fomit-frame-pointer/' -i gcc/Makefile.in
    1.65 -	for file in \
    1.66 -		$(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
    1.67 -	do
    1.68 -		sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
    1.69 -			-e 's@/usr@/tools@g' -i $file
    1.70 -		echo '
    1.71 -#undef STANDARD_INCLUDE_DIR
    1.72 -#define STANDARD_INCLUDE_DIR 0
    1.73 -#define STANDARD_STARTFILE_PREFIX_1 ""
    1.74 -#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
    1.75 -	done
    1.76 -
    1.77 -	if [ "$ARCH" = x86_64 ]; then
    1.78 -		for file in $(find gcc/config -name t-linux64) ; do
    1.79 -			sed '/MULTILIB_OSDIRNAMES/d' -i $file
    1.80 -		done
    1.81 -	fi
    1.82 -
    1.83 -	# GCC requires the GMP, MPFR and MPC packages.
    1.84 -	tazwok get-src mpfr --target=$PWD/mpfr || { report close-bloc; return 1; }
    1.85 -	tazwok get-src gmp --target=$PWD/gmp || { report close-bloc; return 1; }
    1.86 -	tazwok get-src mpc-library --target=$PWD/mpc || { report close-bloc; return 1; }
    1.87 -
    1.88 -	report step "Running compilation"
    1.89 -
    1.90 -	# Use libiberty.a from binutils.
    1.91 -	sed -i 's/install_to_$(INSTALL_DEST) //' \
    1.92 -		libiberty/Makefile.in || return 1
    1.93 -
    1.94 -	# Build it in a separate directory.
    1.95 -	mkdir ../gcc-build
    1.96 -	cd ../gcc-build
    1.97 -
    1.98 -	{ CC="$HOST_SYSTEM-gcc -B/tools/lib/" \
    1.99 -		AR=$HOST_SYSTEM-ar RANLIB=$HOST_SYSTEM-ranlib \
   1.100 -		$src/configure \
   1.101 -		--with-local-prefix=/tools --enable-clocale=gnu \
   1.102 -		--enable-shared --enable-threads=posix \
   1.103 -		--enable-__cxa_atexit --enable-languages=c,c++ \
   1.104 -		--disable-libstdcxx-pch --disable-multilib \
   1.105 -		--disable-bootstrap --disable-libgomp \
   1.106 -		--with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs \
   1.107 -		--without-ppl --without-cloog &&
   1.108 -	make &&
   1.109 -	make install
   1.110 -	} || { report close-bloc; return 1; }
   1.111 -	ln -s gcc /tools/bin/cc
   1.112 -	report close-bloc
   1.113 -}
   1.114 +# Handle cross compilation (native i486/ARM gcc)
   1.115 +case "$ARCH" in
   1.116 +	i?86)
   1.117 +		ARCH_ARGS="--with-tune=$ARCH"
   1.118 +		pkgversion="SliTaz"
   1.119 +		languages="c,c++,objc,fortran" ;;
   1.120 +	arm*)
   1.121 +		pkgversion="SliTaz ARM"
   1.122 +		languages="c,c++" ;;
   1.123 +esac
   1.124  
   1.125  # Rules to configure and make the package.
   1.126  compile_rules()
   1.127  {
   1.128 -	cd $src
   1.129 -
   1.130 -	# SliTaz is a Busybox based OS, why we so small and fast. Using gawk by
   1.131 -	# default to build package will not ensure package work with Busybox awk
   1.132 -	# and so should NOT be use to cook.
   1.133 -	if [ -x /usr/bin/cook ]; then
   1.134 -		[ -d "/var/lib/tazpkg/installed/gawk" ] || tazpkg get-install gawk
   1.135 -	fi
   1.136 -
   1.137  	# Package slitaz-toolchain use 'cook --options' when rebuilding
   1.138  	# the full SliTaz toolchain.
   1.139  	[ "$2" == "--first-pass" ] && opt=$2
   1.140 @@ -136,9 +40,8 @@
   1.141  	# Use libiberty.a from binutils.
   1.142  	sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || return 1
   1.143  
   1.144 -	case $ARCH in
   1.145 -		i?86) sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' \
   1.146 -			gcc/Makefile.in ;;
   1.147 +	case "$ARCH" in
   1.148 +		i?86) sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in ;;
   1.149  	esac
   1.150  
   1.151  	#sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
   1.152 @@ -161,8 +64,7 @@
   1.153  				--enable-clocale=gnu \
   1.154  				--enable-threads=posix \
   1.155  				--disable-bootstrap \
   1.156 -				--build=$HOST_SYSTEM \
   1.157 -				--host=$HOST_SYSTEM &&
   1.158 +				${CONFIGURE_ARGS} &&
   1.159  			make && make install ;;
   1.160  		*)
   1.161  			# Used by default to produce a full featured X86 GCC compiler.
   1.162 @@ -170,7 +72,7 @@
   1.163  			$src/configure \
   1.164  				--libexecdir=/usr/lib \
   1.165  				--enable-nls \
   1.166 -				--enable-languages=c,c++,objc,fortran \
   1.167 +				--enable-languages=${languages} \
   1.168  				--enable-shared \
   1.169  				--with-system-zlib \
   1.170  				--enable-clocale=gnu \
   1.171 @@ -179,10 +81,8 @@
   1.172  				--enable-lto \
   1.173  				--enable-threads=posix \
   1.174  				--disable-bootstrap \
   1.175 -				--with-pkgversion="SliTaz" \
   1.176 -				--with-tune=$ARCH \
   1.177 -				--build=$HOST_SYSTEM \
   1.178 -				--host=$HOST_SYSTEM &&
   1.179 +				--with-pkgversion="$pkgversion" \
   1.180 +				${CONFIGURE_ARGS} ${ARCH_ARGS} &&
   1.181  			make && make install ;;
   1.182  	esac
   1.183  }