2013-12-21 05:42:24 +01:00
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
2016-01-02 17:29:56 +01:00
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
2013-12-21 05:42:24 +01:00
#
2013-12-21 21:51:48 +01:00
# OpenELEC is free software: you can redistribute it and/or modify
2013-12-21 05:42:24 +01:00
# it under the terms of the GNU General Public License as published by
2013-12-21 21:51:48 +01:00
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
2013-12-21 05:42:24 +01:00
#
2013-12-21 21:51:48 +01:00
# OpenELEC is distributed in the hope that it will be useful,
2013-12-21 05:42:24 +01:00
# but WITHOUT ANY WARRANTY; without even the implied warranty of
2013-12-21 21:51:48 +01:00
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2013-12-21 05:42:24 +01:00
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
2013-12-21 21:51:48 +01:00
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
2013-12-21 05:42:24 +01:00
################################################################################
PKG_NAME = "gcc"
2016-06-24 13:44:52 -07:00
PKG_VERSION = "5.4.0"
2013-12-21 05:42:24 +01:00
PKG_REV = "1"
PKG_ARCH = "any"
PKG_LICENSE = "GPL"
PKG_SITE = "http://gcc.gnu.org/"
2016-09-14 10:25:44 +02:00
PKG_URL = " http://ftpmirror.gnu.org/gcc/ $PKG_NAME - $PKG_VERSION / $PKG_NAME - $PKG_VERSION .tar.bz2 "
2014-08-02 00:57:10 +02:00
PKG_DEPENDS_BOOTSTRAP = "ccache:host autoconf:host binutils:host gmp:host mpfr:host mpc:host"
2014-01-30 14:39:32 +01:00
PKG_DEPENDS_TARGET = "gcc:host"
2014-08-02 00:57:10 +02:00
PKG_DEPENDS_HOST = "ccache:host autoconf:host binutils:host gmp:host mpfr:host mpc:host glibc"
2013-12-21 05:42:24 +01:00
PKG_PRIORITY = "optional"
PKG_SECTION = "lang"
PKG_SHORTDESC = "gcc: The GNU Compiler Collection Version 4 (aka GNU C Compiler)"
PKG_LONGDESC = "This package contains the GNU Compiler Collection. It includes compilers for the languages C, C++, Objective C, Fortran 95, Java and others ... This GCC contains the Stack-Smashing Protector Patch which can be enabled with the -fstack-protector command-line option. More information about it ca be found at http://www.research.ibm.com/trl/projects/security/ssp/."
PKG_IS_ADDON = "no"
PKG_AUTORECONF = "no"
BOOTSTRAP_CONFIGURE_OPTS = " --host= $HOST_NAME \
--build= $HOST_NAME \
--target= $TARGET_NAME \
--prefix= $ROOT / $TOOLCHAIN \
--with-sysroot= $SYSROOT_PREFIX \
--with-gmp= $ROOT / $TOOLCHAIN \
--with-mpfr= $ROOT / $TOOLCHAIN \
--with-mpc= $ROOT / $TOOLCHAIN \
2014-08-02 00:57:10 +02:00
--without-ppl \
--without-cloog \
2013-12-21 05:42:24 +01:00
--with-gnu-as \
--with-gnu-ld \
--enable-languages=c \
--disable-__cxa_atexit \
--disable-libada \
--disable-libmudflap \
--disable-libatomic \
2014-06-23 03:28:05 +02:00
--disable-libitm \
--disable-libsanitizer \
2013-12-21 05:42:24 +01:00
--enable-gold \
--enable-ld=default \
--enable-plugin \
--enable-lto \
--disable-libquadmath \
--disable-libssp \
--disable-libgomp \
--enable-cloog-backend=isl \
--disable-shared \
--disable-multilib \
--disable-threads \
--without-headers \
--with-newlib \
--disable-decimal-float \
$GCC_OPTS \
2014-01-25 04:53:10 +01:00
--disable-nls \
2015-10-05 13:58:42 -07:00
--enable-checking=release \
--with-default-libstdcxx-abi= gcc4-compatible"
2013-12-21 05:42:24 +01:00
PKG_CONFIGURE_OPTS_HOST = " --target= $TARGET_NAME \
--with-sysroot= $SYSROOT_PREFIX \
--with-gmp= $ROOT / $TOOLCHAIN \
--with-mpfr= $ROOT / $TOOLCHAIN \
--with-mpc= $ROOT / $TOOLCHAIN \
2014-08-02 00:57:10 +02:00
--without-ppl \
--without-cloog \
2013-12-21 05:42:24 +01:00
--enable-languages= ${ TOOLCHAIN_LANGUAGES } \
--with-gnu-as \
--with-gnu-ld \
--enable-__cxa_atexit \
--disable-libada \
--enable-decimal-float \
--disable-libmudflap \
--disable-libssp \
--disable-multilib \
--disable-libatomic \
2014-08-24 17:50:44 +03:00
--disable-libitm \
2013-12-21 05:42:24 +01:00
--enable-gold \
--enable-ld=default \
--enable-plugin \
--enable-lto \
--disable-libquadmath \
2014-08-24 17:50:44 +03:00
--disable-libgomp \
2013-12-21 05:42:24 +01:00
--enable-tls \
--enable-shared \
2014-06-23 03:28:05 +02:00
--disable-static \
2013-12-21 05:42:24 +01:00
--enable-c99 \
--enable-long-long \
--enable-threads=posix \
--disable-libstdcxx-pch \
2014-06-23 03:28:05 +02:00
--enable-libstdcxx-time \
2013-12-21 05:42:24 +01:00
--enable-clocale=gnu \
$GCC_OPTS \
2014-01-25 04:53:10 +01:00
--disable-nls \
2015-10-05 13:58:42 -07:00
--enable-checking=release \
--with-default-libstdcxx-abi= gcc4-compatible"
2013-12-21 05:42:24 +01:00
2016-05-12 12:16:27 +00:00
p r e _ c o n f i g u r e _ h o s t ( ) {
export CXXFLAGS = " $CXXFLAGS -std=gnu++98 "
}
2013-12-21 05:42:24 +01:00
p r e _ c o n f i g u r e _ b o o t s t r a p ( ) {
s e t u p _ t o o l c h a i n h o s t
}
m a k e i n s t a l l _ b o o t s t r a p ( ) {
m a k e i n s t a l l
}
p o s t _ m a k e _ h o s t ( ) {
# fix wrong link
rm -rf $TARGET_NAME /libgcc/libgcc_s.so
ln -sf libgcc_s.so.1 $TARGET_NAME /libgcc/libgcc_s.so
if [ ! " $DEBUG " = yes ] ; then
$TARGET_STRIP $TARGET_NAME /libgcc/libgcc_s.so*
$TARGET_STRIP $TARGET_NAME /libstdc++-v3/src/.libs/libstdc++.so*
fi
}
p o s t _ m a k e i n s t a l l _ h o s t ( ) {
c p - P R $ T A R G E T _ N A M E / l i b s t d c + + - v 3 / s r c / . l i b s / l i b s t d c + + . s o * $ S Y S R O O T _ P R E F I X / u s r / l i b
2014-04-23 18:33:34 +02:00
GCC_VERSION = ` $ROOT /$TOOLCHAIN /bin/${ TARGET_NAME } -gcc -dumpversion`
2013-12-21 05:42:24 +01:00
DATE = " 0501`echo $GCC_VERSION | sed 's/\([0-9]\)/0\1/g' | sed 's/\.//g'` "
CROSS_CC = $TARGET_CC -$GCC_VERSION
CROSS_CXX = $TARGET_CXX -$GCC_VERSION
rm -f $TARGET_CC
c a t > $ T A R G E T _ C C < < E O F
#!/bin/sh
$ R O O T / $ T O O L C H A I N / b i n / c c a c h e $ C R O S S _ C C "\$@"
E O F
c h m o d + x $ T A R G E T _ C C
# To avoid cache trashing
touch -c -t $DATE $CROSS_CC
[ ! -f " $CROSS_CXX " ] && mv $TARGET_CXX $CROSS_CXX
c a t > $ T A R G E T _ C X X < < E O F
#!/bin/sh
$ R O O T / $ T O O L C H A I N / b i n / c c a c h e $ C R O S S _ C X X "\$@"
E O F
c h m o d + x $ T A R G E T _ C X X
# To avoid cache trashing
touch -c -t $DATE $CROSS_CXX
}
c o n f i g u r e _ t a r g e t ( ) {
: # reuse configure_host()
}
m a k e _ t a r g e t ( ) {
: # reuse make_host()
}
m a k e i n s t a l l _ t a r g e t ( ) {
m k d i r - p $ I N S T A L L / u s r / l i b
c p - P $ R O O T / $ P K G _ B U I L D / . $ H O S T _ N A M E / $ T A R G E T _ N A M E / l i b g c c / l i b g c c _ s . s o * $ I N S T A L L / u s r / l i b
c p - P $ R O O T / $ P K G _ B U I L D / . $ H O S T _ N A M E / $ T A R G E T _ N A M E / l i b s t d c + + - v 3 / s r c / . l i b s / l i b s t d c + + . s o * $ I N S T A L L / u s r / l i b
}
2014-08-06 13:34:36 +02:00
c o n f i g u r e _ i n i t ( ) {
: # reuse configure_host()
}
m a k e _ i n i t ( ) {
: # reuse make_host()
}
m a k e i n s t a l l _ i n i t ( ) {
m k d i r - p $ I N S T A L L / l i b
c p - P $ R O O T / $ P K G _ B U I L D / . $ H O S T _ N A M E / $ T A R G E T _ N A M E / l i b g c c / l i b g c c _ s . s o * $ I N S T A L L / l i b
}