wok-next annotate gcc/receipt @ rev 16462

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