wok annotate gcc/receipt @ rev 25691

Up lynis (3.1.1), ncurses-examples (20211021)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Apr 16 10:43:04 2024 +0000 (13 days ago)
parents 95e974a939f1
children
rev   line source
pankso@9 1 # SliTaz package receipt.
pankso@9 2
pankso@9 3 PACKAGE="gcc"
pankso@12541 4 VERSION="4.6.3"
pankso@204 5 CATEGORY="development"
erkan@19462 6 SHORT_DESC="The GNU Compiler Collection."
pankso@9 7 MAINTAINER="pankso@slitaz.org"
pascal@15000 8 LICENSE="GPL2"
pankso@9 9 TARBALL="$PACKAGE-$VERSION.tar.bz2"
pankso@9 10 WEB_SITE="http://gcc.gnu.org/"
pankso@5269 11 WGET_URL="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$VERSION/$TARBALL"
pascal@13033 12 TAGS="compiler C"
pankso@16319 13 #HOST_ARCH="i486 arm"
pankso@9 14
gokhlayeh@11383 15 DEPENDS="binutils libgomp libobjc gcc-lib-base mpc-library elfutils"
pankso@16319 16 BUILD_DEPENDS="mpc-library mpfr-dev gmp-dev elfutils-dev"
pankso@9704 17
pankso@16319 18 # Handle cross compilation (native i486/ARM gcc)
pankso@16319 19 case "$ARCH" in
pankso@16319 20 i?86)
pankso@16319 21 ARCH_ARGS="--with-tune=$ARCH"
pankso@16319 22 pkgversion="SliTaz"
pankso@16319 23 languages="c,c++,objc,fortran" ;;
pankso@16319 24 arm*)
pankso@16319 25 pkgversion="SliTaz ARM"
pankso@16319 26 languages="c,c++" ;;
pankso@16319 27 esac
gokhlayeh@8181 28
pascal@24540 29 # What is the latest version available today?
pascal@24540 30 current_version()
pascal@24540 31 {
pascal@24540 32 wget -O - 'https://gcc.gnu.org/git/?p=gcc.git;a=summary' 2>/dev/null | \
pascal@24540 33 sed '/ release/!d;s|.*GCC ||;s| release.*||' | sort -Vr | sed q
pascal@24540 34 }
pascal@24540 35
pankso@9 36 # Rules to configure and make the package.
pankso@9 37 compile_rules()
pankso@9 38 {
pankso@9704 39 # Package slitaz-toolchain use 'cook --options' when rebuilding
pankso@9707 40 # the full SliTaz toolchain.
pascal@20892 41 [ "$2" = "--first-pass" ] && opt=$2
pascal@20892 42 [ "$3" = "--first-pass" ] && opt=$3
pankso@12541 43
pankso@3185 44 # Use libiberty.a from binutils.
pankso@12267 45 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || return 1
pankso@12541 46
pankso@16319 47 case "$ARCH" in
pankso@16319 48 i?86) sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in ;;
pankso@12267 49 esac
pankso@12541 50
pankso@12267 51 #sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
pankso@12541 52
pankso@9704 53 mkdir -p ../gcc-build && cd ../gcc-build
pankso@10036 54
pankso@10036 55 # This is the default GCC and we want a native build to cross compile after.
pankso@10036 56 # SliTaz target i486 host so we need a native i486 build for GCC.
pankso@9704 57 case "$opt" in
pankso@9704 58 --first-pass)
pankso@9704 59 # Used by slitaz-toolchain when rebuilding the full toolchain.
pankso@9704 60 echo "cook: configure GCC for: toolchain first pass"
pankso@10012 61 $src/configure \
pankso@10012 62 --libexecdir=/usr/lib \
pankso@10012 63 --disable-nls \
pankso@10012 64 --enable-shared \
pankso@10030 65 --enable-languages=c,c++ \
pankso@10012 66 --disable-libstdcxx-pch \
pankso@10012 67 --enable-__cxa_atexit \
pankso@10012 68 --enable-clocale=gnu \
pankso@10012 69 --enable-threads=posix \
pankso@10036 70 --disable-bootstrap \
pankso@16319 71 ${CONFIGURE_ARGS} &&
pankso@10012 72 make && make install ;;
pankso@9704 73 *)
pankso@10036 74 # Used by default to produce a full featured X86 GCC compiler.
pankso@9704 75 echo "cook: configure GCC for: final/full build"
pankso@10012 76 $src/configure \
pankso@10012 77 --libexecdir=/usr/lib \
pankso@10012 78 --enable-nls \
pankso@16319 79 --enable-languages=${languages} \
pankso@10012 80 --enable-shared \
pankso@10012 81 --with-system-zlib \
pankso@10012 82 --enable-clocale=gnu \
pankso@10012 83 --enable-objc-gc \
pankso@10012 84 --enable-__cxa_atexit \
pankso@10012 85 --enable-lto \
pankso@10012 86 --enable-threads=posix \
pankso@10036 87 --disable-bootstrap \
pankso@16319 88 --with-pkgversion="$pkgversion" \
pankso@16319 89 ${CONFIGURE_ARGS} ${ARCH_ARGS} &&
pankso@10012 90 make && make install ;;
pankso@9704 91 esac
pankso@9 92 }
pankso@9 93
pankso@9 94 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@9 95 genpkg_rules()
pankso@9 96 {
pankso@9 97 mkdir -p $fs/usr/share
pankso@12267 98 cp -a $install/usr/bin $fs/usr
pankso@12541 99
pankso@9704 100 # Copy all libs. Remove libgcc_s.so and libstdc++.so they goes in
pankso@10036 101 # the gcc-lib-base package.
pankso@12267 102 cp -a $install/usr/lib $fs/usr
pankso@10025 103 rm -f $fs/usr/lib/libgcc_s.so*
pankso@10025 104 rm -f $fs/usr/lib/libstdc++.so*
pankso@10025 105 rm -f $fs/usr/lib/libgomp.so*
pankso@10025 106 rm -f $fs/usr/lib/libobjc.so*
slaxemulator@9781 107
gokhlayeh@8181 108 # Include files.
pankso@12267 109 cp -a $install/usr/include $fs/usr
pankso@12541 110
pankso@10036 111 # Gfortran goes in gfortran package.
gokhlayeh@8181 112 rm -f $fs/usr/bin/*gfortran
gokhlayeh@8181 113 rm -f $fs/usr/lib/libgfortran*
gokhlayeh@8181 114 rm -f $fs/usr/lib/gcc/*/$VERSION/libgfortran*
gokhlayeh@8181 115 rm -rf $fs/usr/lib/gcc/*/$VERSION/f*
pankso@12541 116
gokhlayeh@8181 117 # Remove build directory.
pankso@9706 118 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
pankso@9706 119 rm -rf $WOK/$PACKAGE/$PACKAGE-build
pankso@9 120 }
pankso@9 121
pankso@9 122 # Post install commands for Tazpkg.
pankso@9 123 post_install()
pankso@9 124 {
pascal@18730 125 [ -f "$1/lib/cpp" ] ||
pascal@18730 126 ln -s ../usr/bin/cpp "$1/lib"
pascal@18730 127 [ -f "$1/usr/bin/cc" ] ||
pascal@18730 128 ln -s gcc "$1/usr/bin/cc"
pankso@9 129 }