SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "gcc49"

# SliTaz package receipt.

PACKAGE="gcc49"
SOURCE="gcc"
VERSION="4.9.2"
CATEGORY="development"
SHORT_DESC="The GNU Compiler Collection."
MAINTAINER="pankso@slitaz.org"
LICENSE="GPL2"
TARBALL="$SOURCE-$VERSION.tar.bz2"
WEB_SITE="http://gcc.gnu.org/"
WGET_URL="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$VERSION/$TARBALL"
TAGS="compiler C C++"

# We need gawk since busybox awk is not sufficient. We have BUILD_DEPENDS
# for cookutils that are not used by tazwok/cook-toolchain since it installs
# and uses its own copy.
DEPENDS="binutils libgomp libobjc mpc-library elfutils"
BUILD_DEPENDS="mpc-library mpfr-dev gmp-dev elfutils-dev"

HOST_ARCH="i486 x86_64"

# What is the latest version available today?
current_version()
{
    wget -O - $GNU_MIRROR/$SOURCE 2>/dev/null | \
    sed '/gcc-4\.9/!d;s|.*gcc-||;s|.t.*||;s|/.*||' | sort -Vr | sed q
}

# Rules to configure and make the package.
compile_rules()
{
    case $ARCH in
        i?86)
            ARCH_ARGS="--with-tune=$ARCH"
            pkgversion="SliTaz" ;;
        x86_64)
            ARCH_ARGS="--disable-libsanitizer"
            pkgversion="SliTaz64" ;;
    esac
    languages="c,c++"

    # Use libiberty.a from binutils.
    sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || return 1

    sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in

    # Patch to build with gcc >= 6
    patch -p1 < $stuff/build_with_gcc6.patch
    # Patch to build with gcc >= 8
    # see https://aur.archlinux.org/packages/gcc49
    # see https://patchwork.ozlabs.org/project/gcc/patch/alpine.DEB.2.20.1706271356170.15648@digraph.polyomino.org.uk
    patch -p1 < $stuff/build_with_gcc8.patch
    patch -p1 < $stuff/build_with_gcc8-1.patch
    patch -p1 < $stuff/build_with_glibc-2.28.patch

    # Patch sanitizer only on x86_64
    case $ARCH in
        x86_64)
            patch -p1 < $stuff/fix_sanitizer.patch ;;
    esac

    mkdir -p ../gcc-build && cd ../gcc-build

    $src/configure \
        --libexecdir=/usr/lib \
        --enable-nls \
        --enable-languages=${languages} \
        --enable-shared \
        --with-system-zlib \
        --enable-clocale=gnu \
        --enable-objc-gc \
        --enable-__cxa_atexit \
        --enable-lto \
        --enable-threads=posix \
        --disable-bootstrap \
        --disable-multilib \
        --program-suffix=-49 \
        --libdir=/usr/libgcc49 \
        --with-pkgversion="$pkgversion" \
        ${CONFIGURE_ARGS} ${ARCH_ARGS} &&
    make && make install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p  $fs/usr/share
    cp -a $install/usr/bin $fs/usr

    # Copy all libs. Do not hide gcc-lib-base.
    # For x86_64, move library on right place
    case $ARCH in
        x86_64)
            mv $install/usr/lib64/* $install/usr/libgcc49/
            rm -rf $install/usr/lib64 ;;
    esac
    cp -a $install/usr/lib* $fs/usr

    # Include files.
    cp -a $install/usr/include $fs/usr

    # Remove build directory.
    rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
    rm -rf $WOK/$PACKAGE/$PACKAGE-build
}
6088 packages and 256128 files in current database (Wed Mar 5 09:18:31 2025)