wok view gcc49/receipt @ rev 17845

Add gcc49
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Mar 24 08:43:01 2015 +0100 (2015-03-24)
parents
children ae76ef329371
line source
1 # SliTaz package receipt.
3 PACKAGE="gcc49"
4 SOURCE="gcc"
5 VERSION="4.9.2"
6 CATEGORY="development"
7 SHORT_DESC="The the GNU Compiler Collection."
8 MAINTAINER="pankso@slitaz.org"
9 LICENSE="GPL2"
10 TARBALL="$SOURCE-$VERSION.tar.bz2"
11 WEB_SITE="http://gcc.gnu.org/"
12 WGET_URL="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$VERSION/$TARBALL"
13 TAGS="compiler C"
14 #HOST_ARCH="i486 arm"
16 # We need gawk since busybox awk is not sufficient. We have BUILD_DEPENDS
17 # for cookutils that are not used by tazwok/cook-toolchain since it install
18 # and use it's own copy.
19 DEPENDS="binutils libgomp libobjc gcc-lib-base mpc-library elfutils"
20 BUILD_DEPENDS="mpc-library mpfr-dev gmp-dev elfutils-dev"
22 # Handle cross compilation (native i486/ARM gcc)
23 case "$ARCH" in
24 i?86)
25 ARCH_ARGS="--with-tune=$ARCH"
26 pkgversion="SliTaz"
27 languages="c,c++,objc,fortran" ;;
28 arm*)
29 pkgversion="SliTaz ARM"
30 languages="c,c++" ;;
31 esac
33 # Rules to configure and make the package.
34 compile_rules()
35 {
36 # Package slitaz-toolchain use 'cook --options' when rebuilding
37 # the full SliTaz toolchain.
38 [ "$2" == "--first-pass" ] && opt=$2
39 [ "$3" == "--first-pass" ] && opt=$3
41 # Use libiberty.a from binutils.
42 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || return 1
44 case "$ARCH" in
45 i?86) sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in ;;
46 esac
48 #sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
50 mkdir -p ../gcc-build && cd ../gcc-build
52 # This is the default GCC and we want a native build to cross compile after.
53 # SliTaz target i486 host so we need a native i486 build for GCC.
54 case "$opt" in
55 --first-pass)
56 # Used by slitaz-toolchain when rebuilding the full toolchain.
57 echo "cook: configure GCC for: toolchain first pass"
58 $src/configure \
59 --libexecdir=/usr/lib \
60 --disable-nls \
61 --enable-shared \
62 --enable-languages=c,c++ \
63 --disable-libstdcxx-pch \
64 --enable-__cxa_atexit \
65 --enable-clocale=gnu \
66 --enable-threads=posix \
67 --disable-bootstrap \
68 --program-suffix=-49 \
69 ${CONFIGURE_ARGS} &&
70 make && make install ;;
71 *)
72 # Used by default to produce a full featured X86 GCC compiler.
73 echo "cook: configure GCC for: final/full build"
74 $src/configure \
75 --libexecdir=/usr/lib \
76 --enable-nls \
77 --enable-languages=${languages} \
78 --enable-shared \
79 --with-system-zlib \
80 --enable-clocale=gnu \
81 --enable-objc-gc \
82 --enable-__cxa_atexit \
83 --enable-lto \
84 --enable-threads=posix \
85 --disable-bootstrap \
86 --program-suffix=-49 \
87 --with-pkgversion="$pkgversion" \
88 ${CONFIGURE_ARGS} ${ARCH_ARGS} &&
89 make && make install ;;
90 esac
91 }
93 # Rules to gen a SliTaz package suitable for Tazpkg.
94 genpkg_rules()
95 {
96 mkdir -p $fs/usr/share
97 cp -a $install/usr/bin $fs/usr
99 # Copy all libs. Remove libgcc_s.so and libstdc++.so they goes in
100 # the gcc-lib-base package.
101 cp -a $install/usr/lib $fs/usr
102 rm -f $fs/usr/lib/libgcc_s.so*
103 rm -f $fs/usr/lib/libstdc++.so*
104 rm -f $fs/usr/lib/libgomp.so*
105 rm -f $fs/usr/lib/libobjc.so*
107 # Include files.
108 cp -a $install/usr/include $fs/usr
110 # Gfortran goes in gfortran package.
111 rm -f $fs/usr/bin/*gfortran
112 rm -f $fs/usr/lib/libgfortran*
113 rm -f $fs/usr/lib/gcc/*/$VERSION/libgfortran*
114 rm -rf $fs/usr/lib/gcc/*/$VERSION/f*
116 # Remove build directory.
117 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
118 rm -rf $WOK/$PACKAGE/$PACKAGE-build
119 }
121 # Post install commands for Tazpkg.
122 post_install()
123 {
124 local root
125 root=$1
126 echo "Processing post-install commands..."
127 if [ ! -f "$root/lib/cpp" ]; then
128 ln -s ../usr/bin/cpp $root/lib
129 fi
130 if [ ! -f "$root/usr/bin/cc" ]; then
131 ln -s gcc $root/usr/bin/cc
132 fi
133 }