wok-current rev 12701

Add: cross-arm-gcc (ARM cross compiler) Build will fail with cooker since it must be build with --first-pass the first time :-) A cross-arm-toolchain meta packge will follow
author Christophe Lincoln <pankso@slitaz.org>
date Thu May 03 16:25:12 2012 +0200 (2012-05-03)
parents 653777f375bf
children cf41f89ddb40
files cross-arm-gcc/receipt
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/cross-arm-gcc/receipt	Thu May 03 16:25:12 2012 +0200
     1.3 @@ -0,0 +1,100 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="cross-arm-gcc"
     1.7 +VERSION="4.6.3"
     1.8 +CATEGORY="system-tools"
     1.9 +SHORT_DESC="Cross compiler for targeting ARM platform."
    1.10 +MAINTAINER="pankso@slitaz.org"
    1.11 +SOURCE="gcc"
    1.12 +WEB_SITE="http://gcc.gnu.org/"
    1.13 +TARBALL="$SOURCE-$VERSION.tar.bz2"
    1.14 +WGET_URL="$GNU_MIRROR/gcc/gcc-$VERSION/$TARBALL"
    1.15 +
    1.16 +DEPENDS="mpc-library elfutils linux-arm-api-headers cross-arm-binutils \
    1.17 +cross-arm-glibc"
    1.18 +BUILD_DEPENDS="linux-arm-api-headers cross-arm-binutils gmp gmp-dev \
    1.19 +mpfr mpfr-dev mpc-library elfutils-dev"
    1.20 +
    1.21 +# Cross toolchain variables.
    1.22 +CROSS_TARGET="arm-slitaz-linux-gnueabi"
    1.23 +CROSS_PREFIX="/usr/cross/arm"
    1.24 +CROSS_TRIPLET="--build=$HOST_SYSTEM --host=$HOST_SYSTEM --target=$CROSS_TARGET"
    1.25 +
    1.26 +# CFLAGS and CXXFLAGS must not be set during the building of cross-tools.
    1.27 +unset CFLAGS CXXFLAGS CONFIG_SITE
    1.28 +
    1.29 +# Path to cross tools
    1.30 +export PATH=$PATH:$CROSS_PREFIX/bin
    1.31 +
    1.32 +# Rules to configure and make the package.
    1.33 +compile_rules()
    1.34 +{
    1.35 +	cd $src
    1.36 +
    1.37 +	# Package cross-arm-toolchain use 'cook --options' when rebuilding
    1.38 +	# the full SliTaz ARM cross toolchain.
    1.39 +	[ "$2" == "--first-pass" ] && opt=$2
    1.40 +	[ "$3" == "--first-pass" ] && opt=$3
    1.41 +
    1.42 +	mkdir -p ../build && cd ../build
    1.43 +
    1.44 +	case $opt in
    1.45 +		--first-pass)
    1.46 +			# Used by cross-arm-toolchain when rebuilding the full toolchain.
    1.47 +			echo "cook: configure GCC for: cross toolchain first pass"
    1.48 +			$src/configure \
    1.49 +				--prefix=$CROSS_PREFIX \
    1.50 +				--disable-shared \
    1.51 +				--disable-threads \
    1.52 +				--without-headers \
    1.53 +				--with-newlib \
    1.54 +				--enable-languages=c \
    1.55 +				$CROSS_TRIPLET &&
    1.56 +			make all-gcc all-target-libgcc &&
    1.57 +			make install-gcc install-target-libgcc &&
    1.58 +			cd ${install}${CROSS_PREFIX}/lib/gcc/$CROSS_TARGET/$VERSION &&
    1.59 +			#ln -s libgcc.a libgcc_sh.a
    1.60 +			ln -s libgcc.a libgcc_eh.a ;;
    1.61 +		*)
    1.62 +			# Used to produce a full featured ARM GCC cross compiler.
    1.63 +			echo "cook: configure GCC for: final/full cross compiler"
    1.64 +			# cross-arm-toolchain package will install glibc
    1.65 +			#tazpkg -i /home/slitaz/packages/cross-arm-glibc-2.14.1.tazpkg
    1.66 +			$src/configure \
    1.67 +				--prefix=$CROSS_PREFIX \
    1.68 +				--enable-shared \
    1.69 +				--enable-languages=c,c++ \
    1.70 +				--enable-c99 \
    1.71 +				--enable-long-long \
    1.72 +				--enable-__cxa_atexit \
    1.73 +				$CROSS_TRIPLET &&
    1.74 +			make && make install ;;
    1.75 +	esac
    1.76 +
    1.77 +	# Some configure options I have tested (pankso)
    1.78 +	#--libexec=/usr/lib
    1.79 +	#--disable-threads
    1.80 +	#--disable-checking
    1.81 +	#--disable-shared
    1.82 +	#--disable-nls
    1.83 +	#--with-as=/usr/bin/${CROSS_TARGET}-as
    1.84 +	#--with-ld=/usr/bin/${CROSS_TARGET}-ld
    1.85 +	#--enable-languages=c,c++
    1.86 +	#--enable-multilib
    1.87 +	#--enable-addons
    1.88 +	#--enable-softfloat
    1.89 +	#--with-float=soft
    1.90 +	#--disable-decimal-float
    1.91 +	#--enable-interwork
    1.92 +	#--disable-libgomp
    1.93 +	#--disable-libmudflap
    1.94 +	#--disable-libssp
    1.95 +}
    1.96 +
    1.97 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.98 +genpkg_rules()
    1.99 +{
   1.100 +	mkdir -p $fs/usr
   1.101 +	cp -a $install/usr/cross $fs/usr
   1.102 +	rm -rf ${fs}${CROSS_PREFIX}/share
   1.103 +}