wok-next view gcc/receipt @ rev 20436

Update packages listed in the LFS book.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Feb 21 19:48:17 2018 +0200 (2018-02-21)
parents b21fe9fb3791
children a429b73c2d89
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 ln -sv ../usr/bin/cpp $install/lib
92 ln -sv gcc $install/usr/bin/cc
93 install -v -dm755 $install/usr/lib/bfd-plugins
94 ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/$VERSION/liblto_plugin.so \
95 $install/usr/lib/bfd-plugins/
98 # ARM packages use another libs...
99 case "$ARCH" in
100 arm)
101 libdir="$CROSS_TREE/tools/arm-slitaz-linux-gnueabi/lib"
102 cp -af $libdir/libgcc_s.so* $install/usr/lib # for gcc-lib-base
103 cp -af $libdir/libstdc++.so* $install/usr/lib
104 cp -af $libdir/libquadmath.so* $install/usr/lib # for gcc-lib-math
105 ;;
106 esac
109 # Place the debugging symbols for selected libraries in separate files.
110 # This debugging information is needed if running regression tests that use valgrind or gdb.
111 # http://www.linuxfromscratch.org/lfs/view/stable/chapter06/strippingagain.html
113 [ "$STAGE" == 'first' ] ||
114 for i in libquadmath.so.0.0.0 libstdc++.so.6.0.24 libmpx.so.2.0.1 \
115 libmpxwrappers.so.2.0.1 libitm.so.1.0.0 libcilkrts.so.5.0.0 \
116 libatomic.so.1.2.0; do
117 cd $install/usr/lib/
118 objcopy --only-keep-debug $i $i.dbg
119 strip --strip-unneeded $i
120 objcopy --add-gnu-debuglink=$i.dbg $i
121 done
122 }
124 genpkg_rules() {
125 case $STAGE in
126 first)
127 # single package 'gcc' on the first stage
128 copy @std @dev
129 DEPENDS="glibc-base gmp mpc-library mpfr zlib binutils elfutils"
130 CAT="development|first pass"
131 TAGS="LFS compiler C"
132 return 0
133 ;;
134 esac
136 case $PACKAGE in
137 gcc-lib-base)
138 copy libgcc_s.so* libstdc++.so*
139 rm $fs/usr/lib*/*.py
140 CAT="libs|base libraries"
141 DEPENDS="glibc-base"
142 ;;
143 gcc-lib-math)
144 copy libquadmath.so*
145 CAT="libs|math libraries"
146 DEPENDS="glibc-base"
147 ;;
148 libgfortran)
149 copy libgfortran.so*
150 CAT="libdevel|fortran runtime"
151 DEPENDS="gcc-lib-base gcc-lib-math glibc-base"
152 ;;
153 gfortran)
154 copy *gfortran libgfortran.* f951 finclude/ @rm
155 CAT="development|fortran extension"
156 TAGS="compiler fortran"
157 DEPENDS="libgfortran gcc glibc-base gmp mpc-library mpfr zlib"
158 ;;
159 libgomp)
160 copy libgomp.so*
161 CAT="libs|API specification for parallel programming"
162 DEPENDS="glibc-base"
163 ;;
164 libobjc)
165 copy libobjc.so*
166 CAT="libdevel|API for gcc object"
167 DEPENDS="gcc-lib-base glibc-base"
168 ;;
169 libatomic)
170 copy libatomic.so*
171 CAT="libs|libatomic"
172 DEPENDS=" "
173 ;;
174 gcc)
175 copy @std @dev @rm
176 DEPENDS="gcc-lib-base libgomp libobjc libatomic \
177 glibc-base gmp mpc-library mpfr zlib binutils elfutils"
178 SUGGESTED="python"
179 TAGS="LFS compiler C"
180 ;;
181 esac
182 }
184 post_install_gcc() {
185 [ -f "$1/lib/cpp" ] || ln -s ../usr/bin/cpp "$1/lib"
186 [ -f "$1/usr/bin/cc" ] || ln -s gcc "$1/usr/bin/cc"
187 }