mirror of
https://github.com/LibreELEC/LibreELEC.tv
synced 2025-09-24 19:46:01 +07:00
93 lines
3.0 KiB
Bash
Executable File
93 lines
3.0 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
################################################################################
|
|
# This file is part of OpenELEC - http://www.openelec.tv
|
|
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
|
#
|
|
# This Program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
# any later version.
|
|
#
|
|
# This Program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
# http://www.gnu.org/copyleft/gpl.html
|
|
################################################################################
|
|
|
|
. config/options $1
|
|
|
|
$SCRIPTS/unpack gcc
|
|
|
|
setup_toolchain host
|
|
|
|
cd $BUILD/gcc*
|
|
mkdir -p objdir-$1 && cd objdir-$1
|
|
../configure --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 \
|
|
--with-ppl=$ROOT/$TOOLCHAIN \
|
|
--disable-ppl-version-check \
|
|
--with-cloog=$ROOT/$TOOLCHAIN \
|
|
--with-libelf=$ROOT/$TOOLCHAIN \
|
|
--enable-languages=${TOOLCHAIN_LANGUAGES} \
|
|
--with-gnu-as \
|
|
--with-gnu-ld \
|
|
--enable-__cxa_atexit \
|
|
--disable-libada \
|
|
--enable-decimal-float \
|
|
--disable-libmudflap \
|
|
--disable-libssp \
|
|
--disable-multilib \
|
|
--enable-gold=yes \
|
|
--enable-ld=default \
|
|
--enable-plugin \
|
|
--enable-lto \
|
|
--disable-libquadmath \
|
|
--enable-tls \
|
|
--enable-shared \
|
|
--enable-c99 \
|
|
--enable-long-long \
|
|
--enable-threads=posix \
|
|
--disable-nls
|
|
|
|
make
|
|
|
|
make install
|
|
cp -PR $TARGET_NAME/libstdc++-v3/src/.libs/libstdc++.so* $SYSROOT_PREFIX/usr/lib
|
|
|
|
GCC_VERSION=`$ROOT/$TOOLCHAIN/$TARGET_NAME/bin/gcc -dumpversion`
|
|
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
|
|
cat > $TARGET_CC <<EOF
|
|
#!/bin/sh
|
|
$ROOT/$TOOLCHAIN/bin/ccache $CROSS_CC "\$@"
|
|
EOF
|
|
chmod +x $TARGET_CC
|
|
|
|
# To avoid cache trashing
|
|
touch -c -t $DATE $CROSS_CC
|
|
|
|
[ ! -f "$CROSS_CXX" ] && mv $TARGET_CXX $CROSS_CXX
|
|
cat > $TARGET_CXX <<EOF
|
|
#!/bin/sh
|
|
$ROOT/$TOOLCHAIN/bin/ccache $CROSS_CXX "\$@"
|
|
EOF
|
|
chmod +x $TARGET_CXX
|
|
|
|
# To avoid cache trashing
|
|
touch -c -t $DATE $CROSS_CXX
|