wok-next view gcc/receipt @ rev 20074
Up dooble, smtube
author | Xander Ziiryanoff <psychomaniak@xakep.ru> |
---|---|
date | Wed Oct 25 05:01:33 2017 +0200 (2017-10-25) |
parents | 2f3aba6cc31e |
children | b21fe9fb3791 |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="gcc"
4 VERSION="6.3.0"
5 CATEGORY="development"
6 SHORT_DESC="The GNU Compiler Collection"
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="http://gcc.gnu.org/"
10 #HOST_ARCH="i486 arm"
12 TARBALL="$PACKAGE-$VERSION.tar.bz2"
13 WGET_URL="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$VERSION/$TARBALL"
15 BUILD_DEPENDS="mpc-library-dev mpfr-dev gmp-dev elfutils-dev zlib-dev"
16 SPLIT="gcc-lib-base gcc-lib-math libgfortran gfortran libgomp libobjc gcc"
18 # Handle cross compilation (native i486/ARM gcc)
19 case "$ARCH" in
20 i?86)
21 ARCH_ARGS="--with-tune=$ARCH"
22 pkgversion="SliTaz"
23 languages="c,c++,objc,fortran" ;;
24 arm*)
25 pkgversion="SliTaz ARM"
26 languages="c,c++" ;;
27 esac
29 # Rules to configure and make the package.
30 compile_rules()
31 {
32 # Package slitaz-toolchain use 'cook --options' when rebuilding
33 # the full SliTaz toolchain.
34 [ "$2" == "--first-pass" ] && opt=$2
35 [ "$3" == "--first-pass" ] && opt=$3
37 # Use libiberty.a from binutils.
38 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || return 1
40 case "$ARCH" in
41 i?86) sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in ;;
42 esac
44 #sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
46 mkdir -p ../gcc-build && cd ../gcc-build
48 # This is the default GCC and we want a native build to cross compile after.
49 # SliTaz target i486 host so we need a native i486 build for GCC.
50 case "$opt" in
51 --first-pass)
52 # Used by slitaz-toolchain when rebuilding the full toolchain.
53 echo "cook: configure GCC for: toolchain first pass"
54 $src/configure \
55 --libexecdir=/usr/lib \
56 --disable-nls \
57 --enable-shared \
58 --enable-languages=c,c++ \
59 --disable-libstdcxx-pch \
60 --enable-__cxa_atexit \
61 --enable-clocale=gnu \
62 --enable-threads=posix \
63 --disable-bootstrap \
64 ${CONFIGURE_ARGS}
65 ;;
66 *)
67 # Used by default to produce a full featured X86 GCC compiler.
68 echo "cook: configure GCC for: final/full build"
69 $src/configure \
70 --libexecdir=/usr/lib \
71 --enable-nls \
72 --enable-languages=${languages} \
73 --enable-shared \
74 --with-system-zlib \
75 --enable-clocale=gnu \
76 --enable-objc-gc \
77 --enable-__cxa_atexit \
78 --enable-lto \
79 --enable-threads=posix \
80 --disable-bootstrap \
81 --with-pkgversion="$pkgversion" \
82 ${CONFIGURE_ARGS} ${ARCH_ARGS}
83 ;;
84 esac &&
85 make && make install
87 # ARM packages use another libs...
88 case "$ARCH" in
89 arm)
90 libdir="$CROSS_TREE/tools/arm-slitaz-linux-gnueabi/lib"
91 cp -af $libdir/libgcc_s.so* $install/usr/lib # for gcc-lib-base
92 cp -af $libdir/libstdc++.so* $install/usr/lib
93 cp -af $libdir/libquadmath.so* $install/usr/lib # for gcc-lib-math
94 ;;
95 esac
97 # Remove build directory.
98 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
99 rm -rf $WOK/$PACKAGE/$PACKAGE-build
100 }
102 # Rules to gen a SliTaz package suitable for Tazpkg.
103 genpkg_rules()
104 {
105 case $PACKAGE in
106 gcc-lib-base)
107 copy libgcc_s.so* libstdc++.so*
108 rm $fs/usr/lib/*.py
109 CAT="development|base libraries"
110 DEPENDS="glibc-base"
111 ;;
112 gcc-lib-math)
113 copy libquadmath.so*
114 CAT="development|math libraries"
115 DEPENDS="glibc-base"
116 ;;
117 libgfortran)
118 copy libgfortran.so*
119 CAT="libdevel|fortran runtime"
120 DEPENDS="gcc-lib-base gcc-lib-math glibc-base"
121 ;;
122 gfortran)
123 copy *gfortran libgfortran.* f951 finclude/
124 remove_already_packed
125 CAT="development|fortran extension"
126 TAGS="compiler fortran"
127 DEPENDS="libgfortran gcc glibc-base gmp mpc-library mpfr zlib"
128 ;;
129 libgomp)
130 copy libgomp.so*
131 CAT="development|API specification for parallel programming"
132 DEPENDS="glibc-base"
133 ;;
134 libobjc)
135 copy libobjc.so*
136 CAT="libdevel|API for gcc object"
137 DEPENDS="gcc-lib-base glibc-base"
138 ;;
139 gcc)
140 copy bin/ lib/ include/ *.py
141 remove_already_packed
142 DEPENDS="gcc-lib-base libgomp libobjc \
143 glibc-base gmp mpc-library mpfr zlib binutils elfutils"
144 SUGGESTED="python"
145 TAGS="compiler C"
146 ;;
147 esac
148 }
150 # Post install commands for Tazpkg.
151 post_install_gcc()
152 {
153 [ -f "$1/lib/cpp" ] || ln -s ../usr/bin/cpp "$1/lib"
154 [ -f "$1/usr/bin/cc" ] || ln -s gcc "$1/usr/bin/cc"
155 }