wok diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gcc49/receipt Tue Mar 24 08:43:01 2015 +0100 1.3 @@ -0,0 +1,133 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="gcc49" 1.7 +SOURCE="gcc" 1.8 +VERSION="4.9.2" 1.9 +CATEGORY="development" 1.10 +SHORT_DESC="The the GNU Compiler Collection." 1.11 +MAINTAINER="pankso@slitaz.org" 1.12 +LICENSE="GPL2" 1.13 +TARBALL="$SOURCE-$VERSION.tar.bz2" 1.14 +WEB_SITE="http://gcc.gnu.org/" 1.15 +WGET_URL="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$VERSION/$TARBALL" 1.16 +TAGS="compiler C" 1.17 +#HOST_ARCH="i486 arm" 1.18 + 1.19 +# We need gawk since busybox awk is not sufficient. We have BUILD_DEPENDS 1.20 +# for cookutils that are not used by tazwok/cook-toolchain since it install 1.21 +# and use it's own copy. 1.22 +DEPENDS="binutils libgomp libobjc gcc-lib-base mpc-library elfutils" 1.23 +BUILD_DEPENDS="mpc-library mpfr-dev gmp-dev elfutils-dev" 1.24 + 1.25 +# Handle cross compilation (native i486/ARM gcc) 1.26 +case "$ARCH" in 1.27 + i?86) 1.28 + ARCH_ARGS="--with-tune=$ARCH" 1.29 + pkgversion="SliTaz" 1.30 + languages="c,c++,objc,fortran" ;; 1.31 + arm*) 1.32 + pkgversion="SliTaz ARM" 1.33 + languages="c,c++" ;; 1.34 +esac 1.35 + 1.36 +# Rules to configure and make the package. 1.37 +compile_rules() 1.38 +{ 1.39 + # Package slitaz-toolchain use 'cook --options' when rebuilding 1.40 + # the full SliTaz toolchain. 1.41 + [ "$2" == "--first-pass" ] && opt=$2 1.42 + [ "$3" == "--first-pass" ] && opt=$3 1.43 + 1.44 + # Use libiberty.a from binutils. 1.45 + sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || return 1 1.46 + 1.47 + case "$ARCH" in 1.48 + i?86) sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in ;; 1.49 + esac 1.50 + 1.51 + #sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in 1.52 + 1.53 + mkdir -p ../gcc-build && cd ../gcc-build 1.54 + 1.55 + # This is the default GCC and we want a native build to cross compile after. 1.56 + # SliTaz target i486 host so we need a native i486 build for GCC. 1.57 + case "$opt" in 1.58 + --first-pass) 1.59 + # Used by slitaz-toolchain when rebuilding the full toolchain. 1.60 + echo "cook: configure GCC for: toolchain first pass" 1.61 + $src/configure \ 1.62 + --libexecdir=/usr/lib \ 1.63 + --disable-nls \ 1.64 + --enable-shared \ 1.65 + --enable-languages=c,c++ \ 1.66 + --disable-libstdcxx-pch \ 1.67 + --enable-__cxa_atexit \ 1.68 + --enable-clocale=gnu \ 1.69 + --enable-threads=posix \ 1.70 + --disable-bootstrap \ 1.71 + --program-suffix=-49 \ 1.72 + ${CONFIGURE_ARGS} && 1.73 + make && make install ;; 1.74 + *) 1.75 + # Used by default to produce a full featured X86 GCC compiler. 1.76 + echo "cook: configure GCC for: final/full build" 1.77 + $src/configure \ 1.78 + --libexecdir=/usr/lib \ 1.79 + --enable-nls \ 1.80 + --enable-languages=${languages} \ 1.81 + --enable-shared \ 1.82 + --with-system-zlib \ 1.83 + --enable-clocale=gnu \ 1.84 + --enable-objc-gc \ 1.85 + --enable-__cxa_atexit \ 1.86 + --enable-lto \ 1.87 + --enable-threads=posix \ 1.88 + --disable-bootstrap \ 1.89 + --program-suffix=-49 \ 1.90 + --with-pkgversion="$pkgversion" \ 1.91 + ${CONFIGURE_ARGS} ${ARCH_ARGS} && 1.92 + make && make install ;; 1.93 + esac 1.94 +} 1.95 + 1.96 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.97 +genpkg_rules() 1.98 +{ 1.99 + mkdir -p $fs/usr/share 1.100 + cp -a $install/usr/bin $fs/usr 1.101 + 1.102 + # Copy all libs. Remove libgcc_s.so and libstdc++.so they goes in 1.103 + # the gcc-lib-base package. 1.104 + cp -a $install/usr/lib $fs/usr 1.105 + rm -f $fs/usr/lib/libgcc_s.so* 1.106 + rm -f $fs/usr/lib/libstdc++.so* 1.107 + rm -f $fs/usr/lib/libgomp.so* 1.108 + rm -f $fs/usr/lib/libobjc.so* 1.109 + 1.110 + # Include files. 1.111 + cp -a $install/usr/include $fs/usr 1.112 + 1.113 + # Gfortran goes in gfortran package. 1.114 + rm -f $fs/usr/bin/*gfortran 1.115 + rm -f $fs/usr/lib/libgfortran* 1.116 + rm -f $fs/usr/lib/gcc/*/$VERSION/libgfortran* 1.117 + rm -rf $fs/usr/lib/gcc/*/$VERSION/f* 1.118 + 1.119 + # Remove build directory. 1.120 + rm -rf $WOK/$PACKAGE/source/$PACKAGE-build 1.121 + rm -rf $WOK/$PACKAGE/$PACKAGE-build 1.122 +} 1.123 + 1.124 +# Post install commands for Tazpkg. 1.125 +post_install() 1.126 +{ 1.127 + local root 1.128 + root=$1 1.129 + echo "Processing post-install commands..." 1.130 + if [ ! -f "$root/lib/cpp" ]; then 1.131 + ln -s ../usr/bin/cpp $root/lib 1.132 + fi 1.133 + if [ ! -f "$root/usr/bin/cc" ]; then 1.134 + ln -s gcc $root/usr/bin/cc 1.135 + fi 1.136 +}