mirror of
https://github.com/LibreELEC/LibreELEC.tv
synced 2025-09-24 19:46:01 +07:00
136 lines
3.6 KiB
Bash
Executable File
136 lines
3.6 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
|
|
|
|
strip_lto # Fails to compile with GCC's link time optimization.
|
|
strip_gold # Fails to compile using the gold linker.
|
|
|
|
# Filter out some problematic *FLAGS
|
|
CFLAGS=`echo $CFLAGS | sed -e "s|-ffast-math||"`
|
|
CFLAGS=`echo $CFLAGS | sed -e "s|-Ofast|-O2|"`
|
|
CFLAGS=`echo $CFLAGS | sed -e "s|-O.|-O2|"`
|
|
|
|
LDFLAGS=`echo $LDFLAGS | sed -e "s|-ffast-math||"`
|
|
LDFLAGS=`echo $LDFLAGS | sed -e "s|-Ofast|-O2|"`
|
|
LDFLAGS=`echo $LDFLAGS | sed -e "s|-O.|-O2|"`
|
|
|
|
# set some CFLAGS we need
|
|
CFLAGS="$CFLAGS -g -fno-stack-protector"
|
|
|
|
export BUILD_CC=$HOST_CC
|
|
export OBJDUMP_FOR_HOST=objdump
|
|
|
|
if [ "$DEBUG" = yes ]; then
|
|
DEBUG_CONFIG="--enable-debug"
|
|
else
|
|
DEBUG_CONFIG="--disable-debug"
|
|
DEBUG_OPTIONS=" OPTION_EGLIBC_MEMUSAGE = n"
|
|
fi
|
|
|
|
NSS_CONF_DIR=`ls -d $ROOT/$BUILD/eglibc*/nss`
|
|
|
|
cd $PKG_BUILD
|
|
|
|
autoconf
|
|
|
|
mkdir -p objdir-$1 && cd objdir-$1
|
|
|
|
# OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG = $NSS_CONF_DIR/fixed-nsswitch.conf
|
|
# OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS = $NSS_CONF_DIR/fixed-nsswitch.functions
|
|
|
|
cat >option-groups.config <<EOF
|
|
|
|
OPTION_EGLIBC_ADVANCED_INET6 = n
|
|
|
|
# needed for connman:
|
|
OPTION_EGLIBC_BACKTRACE = y
|
|
|
|
OPTION_EGLIBC_BIG_MACROS = n
|
|
OPTION_EGLIBC_BSD = n
|
|
|
|
# needed for xf86-video-fglrx:
|
|
OPTION_EGLIBC_CATGETS = y
|
|
|
|
# libiconv replacement:
|
|
OPTION_EGLIBC_CHARSETS = n
|
|
|
|
OPTION_EGLIBC_DB_ALIASES = n
|
|
OPTION_EGLIBC_LOCALES = n
|
|
|
|
# needed for example with glib and Python:
|
|
OPTION_EGLIBC_LOCALE_CODE = y
|
|
|
|
OPTION_EGLIBC_NIS = y
|
|
OPTION_EGLIBC_NSSWITCH = y
|
|
OPTION_EGLIBC_RCMD = n
|
|
|
|
# needed by eglibc byself (todo):
|
|
OPTION_EGLIBC_RTLD_DEBUG = y
|
|
|
|
# needed for speed (optionally/todo)
|
|
OPTION_POSIX_REGEXP_GLIBC = y
|
|
|
|
# needed for PAM and Mysql:
|
|
OPTION_EGLIBC_GETLOGIN = y
|
|
|
|
# needed for dropbear:
|
|
OPTION_EGLIBC_UTMP = y
|
|
OPTION_EGLIBC_UTMPX = n
|
|
|
|
# debugging options:
|
|
$DEBUG_OPTIONS
|
|
EOF
|
|
|
|
cat >config.cache <<EOF
|
|
libc_cv_forced_unwind=yes
|
|
libc_cv_c_cleanup=yes
|
|
libc_cv_gnu89_inline=yes
|
|
libc_cv_ssp=no
|
|
EOF
|
|
|
|
cat >configparms <<EOF
|
|
slibdir=/lib
|
|
EOF
|
|
|
|
../configure --host=$TARGET_NAME \
|
|
--build=$HOST_NAME \
|
|
--prefix=/usr \
|
|
--libexecdir=/usr/lib/eglibc \
|
|
--disable-profile \
|
|
--disable-sanity-checks \
|
|
--enable-add-ons \
|
|
--enable-bind-now \
|
|
--with-elf \
|
|
--with-tls \
|
|
--enable-kernel=2.6.39 \
|
|
--with-__thread \
|
|
--with-binutils=$BUILD/toolchain/bin \
|
|
--with-headers=$SYSROOT_PREFIX/usr/include \
|
|
--cache-file=config.cache \
|
|
--without-cvs \
|
|
--without-gd \
|
|
$DEBUG_CONFIG \
|
|
|
|
make
|
|
make install_root=$SYSROOT_PREFIX install
|