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