Browse Source

sde-build-tools: factor out code to build flist tools

Signed-off-by: Alejandro Mery <amery@geeks.cl>
user/amery/stage
Alejandro Mery 4 years ago
parent
commit
5a861e0712
2 changed files with 70 additions and 33 deletions
  1. +16
    -33
      bin/sde-build-tools
  2. +54
    -0
      lib/sde-build/flist_flwrapper_tools.in

+ 16
- 33
bin/sde-build-tools

@ -136,6 +136,19 @@ if [ "$x" ] ; then
fi
fi
# flist tools plugin
#
flist_tools_clean() {
:
}
flist_tools_build() {
:
}
if [ -s "lib/sde-build/flist_${SDECFG_FLIST}_tools.in" ]; then
. "lib/sde-build/flist_${SDECFG_FLIST}_tools.in"
fi
if [ $cleanup = 1 ] ; then
echo_header "Removing old stuff in $toolsdir/ directory ..."
@ -150,6 +163,8 @@ if [ $cleanup = 1 ] ; then
rm -f $TOOLSDIR/lib/parse-config
rm -f $TOOLSDIR/lib/parse-config-fixarch
rm -f $TOOLSDIR/.lastupdate
flist_tools_clean
fi
if [ ! -f $TOOLSDIR/.lastupdate ] ; then
@ -285,39 +300,7 @@ if [ ! -f $TOOLSDIR/.lastupdate ] ; then
# Flist Wrapper Library
#
if [ "$SDECFG_FLIST" = "flwrapper" ] ; then
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
fi
flist_tools_build
# Create Parse-Config Collection
#

+ 54
- 0
lib/sde-build/flist_flwrapper_tools.in

@ -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
}

Loading…
Cancel
Save