wok-undigest diff cross-arm-gcc/receipt @ rev 762

airstrike: fix data path
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jul 12 13:18:48 2012 +0200 (2012-07-12)
parents
children add8edc42614
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/cross-arm-gcc/receipt	Thu Jul 12 13:18:48 2012 +0200
     1.3 @@ -0,0 +1,111 @@
     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 +BUILD_DEPENDS="linux-arm-api-headers cross-arm-binutils gmp gmp-dev \
    1.18 +mpfr mpfr-dev mpc-library elfutils-dev"
    1.19 +
    1.20 +# Cross toolchain variables.
    1.21 +CROSS_TARGET="arm-slitaz-linux-gnueabi"
    1.22 +CROSS_PREFIX="/usr/cross/arm"
    1.23 +CROSS_TRIPLET="--build=$HOST_SYSTEM --host=$HOST_SYSTEM --target=$CROSS_TARGET"
    1.24 +
    1.25 +# CFLAGS and CXXFLAGS must not be set during the building of cross-tools.
    1.26 +unset CFLAGS CXXFLAGS CONFIG_SITE
    1.27 +
    1.28 +# Path to cross tools
    1.29 +export PATH=$PATH:$CROSS_PREFIX/bin
    1.30 +
    1.31 +# Rules to configure and make the package.
    1.32 +compile_rules()
    1.33 +{
    1.34 +	cd $src
    1.35 +
    1.36 +	# Package cross-arm-toolchain use 'cook --options' when rebuilding
    1.37 +	# the full SliTaz ARM cross toolchain.
    1.38 +	[ "$2" == "--first-pass" ] && opt=$2
    1.39 +	[ "$3" == "--first-pass" ] && opt=$3
    1.40 +
    1.41 +	# Use libiberty.a from binutils.
    1.42 +	sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || return 1
    1.43 +
    1.44 +	mkdir -p ../build && cd ../build
    1.45 +
    1.46 +	case $opt in
    1.47 +		--first-pass)
    1.48 +			# Used by cross-arm-toolchain when rebuilding the full toolchain.
    1.49 +			echo "cook: configure GCC for: cross toolchain first pass"
    1.50 +			$src/configure \
    1.51 +				--prefix=$CROSS_PREFIX \
    1.52 +				--libexec=$CROSS_PREFIX/lib \
    1.53 +				--disable-shared \
    1.54 +				--enable-languages=c \
    1.55 +				--disable-threads \
    1.56 +				--disable-multilib \
    1.57 +				--disable-nls \
    1.58 +				--without-headers \
    1.59 +				--disable-libgomp \
    1.60 +				--disable-libmudflap \
    1.61 +				--disable-libssp \
    1.62 +				$CROSS_TRIPLET &&
    1.63 +			make all-gcc all-target-libgcc &&
    1.64 +			make install-gcc install-target-libgcc &&
    1.65 +			cd ${install}${CROSS_PREFIX}/lib/gcc/$CROSS_TARGET/$VERSION &&
    1.66 +			ln -s libgcc.a libgcc_eh.a ;;
    1.67 +		*)
    1.68 +			# Used to produce a full featured ARM GCC cross compiler.
    1.69 +			echo "cook: configure GCC for: final/full cross compiler"
    1.70 +
    1.71 +			# We cant't have cross-arm-glibc it in DEPENDS since it not build
    1.72 +			# when we compile GCC --first-pass
    1.73 +			if [ ! "/var/lib/tazpkg/installed/cross-arm-glibc" ]; then
    1.74 +				tazpkg -i /home/slitaz/packages/cross-arm-glibc-2.14.1.tazpkg
    1.75 +			fi
    1.76 +
    1.77 +			$src/configure \
    1.78 +				--prefix=$CROSS_PREFIX \
    1.79 +				--libexec=$CROSS_PREFIX/lib \
    1.80 +				--enable-shared \
    1.81 +				--enable-languages=c,c++ \
    1.82 +				--enable-c99 \
    1.83 +				--enable-long-long \
    1.84 +				--enable-__cxa_atexit \
    1.85 +				--enable-threads=posix \
    1.86 +				--with-pkgversion="SliTaz" \
    1.87 +				$CROSS_TRIPLET &&
    1.88 +			make && make install &&
    1.89 +			make all-target-libgcc &&
    1.90 +			make install-target-libgcc ;;
    1.91 +	esac
    1.92 +
    1.93 +	# Some configure options we could use
    1.94 +	#--enable-multilib
    1.95 +	#--enable-addons
    1.96 +	#--with-newlib
    1.97 +}
    1.98 +
    1.99 +# Rules to gen a SliTaz package suitable for Tazpkg.
   1.100 +genpkg_rules()
   1.101 +{
   1.102 +	mkdir -p $fs/usr
   1.103 +	cp -a $install/usr/cross $fs/usr
   1.104 +	rm -rf ${fs}${CROSS_PREFIX}/share
   1.105 +
   1.106 +	# This will fix GCC final build since we dont use --with-sysroot=
   1.107 +	# Without that we go errors such as: cannot find crtn.o
   1.108 +	cd ${fs}${CROSS_PREFIX}/$CROSS_TARGET
   1.109 +	for dir in lib include; do
   1.110 +		mv -f $dir/* ../$dir 2>/dev/null
   1.111 +		rmdir $dir 2>/dev/null
   1.112 +		ln -s ../$dir .
   1.113 +	done
   1.114 +}