wok-next view gcc/receipt @ rev 21715
Up cookutils (1146)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Jul 28 07:53:22 2020 +0000 (2020-07-28) |
parents | d03cdb2a688a |
children |
line source
1 # SliTaz package receipt v2.
3 # Note, currently first pass is broken. Sorry.
4 PACKAGE="gcc"
5 VERSION="8.2.0"
6 CATEGORY="development"
7 SHORT_DESC="The GNU Compiler Collection"
8 MAINTAINER="devel@slitaz.org"
9 LICENSE="GPL2"
10 WEB_SITE="http://gcc.gnu.org/"
11 LFS="http://www.linuxfromscratch.org/lfs/view/development/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="$PACKAGE-debug $PACKAGE-lib-base $PACKAGE-lib-math libgfortran \
18 gfortran libgomp libobjc libatomic $PACKAGE"
19 COOKOPTS="skip-log-errors"
21 if [ "$2" == "--first-pass" -o "$3" == "--first-pass" ]; then
22 STAGE='first'
23 SPLIT=''
24 fi
26 compile_rules() {
27 # Handle cross compilation (native i486/ARM gcc)
28 case "$ARCH" in
29 i?86)
30 ARCH_ARGS="--with-arch=$ARCH --with-tune=generic --enable-cld"
31 pkgversion="SliTaz"
32 languages="c,c++,objc,fortran"
33 sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in
34 ;;
35 x86_64)
36 ARCH_ARGS=""
37 pkgversion="SliTaz64"
38 languages="c,c++,objc,fortran"
39 sed -i.orig '/m64=/ s|lib64|lib|' gcc/config/i386/t-linux64
40 ;;
41 esac
43 # Use libiberty.a from binutils.
44 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || return 1
46 case "$STAGE" in
47 first)
48 echo "cook: configure GCC for: toolchain first pass"
50 mkdir build
51 cd build
52 ../configure \
53 --with-newlib \
54 --without-headers \
55 --disable-nls \
56 --disable-shared \
57 --disable-multilib \
58 --disable-decimal-float \
59 --disable-threads \
60 --disable-libatomic \
61 --disable-libgomp \
62 --disable-libmpx \
63 --disable-libquadmath \
64 --disable-libssp \
65 --disable-libvtv \
66 --disable-libstdcxx \
67 --enable-languages=c,c++ \
68 $CONFIGURE_ARGS
69 ;;
70 *)
71 echo "cook: configure GCC for: final/full build"
73 mkdir build
74 cd build
75 SED=sed \
76 ../configure \
77 --enable-languages=$languages \
78 --disable-multilib \
79 --disable-bootstrap \
80 --disable-libmpx \
81 --with-system-zlib \
82 --with-pkgversion="$pkgversion" \
83 $CONFIGURE_ARGS $ARCH_ARGS
84 ;;
85 esac &&
86 make &&
87 make install || return 1
89 mkdir -p $install/lib
90 ln -sv ../usr/bin/cpp $install/lib
92 ln -sv gcc $install/usr/bin/cc
94 install -v -dm755 $install/usr/lib/bfd-plugins
95 ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/$VERSION/liblto_plugin.so \
96 $install/usr/lib/bfd-plugins/
99 # Place the debugging symbols for selected libraries in separate files.
100 # This debugging information is needed if running regression tests that use valgrind or gdb.
101 # http://www.linuxfromscratch.org/lfs/view/stable/chapter06/strippingagain.html
103 [ "$STAGE" == 'first' ] ||
104 for i in libquadmath.so.0.0.0 libstdc++.so.6.0.25 libitm.so.1.0.0 \
105 libatomic.so.1.2.0; do
106 cd $install/usr/lib/
107 objcopy --only-keep-debug $i $i.dbg
108 strip --strip-unneeded $i
109 objcopy --add-gnu-debuglink=$i.dbg $i
110 done
111 }
113 genpkg_rules() {
114 case $STAGE in
115 first)
116 # single package 'gcc' on the first stage
117 copy @std @dev
118 DEPENDS="glibc-base gmp mpc-library mpfr zlib binutils elfutils"
119 CAT="development|first pass"
120 TAGS="LFS compiler C"
121 return 0
122 ;;
123 esac
125 case $PACKAGE in
126 gcc-debug)
127 copy *.dbg
128 ;;
129 gcc-lib-base)
130 copy libgcc_s.so* libstdc++.so* @rm
131 rm $fs/usr/lib*/*.py
132 CAT="libs|base libraries"
133 DEPENDS="glibc-base"
134 ;;
135 gcc-lib-math)
136 copy libquadmath.so* @rm
137 CAT="libs|math libraries"
138 DEPENDS="glibc-base"
139 ;;
140 libgfortran)
141 copy libgfortran.so*
142 CAT="libdevel|fortran runtime"
143 DEPENDS="gcc-lib-base gcc-lib-math glibc-base"
144 ;;
145 gfortran)
146 copy *gfortran libgfortran.* f951 finclude/ @rm
147 CAT="development|fortran extension"
148 TAGS="compiler fortran"
149 DEPENDS="libgfortran gcc glibc-base gmp mpc-library mpfr zlib"
150 ;;
151 libgomp)
152 copy libgomp.so*
153 CAT="libs|API specification for parallel programming"
154 DEPENDS="glibc-base"
155 ;;
156 libobjc)
157 copy libobjc.so*
158 CAT="libdevel|API for gcc object"
159 DEPENDS="gcc-lib-base glibc-base"
160 ;;
161 libatomic)
162 copy libatomic.so* @rm
163 CAT="libs|libatomic"
164 DEPENDS=" "
165 ;;
166 gcc)
167 copy @std @dev @rm
168 DEPENDS="gcc-lib-base libgomp libobjc libatomic \
169 glibc-base gmp mpc-library mpfr zlib binutils elfutils"
170 SUGGESTED="python"
171 TAGS="LFS compiler C"
172 ;;
173 esac
174 }