wok-current view gcc/receipt @ rev 25705

Up miss usbip, usbip-dev to 5.10.217
author Stanislas Leduc <shann@slitaz.org>
date Mon May 20 14:49:05 2024 +0000 (17 months ago)
parents 3ad63c8fc2f9
children 5926178cd6fa
line source
1 # SliTaz package receipt.
3 PACKAGE="gcc"
4 VERSION="8.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.xz"
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 gc-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 sed -i 's|\(add-gnu-debuglink.*\);|\1 2> /dev/null;|' \
65 $src/libbacktrace/configure*
66 $src/configure \
67 --libexecdir=/usr/lib \
68 --disable-nls \
69 --enable-shared \
70 --enable-languages=c,c++ \
71 --disable-libstdcxx-pch \
72 --enable-__cxa_atexit \
73 --enable-clocale=gnu \
74 --enable-threads=posix \
75 --disable-bootstrap \
76 ${CONFIGURE_ARGS} &&
77 make && make install ;;
78 *)
79 # Used by default to produce a full featured X86 GCC compiler.
80 echo "cook: configure GCC for: final/full build"
81 sed -i 's|\(add-gnu-debuglink.*\);|\1 2> /dev/null;|' \
82 $src/libbacktrace/configure*
83 $src/configure \
84 --libexecdir=/usr/lib \
85 --enable-nls \
86 --enable-languages=${languages} \
87 --enable-shared \
88 --with-system-zlib \
89 --enable-clocale=gnu \
90 --enable-objc-gc \
91 --enable-__cxa_atexit \
92 --enable-lto \
93 --enable-threads=posix \
94 --disable-bootstrap \
95 --with-pkgversion="$pkgversion" \
96 ${CONFIGURE_ARGS} ${ARCH_ARGS} &&
97 make && make install ;;
98 esac
99 }
101 # Rules to gen a SliTaz package suitable for Tazpkg.
102 genpkg_rules()
103 {
104 mkdir -p $fs/usr/share
105 cp -a $install/usr/bin $fs/usr
107 # Copy all libs. Remove libgcc_s.so and libstdc++.so they goes in
108 # the gcc-lib-base package.
109 cp -a $install/usr/lib $fs/usr
110 rm -f $fs/usr/lib/libgcc_s.so*
111 rm -f $fs/usr/lib/libstdc++.so*
112 rm -f $fs/usr/lib/libgomp.so*
113 rm -f $fs/usr/lib/libobjc.so*
115 # Include files.
116 cp -a $install/usr/include $fs/usr
118 # Gfortran goes in gfortran package.
119 rm -f $fs/usr/bin/*gfortran
120 rm -f $fs/usr/lib/libgfortran*
121 rm -f $fs/usr/lib/gcc/*/$VERSION/libgfortran*
122 rm -rf $fs/usr/lib/gcc/*/$VERSION/f*
124 # Remove build directory.
125 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
126 rm -rf $WOK/$PACKAGE/$PACKAGE-build
128 # Ensure remove .la files
129 find $fs/usr/lib -name "lib*.la" -not -path "$fs/usr/lib/gcc/*" -delete
130 }
132 # Post install commands for Tazpkg.
133 post_install()
134 {
135 [ -f "$1/lib/cpp" ] ||
136 ln -s ../usr/bin/cpp "$1/lib"
137 [ -f "$1/usr/bin/cc" ] ||
138 ln -s gcc "$1/usr/bin/cc"
139 }