wok-current view cross-arm-gcc/receipt @ rev 12713
Add: linux-x86_64-api-headers
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Sat May 05 00:34:42 2012 +0200 (2012-05-05) |
parents | 6fef0ccec331 |
children | a99a7e9a93a6 |
line source
1 # SliTaz package receipt.
3 PACKAGE="cross-arm-gcc"
4 VERSION="4.6.3"
5 CATEGORY="system-tools"
6 SHORT_DESC="Cross compiler for targeting ARM platform."
7 MAINTAINER="pankso@slitaz.org"
8 SOURCE="gcc"
9 WEB_SITE="http://gcc.gnu.org/"
10 TARBALL="$SOURCE-$VERSION.tar.bz2"
11 WGET_URL="$GNU_MIRROR/gcc/gcc-$VERSION/$TARBALL"
13 DEPENDS="mpc-library elfutils linux-arm-api-headers cross-arm-binutils"
14 BUILD_DEPENDS="linux-arm-api-headers cross-arm-binutils gmp gmp-dev \
15 mpfr mpfr-dev mpc-library elfutils-dev"
17 # Cross toolchain variables.
18 CROSS_TARGET="arm-slitaz-linux-gnueabi"
19 CROSS_PREFIX="/usr/cross/arm"
20 CROSS_TRIPLET="--build=$HOST_SYSTEM --host=$HOST_SYSTEM --target=$CROSS_TARGET"
22 # CFLAGS and CXXFLAGS must not be set during the building of cross-tools.
23 unset CFLAGS CXXFLAGS CONFIG_SITE
25 # Path to cross tools
26 export PATH=$PATH:$CROSS_PREFIX/bin
28 # Rules to configure and make the package.
29 compile_rules()
30 {
31 cd $src
33 # Package cross-arm-toolchain use 'cook --options' when rebuilding
34 # the full SliTaz ARM cross toolchain.
35 [ "$2" == "--first-pass" ] && opt=$2
36 [ "$3" == "--first-pass" ] && opt=$3
38 mkdir -p ../build && cd ../build
40 case $opt in
41 --first-pass)
42 # Used by cross-arm-toolchain when rebuilding the full toolchain.
43 echo "cook: configure GCC for: cross toolchain first pass"
44 $src/configure \
45 --prefix=$CROSS_PREFIX \
46 --libexec=$CROSS_PREFIX/lib \
47 --disable-shared \
48 --disable-threads \
49 --without-headers \
50 --with-newlib \
51 --enable-languages=c \
52 $CROSS_TRIPLET &&
53 make all-gcc all-target-libgcc &&
54 make install-gcc install-target-libgcc &&
55 cd ${install}${CROSS_PREFIX}/lib/gcc/$CROSS_TARGET/$VERSION &&
56 #ln -s libgcc.a libgcc_sh.a
57 ln -s libgcc.a libgcc_eh.a ;;
58 *)
59 # Used to produce a full featured ARM GCC cross compiler.
60 echo "cook: configure GCC for: final/full cross compiler"
62 # The cross-arm-toolchain package will install glibc. We can't
63 # have it in DEPENDS since glibc is not build when we compile
64 # GCC --first-pass
65 if [ ! "/var/lib/tazpkg/installed/cross-arm-glibc" ]; then
66 tazpkg -i /home/slitaz/packages/cross-arm-glibc-2.14.1.tazpkg
67 fi
69 # This will fix GCC final build since we dont use --with-sysroot=.
70 # Without that we go errors such as: cannot find crtn.o
71 echo "cook: moving ldscripts to: ${CROSS_PREFIX}/lib"
72 cd ${CROSS_PREFIX}/$CROSS_TARGET
73 mv lib/ldscripts ../lib
74 rm -rf lib
75 echo "cook: creating symlinks in: ${CROSS_PREFIX}/$CROSS_TARGET"
76 ln -s ../lib lib
77 ln -s ../include include
79 cd $WOK/$PACKAGE/source/build
80 $src/configure \
81 --prefix=$CROSS_PREFIX \
82 --libexec=$CROSS_PREFIX/lib \
83 --enable-shared \
84 --enable-languages=c,c++ \
85 --enable-c99 \
86 --enable-long-long \
87 --enable-__cxa_atexit \
88 --disable-threads \
89 $CROSS_TRIPLET &&
90 make && make install ;;
91 esac
93 # Some configure options I have tested (pankso)
94 #--libexec=$CROSS_PREFIX/lib
95 #--disable-threads
96 #--disable-checking
97 #--disable-shared
98 #--disable-nls
99 #--enable-multilib
100 #--enable-addons
101 #--enable-softfloat
102 #--with-float=soft
103 #--disable-decimal-float
104 #--enable-interwork
105 #--disable-libgomp
106 #--disable-libmudflap
107 #--disable-libssp
108 }
110 # Rules to gen a SliTaz package suitable for Tazpkg.
111 genpkg_rules()
112 {
113 mkdir -p $fs/usr
114 cp -a $install/usr/cross $fs/usr
115 rm -rf ${fs}${CROSS_PREFIX}/share
116 }