wok-next view gcc/receipt @ rev 20869
mono: fix build on 32-bit
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Mon Jul 02 10:15:48 2018 +0300 (2018-07-02) |
parents | 90a5eb560fd6 |
children | d5aab818505e |
line source
1 # SliTaz package receipt v2.
3 # Note, currently first pass is broken. Sorry.
4 PACKAGE="gcc"
5 VERSION="7.3.0"
6 CATEGORY="development"
7 SHORT_DESC="The GNU Compiler Collection"
8 MAINTAINER="pankso@slitaz.org"
9 LICENSE="GPL2"
10 WEB_SITE="http://gcc.gnu.org/"
11 LFS="http://www.linuxfromscratch.org/lfs/view/stable/chapter06/gcc.html"
13 TARBALL="$PACKAGE-$VERSION.tar.xz"
14 WGET_URL="http://ftp.gnu.org/gnu/gcc/gcc-$VERSION/$TARBALL"
16 BUILD_DEPENDS="mpc-library-dev mpfr-dev gmp-dev elfutils-dev zlib-dev"
17 SPLIT="gcc-lib-base gcc-lib-math libgfortran gfortran libgomp libobjc \
18 libatomic gcc"
20 if [ "$2" == "--first-pass" -o "$3" == "--first-pass" ]; then
21 STAGE='first'
22 SPLIT=''
23 fi
25 compile_rules() {
26 # Handle cross compilation (native i486/ARM gcc)
27 case "$ARCH" in
28 i?86)
29 ARCH_ARGS="--with-tune=$ARCH"
30 pkgversion="SliTaz"
31 languages="c,c++,objc,fortran"
32 sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in
33 ;;
34 x86_64)
35 ARCH_ARGS=""
36 pkgversion="SliTaz64"
37 languages="c,c++,objc,fortran"
38 sed -i.orig '/m64=/ s|lib64|lib|' gcc/config/i386/t-linux64
39 ;;
40 arm*)
41 ARCH_ARGS=""
42 pkgversion="SliTaz ARM"
43 languages="c,c++"
44 ;;
45 esac
47 # Use libiberty.a from binutils.
48 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || return 1
50 case "$STAGE" in
51 first)
52 echo "cook: configure GCC for: toolchain first pass"
54 mkdir build
55 cd build
56 ../configure \
57 --with-newlib \
58 --without-headers \
59 --disable-nls \
60 --disable-shared \
61 --disable-multilib \
62 --disable-decimal-float \
63 --disable-threads \
64 --disable-libatomic \
65 --disable-libgomp \
66 --disable-libmpx \
67 --disable-libquadmath \
68 --disable-libssp \
69 --disable-libvtv \
70 --disable-libstdcxx \
71 --enable-languages=c,c++ \
72 $CONFIGURE_ARGS
73 ;;
74 *)
75 echo "cook: configure GCC for: final/full build"
77 mkdir build
78 cd build
79 SED=sed \
80 ../configure \
81 --enable-languages=$languages \
82 --disable-multilib \
83 --disable-bootstrap \
84 --with-system-zlib \
85 --with-pkgversion="$pkgversion" \
86 $CONFIGURE_ARGS $ARCH_ARGS
87 ;;
88 esac &&
89 make && make install || return 1
91 mkdir -p $install/lib
92 ln -sv ../usr/bin/cpp $install/lib
94 ln -sv gcc $install/usr/bin/cc
96 install -v -dm755 $install/usr/lib/bfd-plugins
97 ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/$VERSION/liblto_plugin.so \
98 $install/usr/lib/bfd-plugins/
101 # ARM packages use another libs...
102 case "$ARCH" in
103 arm)
104 libdir="$CROSS_TREE/tools/arm-slitaz-linux-gnueabi/lib"
105 cp -af $libdir/libgcc_s.so* $install/usr/lib # for gcc-lib-base
106 cp -af $libdir/libstdc++.so* $install/usr/lib
107 cp -af $libdir/libquadmath.so* $install/usr/lib # for gcc-lib-math
108 ;;
109 esac
112 # Place the debugging symbols for selected libraries in separate files.
113 # This debugging information is needed if running regression tests that use valgrind or gdb.
114 # http://www.linuxfromscratch.org/lfs/view/stable/chapter06/strippingagain.html
116 [ "$STAGE" == 'first' ] ||
117 for i in libquadmath.so.0.0.0 libstdc++.so.6.0.24 libmpx.so.2.0.1 \
118 libmpxwrappers.so.2.0.1 libitm.so.1.0.0 libcilkrts.so.5.0.0 \
119 libatomic.so.1.2.0; do
120 cd $install/usr/lib/
121 objcopy --only-keep-debug $i $i.dbg
122 strip --strip-unneeded $i
123 objcopy --add-gnu-debuglink=$i.dbg $i
124 done
125 }
127 genpkg_rules() {
128 case $STAGE in
129 first)
130 # single package 'gcc' on the first stage
131 copy @std @dev
132 DEPENDS="glibc-base gmp mpc-library mpfr zlib binutils elfutils"
133 CAT="development|first pass"
134 TAGS="LFS compiler C"
135 return 0
136 ;;
137 esac
139 case $PACKAGE in
140 gcc-lib-base)
141 copy libgcc_s.so* libstdc++.so*
142 rm $fs/usr/lib*/*.py
143 CAT="libs|base libraries"
144 DEPENDS="glibc-base"
145 ;;
146 gcc-lib-math)
147 copy libquadmath.so*
148 CAT="libs|math libraries"
149 DEPENDS="glibc-base"
150 ;;
151 libgfortran)
152 copy libgfortran.so*
153 CAT="libdevel|fortran runtime"
154 DEPENDS="gcc-lib-base gcc-lib-math glibc-base"
155 ;;
156 gfortran)
157 copy *gfortran libgfortran.* f951 finclude/ @rm
158 CAT="development|fortran extension"
159 TAGS="compiler fortran"
160 DEPENDS="libgfortran gcc glibc-base gmp mpc-library mpfr zlib"
161 ;;
162 libgomp)
163 copy libgomp.so*
164 CAT="libs|API specification for parallel programming"
165 DEPENDS="glibc-base"
166 ;;
167 libobjc)
168 copy libobjc.so*
169 CAT="libdevel|API for gcc object"
170 DEPENDS="gcc-lib-base glibc-base"
171 ;;
172 libatomic)
173 copy libatomic.so*
174 CAT="libs|libatomic"
175 DEPENDS=" "
176 ;;
177 gcc)
178 copy @std @dev @rm
179 DEPENDS="gcc-lib-base libgomp libobjc libatomic \
180 glibc-base gmp mpc-library mpfr zlib binutils elfutils"
181 SUGGESTED="python"
182 TAGS="LFS compiler C"
183 ;;
184 esac
185 }