wok-next view gcc/receipt @ rev 21020

Cleaning is almost finished... I should proceed to upgrades.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Nov 02 14:15:08 2018 +0200 (2018-11-02)
parents a429b73c2d89
children d03cdb2a688a
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="devel@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="$PACKAGE-lib-base $PACKAGE-lib-math libgfortran gfortran libgomp libobjc \
18 libatomic $PACKAGE"
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 esac
42 # Use libiberty.a from binutils.
43 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || return 1
45 case "$STAGE" in
46 first)
47 echo "cook: configure GCC for: toolchain first pass"
49 mkdir build
50 cd build
51 ../configure \
52 --with-newlib \
53 --without-headers \
54 --disable-nls \
55 --disable-shared \
56 --disable-multilib \
57 --disable-decimal-float \
58 --disable-threads \
59 --disable-libatomic \
60 --disable-libgomp \
61 --disable-libmpx \
62 --disable-libquadmath \
63 --disable-libssp \
64 --disable-libvtv \
65 --disable-libstdcxx \
66 --enable-languages=c,c++ \
67 $CONFIGURE_ARGS
68 ;;
69 *)
70 echo "cook: configure GCC for: final/full build"
72 mkdir build
73 cd build
74 SED=sed \
75 ../configure \
76 --enable-languages=$languages \
77 --disable-multilib \
78 --disable-bootstrap \
79 --with-system-zlib \
80 --with-pkgversion="$pkgversion" \
81 $CONFIGURE_ARGS $ARCH_ARGS
82 ;;
83 esac &&
84 make &&
85 make install || return 1
87 mkdir -p $install/lib
88 ln -sv ../usr/bin/cpp $install/lib
90 ln -sv gcc $install/usr/bin/cc
92 install -v -dm755 $install/usr/lib/bfd-plugins
93 ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/$VERSION/liblto_plugin.so \
94 $install/usr/lib/bfd-plugins/
97 # Place the debugging symbols for selected libraries in separate files.
98 # This debugging information is needed if running regression tests that use valgrind or gdb.
99 # http://www.linuxfromscratch.org/lfs/view/stable/chapter06/strippingagain.html
101 [ "$STAGE" == 'first' ] ||
102 for i in libquadmath.so.0.0.0 libstdc++.so.6.0.24 libmpx.so.2.0.1 \
103 libmpxwrappers.so.2.0.1 libitm.so.1.0.0 libcilkrts.so.5.0.0 \
104 libatomic.so.1.2.0; do
105 cd $install/usr/lib/
106 objcopy --only-keep-debug $i $i.dbg
107 strip --strip-unneeded $i
108 objcopy --add-gnu-debuglink=$i.dbg $i
109 done
110 }
112 genpkg_rules() {
113 case $STAGE in
114 first)
115 # single package 'gcc' on the first stage
116 copy @std @dev
117 DEPENDS="glibc-base gmp mpc-library mpfr zlib binutils elfutils"
118 CAT="development|first pass"
119 TAGS="LFS compiler C"
120 return 0
121 ;;
122 esac
124 case $PACKAGE in
125 gcc-lib-base)
126 copy libgcc_s.so* libstdc++.so*
127 rm $fs/usr/lib*/*.py
128 CAT="libs|base libraries"
129 DEPENDS="glibc-base"
130 ;;
131 gcc-lib-math)
132 copy libquadmath.so*
133 CAT="libs|math libraries"
134 DEPENDS="glibc-base"
135 ;;
136 libgfortran)
137 copy libgfortran.so*
138 CAT="libdevel|fortran runtime"
139 DEPENDS="gcc-lib-base gcc-lib-math glibc-base"
140 ;;
141 gfortran)
142 copy *gfortran libgfortran.* f951 finclude/ @rm
143 CAT="development|fortran extension"
144 TAGS="compiler fortran"
145 DEPENDS="libgfortran gcc glibc-base gmp mpc-library mpfr zlib"
146 ;;
147 libgomp)
148 copy libgomp.so*
149 CAT="libs|API specification for parallel programming"
150 DEPENDS="glibc-base"
151 ;;
152 libobjc)
153 copy libobjc.so*
154 CAT="libdevel|API for gcc object"
155 DEPENDS="gcc-lib-base glibc-base"
156 ;;
157 libatomic)
158 copy libatomic.so*
159 CAT="libs|libatomic"
160 DEPENDS=" "
161 ;;
162 gcc)
163 copy @std @dev @rm
164 DEPENDS="gcc-lib-base libgomp libobjc libatomic \
165 glibc-base gmp mpc-library mpfr zlib binutils elfutils"
166 SUGGESTED="python"
167 TAGS="LFS compiler C"
168 ;;
169 esac
170 }