Signed-off-by: Alejandro Mery <amery@geeks.cl>user/amery/stage
@ -0,0 +1,54 @@ |
|||||
|
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# |
||||
|
# Filename: bin/sde-build-tools |
||||
|
# Copyright (C) 2006 - 2015 The OpenSDE Project |
||||
|
# Copyright (C) 2004 - 2006 The T2 SDE Project |
||||
|
# Copyright (C) 1998 - 2003 Clifford Wolf |
||||
|
# |
||||
|
# More information can be found in the files COPYING and README. |
||||
|
# |
||||
|
# 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; version 2 of the License. A copy of the |
||||
|
# GNU General Public License can be found in the file COPYING. |
||||
|
# --- SDE-COPYRIGHT-NOTE-END --- |
||||
|
|
||||
|
flist_tools_clean() { |
||||
|
rm -f "$TOOLSDIR/lib/fl_wrapper.so" |
||||
|
} |
||||
|
|
||||
|
flist_tools_build() { |
||||
|
FLWRAPPER_LIBC=$(ls -1 \ |
||||
|
"$xroot"/lib*/{*/,}libc[.-]* 2> /dev/null | |
||||
|
grep -v '\.a$' | grep '\.so' | |
||||
|
sort -V | head -n1 ) |
||||
|
|
||||
|
if [ ! -f "$FLWRAPPER_LIBC" ]; then |
||||
|
abort 'Unable to detect /lib/libc.* for flwrapper' |
||||
|
fi |
||||
|
echo_status "Building $toolsdir/lib/fl_wrapper.so ($FLWRAPPER_LIBC)." |
||||
|
|
||||
|
if ! atstage native; then |
||||
|
FLWRAPPER_BASEDIR="$base" |
||||
|
else |
||||
|
FLWRAPPER_BASEDIR= |
||||
|
fi |
||||
|
|
||||
|
make -s -C src/tools-source/fl_wrapper LIB="$PWD/$TOOLSDIR/lib/fl_wrapper.so" \ |
||||
|
CC="$BUILDCC" LIBC="${FLWRAPPER_LIBC##*/}" BASE="$FLWRAPPER_BASEDIR" \ |
||||
|
|| exit 1 |
||||
|
|
||||
|
echo_status "Testing $toolsdir/lib/fl_wrapper.so." |
||||
|
if ! sh -c "LD_PRELOAD=\"\$LD_PRELOAD:build/\$SDECFG_ID/` |
||||
|
`TOOLCHAIN/$toolsdir/lib/fl_wrapper.so\" date ; ` |
||||
|
`exit \$?" >/dev/null 2>&1 |
||||
|
then |
||||
|
echo_error "Detected a problem with the flist" \ |
||||
|
"wrapper lib on your system." |
||||
|
echo_error "Please specify another flist-creation" \ |
||||
|
"system in your build configuration." |
||||
|
rm -f $TOOLSDIR/lib/fl_wrapper.so |
||||
|
echo ; exit 1 |
||||
|
fi |
||||
|
} |
||||