wok-next view gcc/receipt @ rev 20176

gcc: split libatomic (thanks alanyih)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Nov 02 01:17:20 2017 +0200 (2017-11-02)
parents 38cf0c75fa4c
children 90a5eb560fd6
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 \
17 libatomic gcc"
19 compile_rules() {
20 # Handle cross compilation (native i486/ARM gcc)
21 case "$ARCH" in
22 i?86)
23 ARCH_ARGS="--with-tune=$ARCH"
24 pkgversion="SliTaz"
25 languages="c,c++,objc,fortran" ;;
26 arm*)
27 pkgversion="SliTaz ARM"
28 languages="c,c++" ;;
29 esac
31 # Package slitaz-toolchain use 'cook --options' when rebuilding
32 # the full SliTaz toolchain.
33 [ "$2" == "--first-pass" ] && opt=$2
34 [ "$3" == "--first-pass" ] && opt=$3
36 # Use libiberty.a from binutils.
37 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || return 1
39 case "$ARCH" in
40 i?86) sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in ;;
41 esac
43 #sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
45 mkdir -p ../gcc-build && cd ../gcc-build
47 # This is the default GCC and we want a native build to cross compile after.
48 # SliTaz target i486 host so we need a native i486 build for GCC.
49 case "$opt" in
50 --first-pass)
51 # Used by slitaz-toolchain when rebuilding the full toolchain.
52 echo "cook: configure GCC for: toolchain first pass"
53 $src/configure \
54 --libexecdir=/usr/lib \
55 --disable-nls \
56 --enable-shared \
57 --enable-languages=c,c++ \
58 --disable-libstdcxx-pch \
59 --enable-__cxa_atexit \
60 --enable-clocale=gnu \
61 --enable-threads=posix \
62 --disable-bootstrap \
63 ${CONFIGURE_ARGS}
64 ;;
65 *)
66 # Used by default to produce a full featured X86 GCC compiler.
67 echo "cook: configure GCC for: final/full build"
68 $src/configure \
69 --libexecdir=/usr/lib \
70 --enable-nls \
71 --enable-languages=${languages} \
72 --enable-shared \
73 --with-system-zlib \
74 --enable-clocale=gnu \
75 --enable-objc-gc \
76 --enable-__cxa_atexit \
77 --enable-lto \
78 --enable-threads=posix \
79 --disable-bootstrap \
80 --with-pkgversion="$pkgversion" \
81 ${CONFIGURE_ARGS} ${ARCH_ARGS}
82 ;;
83 esac &&
84 make && make install
86 # ARM packages use another libs...
87 case "$ARCH" in
88 arm)
89 libdir="$CROSS_TREE/tools/arm-slitaz-linux-gnueabi/lib"
90 cp -af $libdir/libgcc_s.so* $install/usr/lib # for gcc-lib-base
91 cp -af $libdir/libstdc++.so* $install/usr/lib
92 cp -af $libdir/libquadmath.so* $install/usr/lib # for gcc-lib-math
93 ;;
94 esac
96 # Remove build directory.
97 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
98 rm -rf $WOK/$PACKAGE/$PACKAGE-build
99 }
101 genpkg_rules() {
102 case $PACKAGE in
103 gcc-lib-base)
104 copy libgcc_s.so* libstdc++.so*
105 rm $fs/usr/lib/*.py
106 CAT="libs|base libraries"
107 DEPENDS="glibc-base"
108 ;;
109 gcc-lib-math)
110 copy libquadmath.so*
111 CAT="libs|math libraries"
112 DEPENDS="glibc-base"
113 ;;
114 libgfortran)
115 copy libgfortran.so*
116 CAT="libdevel|fortran runtime"
117 DEPENDS="gcc-lib-base gcc-lib-math glibc-base"
118 ;;
119 gfortran)
120 copy *gfortran libgfortran.* f951 finclude/ @rm
121 CAT="development|fortran extension"
122 TAGS="compiler fortran"
123 DEPENDS="libgfortran gcc glibc-base gmp mpc-library mpfr zlib"
124 ;;
125 libgomp)
126 copy libgomp.so*
127 CAT="libs|API specification for parallel programming"
128 DEPENDS="glibc-base"
129 ;;
130 libobjc)
131 copy libobjc.so*
132 CAT="libdevel|API for gcc object"
133 DEPENDS="gcc-lib-base glibc-base"
134 ;;
135 libatomic)
136 copy libatomic.so*
137 CAT="libs|libatomic"
138 DEPENDS=" "
139 ;;
140 gcc)
141 copy bin/ lib/ include/ *.py @rm
142 DEPENDS="gcc-lib-base libgomp libobjc libatomic \
143 glibc-base gmp mpc-library mpfr zlib binutils elfutils"
144 SUGGESTED="python"
145 TAGS="compiler C"
146 ;;
147 esac
148 }
150 post_install_gcc() {
151 [ -f "$1/lib/cpp" ] || ln -s ../usr/bin/cpp "$1/lib"
152 [ -f "$1/usr/bin/cc" ] || ln -s gcc "$1/usr/bin/cc"
153 }