wok-current view gcc/receipt @ rev 25628

add libffi dep for git, required by git-remote-https
author Stanislas Leduc <shann@slitaz.org>
date Tue Sep 05 19:41:41 2023 +0000 (10 months ago)
parents 35db2ca0cb06
children a23978bfa665
line source
1 # SliTaz package receipt.
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 TARBALL="$PACKAGE-$VERSION.tar.bz2"
10 WEB_SITE="http://gcc.gnu.org/"
11 WGET_URL="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$VERSION/$TARBALL"
12 TAGS="compiler C"
13 #HOST_ARCH="i486 arm"
15 DEPENDS="binutils libgomp libobjc gcc-lib-base mpc-library elfutils"
16 BUILD_DEPENDS="mpc-library mpfr-dev gmp-dev elfutils-dev"
18 # Handle cross compilation (native i486/ARM gcc)
19 case "$ARCH" in
20 i?86)
21 ARCH_ARGS="--with-tune=$ARCH"
22 pkgversion="SliTaz"
23 languages="c,c++,objc,fortran" ;;
24 arm*)
25 pkgversion="SliTaz ARM"
26 languages="c,c++" ;;
27 esac
29 # What is the latest version available today?
30 current_version()
31 {
32 wget -O - 'https://gcc.gnu.org/git/?p=gcc.git;a=summary' 2>/dev/null | \
33 sed '/ release/!d;s|.*GCC ||;s| release.*||' | sort -Vr | sed q
34 }
36 # Rules to configure and make the package.
37 compile_rules()
38 {
39 # Package slitaz-toolchain use 'cook --options' when rebuilding
40 # the full SliTaz toolchain.
41 [ "$2" = "--first-pass" ] && opt=$2
42 [ "$3" = "--first-pass" ] && opt=$3
44 # Use libiberty.a from binutils.
45 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || return 1
47 case "$ARCH" in
48 i?86) sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in ;;
49 esac
51 #sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
53 # Allow build gcc 6.3.0 from gcc > 6.3.0
54 patch -p1 < $stuff/gcc-6.3.0-ubsan.patch
56 mkdir -p ../gcc-build && cd ../gcc-build
58 # This is the default GCC and we want a native build to cross compile after.
59 # SliTaz target i486 host so we need a native i486 build for GCC.
60 case "$opt" in
61 --first-pass)
62 # Used by slitaz-toolchain when rebuilding the full toolchain.
63 echo "cook: configure GCC for: toolchain first pass"
64 $src/configure \
65 --libexecdir=/usr/lib \
66 --disable-nls \
67 --enable-shared \
68 --enable-languages=c,c++ \
69 --disable-libstdcxx-pch \
70 --enable-__cxa_atexit \
71 --enable-clocale=gnu \
72 --enable-threads=posix \
73 --disable-bootstrap \
74 ${CONFIGURE_ARGS} &&
75 make && make install ;;
76 *)
77 # Used by default to produce a full featured X86 GCC compiler.
78 echo "cook: configure GCC for: final/full build"
79 $src/configure \
80 --libexecdir=/usr/lib \
81 --enable-nls \
82 --enable-languages=${languages} \
83 --enable-shared \
84 --with-system-zlib \
85 --enable-clocale=gnu \
86 --enable-objc-gc \
87 --enable-__cxa_atexit \
88 --enable-lto \
89 --enable-threads=posix \
90 --disable-bootstrap \
91 --with-pkgversion="$pkgversion" \
92 ${CONFIGURE_ARGS} ${ARCH_ARGS} &&
93 make && make install ;;
94 esac
95 }
97 # Rules to gen a SliTaz package suitable for Tazpkg.
98 genpkg_rules()
99 {
100 mkdir -p $fs/usr/share
101 cp -a $install/usr/bin $fs/usr
103 # Copy all libs. Remove libgcc_s.so and libstdc++.so they goes in
104 # the gcc-lib-base package.
105 cp -a $install/usr/lib $fs/usr
106 rm -f $fs/usr/lib/libgcc_s.so*
107 rm -f $fs/usr/lib/libstdc++.so*
108 rm -f $fs/usr/lib/libgomp.so*
109 rm -f $fs/usr/lib/libobjc.so*
111 # Include files.
112 cp -a $install/usr/include $fs/usr
114 # Gfortran goes in gfortran package.
115 rm -f $fs/usr/bin/*gfortran
116 rm -f $fs/usr/lib/libgfortran*
117 rm -f $fs/usr/lib/gcc/*/$VERSION/libgfortran*
118 rm -rf $fs/usr/lib/gcc/*/$VERSION/f*
120 # Remove build directory.
121 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
122 rm -rf $WOK/$PACKAGE/$PACKAGE-build
123 }
125 # Post install commands for Tazpkg.
126 post_install()
127 {
128 [ -f "$1/lib/cpp" ] ||
129 ln -s ../usr/bin/cpp "$1/lib"
130 [ -f "$1/usr/bin/cc" ] ||
131 ln -s gcc "$1/usr/bin/cc"
132 }