mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
buildsystem: reduce cascaded if-blocks (stamp and virtual)
This commit is contained in:
parent
3cd7be6023
commit
68ea042161
929
scripts/build
929
scripts/build
@ -71,496 +71,493 @@ if [ -f $STAMP ] ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f $STAMP ]; then
|
if [ -f $STAMP ]; then
|
||||||
rm -f $STAMP
|
# already build, do nothing
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
rm -f $STAMP
|
||||||
|
|
||||||
setup_toolchain $TARGET
|
setup_toolchain $TARGET
|
||||||
|
|
||||||
# unset functions
|
# unset functions
|
||||||
unset -f pre_build_target
|
unset -f pre_build_target
|
||||||
unset -f pre_configure_target
|
unset -f pre_configure_target
|
||||||
unset -f configure_target
|
unset -f configure_target
|
||||||
unset -f post_configure_target
|
unset -f post_configure_target
|
||||||
unset -f pre_make_target
|
unset -f pre_make_target
|
||||||
unset -f make_target
|
unset -f make_target
|
||||||
unset -f post_make_target
|
unset -f post_make_target
|
||||||
unset -f pre_makeinstall_target
|
unset -f pre_makeinstall_target
|
||||||
unset -f makeinstall_target
|
unset -f makeinstall_target
|
||||||
unset -f post_makeinstall_target
|
unset -f post_makeinstall_target
|
||||||
|
|
||||||
unset -f pre_build_host
|
unset -f pre_build_host
|
||||||
unset -f pre_configure_host
|
unset -f pre_configure_host
|
||||||
unset -f configure_host
|
unset -f configure_host
|
||||||
unset -f post_configure_host
|
unset -f post_configure_host
|
||||||
unset -f pre_make_host
|
unset -f pre_make_host
|
||||||
unset -f make_host
|
unset -f make_host
|
||||||
unset -f post_make_host
|
unset -f post_make_host
|
||||||
unset -f pre_makeinstall_host
|
unset -f pre_makeinstall_host
|
||||||
unset -f makeinstall_host
|
unset -f makeinstall_host
|
||||||
unset -f post_makeinstall_host
|
unset -f post_makeinstall_host
|
||||||
|
|
||||||
unset -f pre_build_init
|
unset -f pre_build_init
|
||||||
unset -f pre_configure_init
|
unset -f pre_configure_init
|
||||||
unset -f configure_init
|
unset -f configure_init
|
||||||
unset -f post_configure_init
|
unset -f post_configure_init
|
||||||
unset -f pre_make_init
|
unset -f pre_make_init
|
||||||
unset -f make_init
|
unset -f make_init
|
||||||
unset -f post_make_init
|
unset -f post_make_init
|
||||||
unset -f pre_makeinstall_init
|
unset -f pre_makeinstall_init
|
||||||
unset -f makeinstall_init
|
unset -f makeinstall_init
|
||||||
unset -f post_makeinstall_init
|
unset -f post_makeinstall_init
|
||||||
|
|
||||||
unset -f pre_build_bootstrap
|
unset -f pre_build_bootstrap
|
||||||
unset -f pre_configure_bootstrap
|
unset -f pre_configure_bootstrap
|
||||||
unset -f configure_bootstrap
|
unset -f configure_bootstrap
|
||||||
unset -f post_configure_bootstrap
|
unset -f post_configure_bootstrap
|
||||||
unset -f pre_make_bootstrap
|
unset -f pre_make_bootstrap
|
||||||
unset -f make_bootstrap
|
unset -f make_bootstrap
|
||||||
unset -f post_make_bootstrap
|
unset -f post_make_bootstrap
|
||||||
unset -f pre_makeinstall_bootstrap
|
unset -f pre_makeinstall_bootstrap
|
||||||
unset -f makeinstall_bootstrap
|
unset -f makeinstall_bootstrap
|
||||||
unset -f post_makeinstall_bootstrap
|
unset -f post_makeinstall_bootstrap
|
||||||
|
|
||||||
# configure TARGET build defaults
|
# configure TARGET build defaults
|
||||||
TARGET_CONFIGURE_OPTS="--host=$TARGET_NAME \
|
TARGET_CONFIGURE_OPTS="--host=$TARGET_NAME \
|
||||||
--build=$HOST_NAME \
|
--build=$HOST_NAME \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--bindir=/usr/bin \
|
|
||||||
--sbindir=/usr/sbin \
|
|
||||||
--sysconfdir=/etc \
|
|
||||||
--libdir=/usr/lib \
|
|
||||||
--libexecdir=/usr/lib \
|
|
||||||
--localstatedir=/var \
|
|
||||||
--disable-static \
|
|
||||||
--enable-shared"
|
|
||||||
|
|
||||||
# cmake build defaults
|
|
||||||
if [ "$DEBUG" = "yes" ]; then
|
|
||||||
CMAKE_BUILD_TYPE="Debug"
|
|
||||||
else
|
|
||||||
CMAKE_BUILD_TYPE="MinSizeRel"
|
|
||||||
fi
|
|
||||||
|
|
||||||
CMAKE_GENERATOR_NINJA="-GNinja \
|
|
||||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
|
|
||||||
|
|
||||||
TARGET_CMAKE_OPTS="-DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \
|
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
||||||
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE"
|
|
||||||
|
|
||||||
# meson build defaults
|
|
||||||
if [ "$DEBUG" = "yes" ]; then
|
|
||||||
MESON_BUILD_TYPE="debug"
|
|
||||||
else
|
|
||||||
MESON_BUILD_TYPE="plain"
|
|
||||||
fi
|
|
||||||
|
|
||||||
TARGET_MESON_OPTS="--prefix=/usr \
|
|
||||||
--bindir=/usr/bin \
|
--bindir=/usr/bin \
|
||||||
--sbindir=/usr/sbin \
|
--sbindir=/usr/sbin \
|
||||||
--sysconfdir=/etc \
|
--sysconfdir=/etc \
|
||||||
--libdir=/usr/lib \
|
--libdir=/usr/lib \
|
||||||
--libexecdir=/usr/lib \
|
--libexecdir=/usr/lib \
|
||||||
--localstatedir=/var \
|
--localstatedir=/var \
|
||||||
--buildtype=$MESON_BUILD_TYPE \
|
--disable-static \
|
||||||
--cross-file=$MESON_CONF"
|
--enable-shared"
|
||||||
|
|
||||||
# configure HOST build defaults
|
# cmake build defaults
|
||||||
HOST_CONFIGURE_OPTS="--host=$HOST_NAME \
|
if [ "$DEBUG" = "yes" ]; then
|
||||||
--build=$HOST_NAME \
|
CMAKE_BUILD_TYPE="Debug"
|
||||||
--prefix=$TOOLCHAIN \
|
else
|
||||||
--bindir=$TOOLCHAIN/bin \
|
CMAKE_BUILD_TYPE="MinSizeRel"
|
||||||
--sbindir=$TOOLCHAIN/sbin \
|
fi
|
||||||
--sysconfdir=$TOOLCHAIN/etc \
|
|
||||||
--libexecdir=$TOOLCHAIN/lib \
|
|
||||||
--localstatedir=$TOOLCHAIN/var \
|
|
||||||
--disable-static \
|
|
||||||
--enable-shared"
|
|
||||||
|
|
||||||
HOST_CMAKE_OPTS="$CMAKE_GENERATOR \
|
CMAKE_GENERATOR_NINJA="-GNinja \
|
||||||
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
|
||||||
-DCMAKE_INSTALL_PREFIX=$TOOLCHAIN"
|
|
||||||
|
|
||||||
HOST_MESON_OPTS="--prefix=$TOOLCHAIN \
|
TARGET_CMAKE_OPTS="-DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
|
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE"
|
||||||
|
|
||||||
|
# meson build defaults
|
||||||
|
if [ "$DEBUG" = "yes" ]; then
|
||||||
|
MESON_BUILD_TYPE="debug"
|
||||||
|
else
|
||||||
|
MESON_BUILD_TYPE="plain"
|
||||||
|
fi
|
||||||
|
|
||||||
|
TARGET_MESON_OPTS="--prefix=/usr \
|
||||||
|
--bindir=/usr/bin \
|
||||||
|
--sbindir=/usr/sbin \
|
||||||
|
--sysconfdir=/etc \
|
||||||
|
--libdir=/usr/lib \
|
||||||
|
--libexecdir=/usr/lib \
|
||||||
|
--localstatedir=/var \
|
||||||
|
--buildtype=$MESON_BUILD_TYPE \
|
||||||
|
--cross-file=$MESON_CONF"
|
||||||
|
|
||||||
|
# configure HOST build defaults
|
||||||
|
HOST_CONFIGURE_OPTS="--host=$HOST_NAME \
|
||||||
|
--build=$HOST_NAME \
|
||||||
|
--prefix=$TOOLCHAIN \
|
||||||
--bindir=$TOOLCHAIN/bin \
|
--bindir=$TOOLCHAIN/bin \
|
||||||
--sbindir=$TOOLCHAIN/sbin \
|
--sbindir=$TOOLCHAIN/sbin \
|
||||||
--sysconfdir=$TOOLCHAIN/etc \
|
--sysconfdir=$TOOLCHAIN/etc \
|
||||||
--libdir=$TOOLCHAIN/lib \
|
|
||||||
--libexecdir=$TOOLCHAIN/lib \
|
--libexecdir=$TOOLCHAIN/lib \
|
||||||
--localstatedir=$TOOLCHAIN/var \
|
--localstatedir=$TOOLCHAIN/var \
|
||||||
--buildtype=plain \
|
--disable-static \
|
||||||
--cross-file=$MESON_CONF"
|
--enable-shared"
|
||||||
|
|
||||||
# configure INIT build defaults
|
HOST_CMAKE_OPTS="$CMAKE_GENERATOR \
|
||||||
INIT_CONFIGURE_OPTS="$TARGET_CONFIGURE_OPTS"
|
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \
|
||||||
INIT_CMAKE_OPTS="$TARGET_CMAKE_OPTS"
|
-DCMAKE_INSTALL_PREFIX=$TOOLCHAIN"
|
||||||
INIT_MESON_OPTS="$TARGET_MESON_OPTS"
|
|
||||||
|
|
||||||
# configure BOOTSTRAP build defaults
|
HOST_MESON_OPTS="--prefix=$TOOLCHAIN \
|
||||||
BOOTSTRAP_CONFIGURE_OPTS="$HOST_CONFIGURE_OPTS"
|
--bindir=$TOOLCHAIN/bin \
|
||||||
BOOTSTRAP_CMAKE_OPTS="$HOST_CMAKE_OPTS"
|
--sbindir=$TOOLCHAIN/sbin \
|
||||||
BOOTSTRAP_MESON_OPTS="$HOST_MESON_OPTS"
|
--sysconfdir=$TOOLCHAIN/etc \
|
||||||
|
--libdir=$TOOLCHAIN/lib \
|
||||||
|
--libexecdir=$TOOLCHAIN/lib \
|
||||||
|
--localstatedir=$TOOLCHAIN/var \
|
||||||
|
--buildtype=plain \
|
||||||
|
--cross-file=$MESON_CONF"
|
||||||
|
|
||||||
# include buildfile
|
# configure INIT build defaults
|
||||||
. $PKG_DIR/package.mk
|
INIT_CONFIGURE_OPTS="$TARGET_CONFIGURE_OPTS"
|
||||||
|
INIT_CMAKE_OPTS="$TARGET_CMAKE_OPTS"
|
||||||
|
INIT_MESON_OPTS="$TARGET_MESON_OPTS"
|
||||||
|
|
||||||
if [ "$PKG_IS_KERNEL_PKG" = "yes" ]; then
|
# configure BOOTSTRAP build defaults
|
||||||
if [ "$TARGET_KERNEL_ARCH" = "arm64" -a "$TARGET_ARCH" = "arm" ]; then
|
BOOTSTRAP_CONFIGURE_OPTS="$HOST_CONFIGURE_OPTS"
|
||||||
TARGET_PREFIX=$TOOLCHAIN/lib/gcc-linaro-aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
BOOTSTRAP_CMAKE_OPTS="$HOST_CMAKE_OPTS"
|
||||||
fi
|
BOOTSTRAP_MESON_OPTS="$HOST_MESON_OPTS"
|
||||||
fi
|
|
||||||
|
|
||||||
# build dependencies
|
# include buildfile
|
||||||
case "$TARGET" in
|
. $PKG_DIR/package.mk
|
||||||
"target")
|
|
||||||
for p in $PKG_DEPENDS_TARGET; do
|
|
||||||
$SCRIPTS/build $p
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
"host")
|
|
||||||
for p in $PKG_DEPENDS_HOST; do
|
|
||||||
$SCRIPTS/build $p
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
"init")
|
|
||||||
for p in $PKG_DEPENDS_INIT; do
|
|
||||||
$SCRIPTS/build $p
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
"bootstrap")
|
|
||||||
for p in $PKG_DEPENDS_BOOTSTRAP; do
|
|
||||||
$SCRIPTS/build $p
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
printf "%${BUILD_INDENT}c $(print_color CLR_BUILD "BUILD") $PACKAGE_NAME $(print_color CLR_TARGET "($TARGET)")\n" ' '>&$SILENT_OUT
|
if [ "$PKG_IS_KERNEL_PKG" = "yes" ]; then
|
||||||
export BUILD_INDENT=$((${BUILD_INDENT:-1}+$BUILD_INDENT_SIZE))
|
if [ "$TARGET_KERNEL_ARCH" = "arm64" -a "$TARGET_ARCH" = "arm" ]; then
|
||||||
|
TARGET_PREFIX=$TOOLCHAIN/lib/gcc-linaro-aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||||
# virtual packages dont must be build, they only contains dependencies, so dont go further here
|
fi
|
||||||
if [ ! "$PKG_SECTION" = "virtual" ]; then
|
fi
|
||||||
|
|
||||||
# configure other variables
|
# build dependencies
|
||||||
if [ "$TARGET" = "target" ]; then
|
case "$TARGET" in
|
||||||
INSTALL=$PKG_BUILD/.install_pkg
|
"target") _pkg_depends="$PKG_DEPENDS_TARGET";;
|
||||||
elif [ "$TARGET" = "init" ]; then
|
"host") _pkg_depends="$PKG_DEPENDS_HOST";;
|
||||||
INSTALL=$PKG_BUILD/.install_init
|
"init") _pkg_depends="$PKG_DEPENDS_INIT";;
|
||||||
fi
|
"bootstrap") _pkg_depends="$PKG_DEPENDS_BOOTSTRAP";;
|
||||||
|
esac
|
||||||
# clean up
|
for p in $_pkg_depends; do
|
||||||
if [ ! -z "$INSTALL" ] ; then
|
$SCRIPTS/build $p
|
||||||
if [ -d "$INSTALL" ] ; then
|
done
|
||||||
rm -rf $INSTALL
|
|
||||||
fi
|
printf "%${BUILD_INDENT}c $(print_color CLR_BUILD "BUILD") $PACKAGE_NAME $(print_color CLR_TARGET "($TARGET)")\n" ' '>&$SILENT_OUT
|
||||||
fi
|
export BUILD_INDENT=$((${BUILD_INDENT:-1}+$BUILD_INDENT_SIZE))
|
||||||
|
|
||||||
# setup configure script
|
# virtual packages dont must be build, they only contains dependencies, so dont go further here
|
||||||
if [ -z "$PKG_CONFIGURE_SCRIPT" ]; then
|
if [ "$PKG_SECTION" = "virtual" ]; then
|
||||||
PKG_CONFIGURE_SCRIPT="$PKG_BUILD/configure"
|
PKG_DEEPMD5=$(find $STAMP_DEPENDS -exec md5sum {} \; 2>/dev/null | sort | md5sum | cut -d" " -f1)
|
||||||
else
|
for i in PKG_NAME PKG_DEEPMD5; do
|
||||||
PKG_CONFIGURE_SCRIPT="$PKG_BUILD/$PKG_CONFIGURE_SCRIPT"
|
echo "STAMP_$i=\"${!i}\"" >> $STAMP
|
||||||
fi
|
done
|
||||||
if [ -z "$PKG_CMAKE_SCRIPT" ]; then
|
|
||||||
PKG_CMAKE_SCRIPT="$PKG_BUILD/CMakeLists.txt"
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$PKG_MESON_SCRIPT" ]; then
|
# configure other variables
|
||||||
PKG_MESON_SCRIPT="$PKG_BUILD/meson.build"
|
if [ "$TARGET" = "target" ]; then
|
||||||
fi
|
INSTALL=$PKG_BUILD/.install_pkg
|
||||||
|
elif [ "$TARGET" = "init" ]; then
|
||||||
# auto detect toolchain
|
INSTALL=$PKG_BUILD/.install_init
|
||||||
_auto_toolchain=""
|
fi
|
||||||
if [ -z "$PKG_TOOLCHAIN" -o "$PKG_TOOLCHAIN" = "auto" ]; then
|
|
||||||
if [ -f "$PKG_MESON_SCRIPT" ]; then
|
# clean up
|
||||||
PKG_TOOLCHAIN="meson"
|
if [ ! -z "$INSTALL" ] ; then
|
||||||
elif [ -f "$PKG_CMAKE_SCRIPT" -a ! "$PKG_USE_CMAKE" = "no" ]; then
|
if [ -d "$INSTALL" ] ; then
|
||||||
PKG_TOOLCHAIN="cmake"
|
rm -rf $INSTALL
|
||||||
elif [ -f "$PKG_CONFIGURE_SCRIPT" ]; then
|
fi
|
||||||
PKG_TOOLCHAIN="configure"
|
fi
|
||||||
elif [ -f $PKG_BUILD/Makefile ]; then
|
|
||||||
PKG_TOOLCHAIN="make"
|
# setup configure script
|
||||||
else
|
if [ -z "$PKG_CONFIGURE_SCRIPT" ]; then
|
||||||
echo "Not possible to detect toolchain automatically. Add PKG_TOOLCHAIN= to package.mk"
|
PKG_CONFIGURE_SCRIPT="$PKG_BUILD/configure"
|
||||||
exit 1
|
else
|
||||||
fi
|
PKG_CONFIGURE_SCRIPT="$PKG_BUILD/$PKG_CONFIGURE_SCRIPT"
|
||||||
_auto_toolchain=" (auto-detect)"
|
fi
|
||||||
fi
|
|
||||||
if ! listcontains "meson cmake cmake-make configure ninja make autotools manual" "$PKG_TOOLCHAIN"; then
|
if [ -z "$PKG_CMAKE_SCRIPT" ]; then
|
||||||
printf "$(print_color bold-red "ERROR:") unknown toolchain $PKG_TOOLCHAIN"
|
PKG_CMAKE_SCRIPT="$PKG_BUILD/CMakeLists.txt"
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
printf "%${BUILD_INDENT}c $(print_color CLR_TOOLCHAIN "TOOLCHAIN") $PKG_TOOLCHAIN${_auto_toolchain}\n" ' '>&$SILENT_OUT
|
if [ -z "$PKG_MESON_SCRIPT" ]; then
|
||||||
|
PKG_MESON_SCRIPT="$PKG_BUILD/meson.build"
|
||||||
if [ "$PKG_TOOLCHAIN" = "autotools" ]; then
|
fi
|
||||||
$SCRIPTS/autoreconf $PACKAGE_NAME
|
|
||||||
fi
|
# auto detect toolchain
|
||||||
|
_auto_toolchain=""
|
||||||
# include build template and build
|
if [ -z "$PKG_TOOLCHAIN" -o "$PKG_TOOLCHAIN" = "auto" ]; then
|
||||||
if [ "$(type -t pre_build_$TARGET)" = "function" ]; then
|
if [ -f "$PKG_MESON_SCRIPT" ]; then
|
||||||
pre_build_$TARGET
|
PKG_TOOLCHAIN="meson"
|
||||||
fi
|
elif [ -f "$PKG_CMAKE_SCRIPT" -a ! "$PKG_USE_CMAKE" = "no" ]; then
|
||||||
|
PKG_TOOLCHAIN="cmake"
|
||||||
# ensure $PKG_BUILD is there. (installer? PKG_URL="")
|
elif [ -f "$PKG_CONFIGURE_SCRIPT" ]; then
|
||||||
if [ ! -d $PKG_BUILD ] ; then
|
PKG_TOOLCHAIN="configure"
|
||||||
mkdir -p $PKG_BUILD
|
elif [ -f $PKG_BUILD/Makefile ]; then
|
||||||
fi
|
PKG_TOOLCHAIN="make"
|
||||||
|
else
|
||||||
cd $PKG_BUILD
|
echo "Not possible to detect toolchain automatically. Add PKG_TOOLCHAIN= to package.mk"
|
||||||
|
exit 1
|
||||||
if [ -f "$PKG_CONFIGURE_SCRIPT" -o -f "$PKG_CMAKE_SCRIPT" -o -f "$PKG_MESON_SCRIPT" ]; then
|
fi
|
||||||
case "$TARGET" in
|
_auto_toolchain=" (auto-detect)"
|
||||||
"target")
|
fi
|
||||||
mkdir -p .$TARGET_NAME
|
if ! listcontains "meson cmake cmake-make configure ninja make autotools manual" "$PKG_TOOLCHAIN"; then
|
||||||
cd .$TARGET_NAME
|
printf "$(print_color bold-red "ERROR:") unknown toolchain $PKG_TOOLCHAIN"
|
||||||
;;
|
exit 1
|
||||||
"host")
|
fi
|
||||||
mkdir -p .$HOST_NAME
|
printf "%${BUILD_INDENT}c $(print_color CLR_TOOLCHAIN "TOOLCHAIN") $PKG_TOOLCHAIN${_auto_toolchain}\n" ' '>&$SILENT_OUT
|
||||||
cd .$HOST_NAME
|
|
||||||
;;
|
# make autoreconf
|
||||||
"init")
|
if [ "$PKG_TOOLCHAIN" = "autotools" ]; then
|
||||||
mkdir -p .$TARGET_NAME-$TARGET
|
$SCRIPTS/autoreconf $PACKAGE_NAME
|
||||||
cd .$TARGET_NAME-$TARGET
|
fi
|
||||||
;;
|
|
||||||
"bootstrap")
|
# include build template and build
|
||||||
mkdir -p .$HOST_NAME-$TARGET
|
if [ "$(type -t pre_build_$TARGET)" = "function" ]; then
|
||||||
cd .$HOST_NAME-$TARGET
|
pre_build_$TARGET
|
||||||
;;
|
fi
|
||||||
esac
|
|
||||||
fi
|
# ensure $PKG_BUILD is there. (installer? PKG_URL="")
|
||||||
|
if [ ! -d $PKG_BUILD ] ; then
|
||||||
# configure
|
mkdir -p $PKG_BUILD
|
||||||
if [ "$(type -t pre_configure_$TARGET)" = "function" ]; then
|
fi
|
||||||
pre_configure_$TARGET
|
|
||||||
fi
|
cd $PKG_BUILD
|
||||||
if [ "$(type -t configure_$TARGET)" = "function" ]; then
|
|
||||||
configure_$TARGET
|
if [ -f "$PKG_CONFIGURE_SCRIPT" -o -f "$PKG_CMAKE_SCRIPT" -o -f "$PKG_MESON_SCRIPT" ]; then
|
||||||
else
|
case "$TARGET" in
|
||||||
case "$PKG_TOOLCHAIN:$TARGET" in
|
"target")
|
||||||
# meson builds
|
mkdir -p .$TARGET_NAME
|
||||||
"meson:target")
|
cd .$TARGET_NAME
|
||||||
echo "Executing (target): meson $TARGET_MESON_OPTS $PKG_MESON_OPTS_TARGET $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
|
;;
|
||||||
meson $TARGET_MESON_OPTS $PKG_MESON_OPTS_TARGET $(dirname $PKG_MESON_SCRIPT)
|
"host")
|
||||||
;;
|
mkdir -p .$HOST_NAME
|
||||||
"meson:host")
|
cd .$HOST_NAME
|
||||||
echo "Executing (host): meson $HOST_MESON_OPTS $PKG_MESON_OPTS_HOST $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
|
;;
|
||||||
meson $HOST_MESON_OPTS $PKG_MESON_OPTS_HOST $(dirname $PKG_MESON_SCRIPT)
|
"init")
|
||||||
;;
|
mkdir -p .$TARGET_NAME-$TARGET
|
||||||
"meson:init")
|
cd .$TARGET_NAME-$TARGET
|
||||||
echo "Executing (init): meson $INIT_MESON_OPTS $PKG_MESON_OPTS_INIT $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
|
;;
|
||||||
meson $INIT_MESON_OPTS $PKG_MESON_OPTS_INIT $(dirname $PKG_MESON_SCRIPT)
|
"bootstrap")
|
||||||
;;
|
mkdir -p .$HOST_NAME-$TARGET
|
||||||
"meson:bootstrap")
|
cd .$HOST_NAME-$TARGET
|
||||||
echo "Executing (bootstrap): meson $BOOTSTRAP_MESON_OPTS $PKG_MESON_OPTS_BOOTSTRAP $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
|
;;
|
||||||
meson $BOOTSTRAP_MESON_OPTS $PKG_MESON_OPTS_BOOTSTRAP $(dirname $PKG_MESON_SCRIPT)
|
esac
|
||||||
;;
|
fi
|
||||||
|
|
||||||
# cmake builds with ninja
|
# configure
|
||||||
"cmake:target")
|
if [ "$(type -t pre_configure_$TARGET)" = "function" ]; then
|
||||||
echo "Executing (target): cmake $CMAKE_GENERATOR_NINJA $TARGET_CMAKE_OPTS $PKG_CMAKE_OPTS_TARGET $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
pre_configure_$TARGET
|
||||||
cmake $CMAKE_GENERATOR_NINJA $TARGET_CMAKE_OPTS $PKG_CMAKE_OPTS_TARGET $(dirname $PKG_CMAKE_SCRIPT)
|
fi
|
||||||
;;
|
if [ "$(type -t configure_$TARGET)" = "function" ]; then
|
||||||
"cmake:host")
|
configure_$TARGET
|
||||||
echo "Executing (host): cmake $CMAKE_GENERATOR_NINJA $HOST_CMAKE_OPTS $PKG_CMAKE_OPTS_HOST $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
else
|
||||||
cmake $CMAKE_GENERATOR_NINJA $HOST_CMAKE_OPTS $PKG_CMAKE_OPTS_HOST $(dirname $PKG_CMAKE_SCRIPT)
|
case "$PKG_TOOLCHAIN:$TARGET" in
|
||||||
;;
|
# meson builds
|
||||||
"cmake:init")
|
"meson:target")
|
||||||
echo "Executing (init): cmake $CMAKE_GENERATOR_NINJA $INIT_CMAKE_OPTS $PKG_CMAKE_OPTS_INIT $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
echo "Executing (target): meson $TARGET_MESON_OPTS $PKG_MESON_OPTS_TARGET $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
|
||||||
cmake $CMAKE_GENERATOR_NINJA $INIT_CMAKE_OPTS $PKG_CMAKE_OPTS_INIT $(dirname $PKG_CMAKE_SCRIPT)
|
meson $TARGET_MESON_OPTS $PKG_MESON_OPTS_TARGET $(dirname $PKG_MESON_SCRIPT)
|
||||||
;;
|
;;
|
||||||
"cmake:bootstrap")
|
"meson:host")
|
||||||
echo "Executing (bootstrap): cmake $CMAKE_GENERATOR_NINJA $BOOTSTRAP_CMAKE_OPTS $PKG_CMAKE_OPTS_BOOTSTRAP $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
echo "Executing (host): meson $HOST_MESON_OPTS $PKG_MESON_OPTS_HOST $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
|
||||||
cmake $CMAKE_GENERATOR_NINJA $BOOTSTRAP_CMAKE_OPTS $PKG_CMAKE_OPTS_BOOTSTRAP $(dirname $PKG_CMAKE_SCRIPT)
|
meson $HOST_MESON_OPTS $PKG_MESON_OPTS_HOST $(dirname $PKG_MESON_SCRIPT)
|
||||||
;;
|
;;
|
||||||
|
"meson:init")
|
||||||
# cmake builds with make
|
echo "Executing (init): meson $INIT_MESON_OPTS $PKG_MESON_OPTS_INIT $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
|
||||||
"cmake-make:target")
|
meson $INIT_MESON_OPTS $PKG_MESON_OPTS_INIT $(dirname $PKG_MESON_SCRIPT)
|
||||||
echo "Executing (target): cmake $TARGET_CMAKE_OPTS $PKG_CMAKE_OPTS_TARGET $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
;;
|
||||||
cmake $TARGET_CMAKE_OPTS $PKG_CMAKE_OPTS_TARGET $(dirname $PKG_CMAKE_SCRIPT)
|
"meson:bootstrap")
|
||||||
;;
|
echo "Executing (bootstrap): meson $BOOTSTRAP_MESON_OPTS $PKG_MESON_OPTS_BOOTSTRAP $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
|
||||||
"cmake-make:host")
|
meson $BOOTSTRAP_MESON_OPTS $PKG_MESON_OPTS_BOOTSTRAP $(dirname $PKG_MESON_SCRIPT)
|
||||||
echo "Executing (host): cmake $HOST_CMAKE_OPTS $PKG_CMAKE_OPTS_HOST $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
;;
|
||||||
cmake $HOST_CMAKE_OPTS $PKG_CMAKE_OPTS_HOST $(dirname $PKG_CMAKE_SCRIPT)
|
|
||||||
;;
|
# cmake builds with ninja
|
||||||
"cmake-make:init")
|
"cmake:target")
|
||||||
echo "Executing (init): cmake $INIT_CMAKE_OPTS $PKG_CMAKE_OPTS_INIT $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
echo "Executing (target): cmake $CMAKE_GENERATOR_NINJA $TARGET_CMAKE_OPTS $PKG_CMAKE_OPTS_TARGET $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
||||||
cmake $INIT_CMAKE_OPTS $PKG_CMAKE_OPTS_INIT $(dirname $PKG_CMAKE_SCRIPT)
|
cmake $CMAKE_GENERATOR_NINJA $TARGET_CMAKE_OPTS $PKG_CMAKE_OPTS_TARGET $(dirname $PKG_CMAKE_SCRIPT)
|
||||||
;;
|
;;
|
||||||
"cmake-make:bootstrap")
|
"cmake:host")
|
||||||
echo "Executing (bootstrap): cmake $BOOTSTRAP_CMAKE_OPTS $PKG_CMAKE_OPTS_BOOTSTRAP $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
echo "Executing (host): cmake $CMAKE_GENERATOR_NINJA $HOST_CMAKE_OPTS $PKG_CMAKE_OPTS_HOST $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
||||||
cmake $BOOTSTRAP_CMAKE_OPTS $PKG_CMAKE_OPTS_BOOTSTRAP $(dirname $PKG_CMAKE_SCRIPT)
|
cmake $CMAKE_GENERATOR_NINJA $HOST_CMAKE_OPTS $PKG_CMAKE_OPTS_HOST $(dirname $PKG_CMAKE_SCRIPT)
|
||||||
;;
|
;;
|
||||||
|
"cmake:init")
|
||||||
# configure builds
|
echo "Executing (init): cmake $CMAKE_GENERATOR_NINJA $INIT_CMAKE_OPTS $PKG_CMAKE_OPTS_INIT $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
||||||
"configure:target"|"autotools:target")
|
cmake $CMAKE_GENERATOR_NINJA $INIT_CMAKE_OPTS $PKG_CMAKE_OPTS_INIT $(dirname $PKG_CMAKE_SCRIPT)
|
||||||
echo "Executing (target): $PKG_CONFIGURE_SCRIPT $TARGET_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_TARGET" | tr -s " "
|
;;
|
||||||
$PKG_CONFIGURE_SCRIPT $TARGET_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_TARGET
|
"cmake:bootstrap")
|
||||||
;;
|
echo "Executing (bootstrap): cmake $CMAKE_GENERATOR_NINJA $BOOTSTRAP_CMAKE_OPTS $PKG_CMAKE_OPTS_BOOTSTRAP $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
||||||
"configure:host"|"autotools:host")
|
cmake $CMAKE_GENERATOR_NINJA $BOOTSTRAP_CMAKE_OPTS $PKG_CMAKE_OPTS_BOOTSTRAP $(dirname $PKG_CMAKE_SCRIPT)
|
||||||
echo "Executing (host): $PKG_CONFIGURE_SCRIPT $HOST_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_HOST" | tr -s " "
|
;;
|
||||||
$PKG_CONFIGURE_SCRIPT $HOST_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_HOST
|
|
||||||
;;
|
# cmake builds with make
|
||||||
"configure:init"|"autotools:init")
|
"cmake-make:target")
|
||||||
echo "Executing (init): $PKG_CONFIGURE_SCRIPT $INIT_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_INIT" | tr -s " "
|
echo "Executing (target): cmake $TARGET_CMAKE_OPTS $PKG_CMAKE_OPTS_TARGET $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
||||||
$PKG_CONFIGURE_SCRIPT $INIT_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_INIT
|
cmake $TARGET_CMAKE_OPTS $PKG_CMAKE_OPTS_TARGET $(dirname $PKG_CMAKE_SCRIPT)
|
||||||
;;
|
;;
|
||||||
"configure:bootstrap"|"autotools:bootstrap")
|
"cmake-make:host")
|
||||||
echo "Executing (bootstrap): $PKG_CONFIGURE_SCRIPT $BOOTSTRAP_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_BOOTSTRAP" | tr -s " "
|
echo "Executing (host): cmake $HOST_CMAKE_OPTS $PKG_CMAKE_OPTS_HOST $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
||||||
$PKG_CONFIGURE_SCRIPT $BOOTSTRAP_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_BOOTSTRAP
|
cmake $HOST_CMAKE_OPTS $PKG_CMAKE_OPTS_HOST $(dirname $PKG_CMAKE_SCRIPT)
|
||||||
;;
|
;;
|
||||||
esac
|
"cmake-make:init")
|
||||||
fi
|
echo "Executing (init): cmake $INIT_CMAKE_OPTS $PKG_CMAKE_OPTS_INIT $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
||||||
if [ "$(type -t post_configure_$TARGET)" = "function" ]; then
|
cmake $INIT_CMAKE_OPTS $PKG_CMAKE_OPTS_INIT $(dirname $PKG_CMAKE_SCRIPT)
|
||||||
post_configure_$TARGET
|
;;
|
||||||
fi
|
"cmake-make:bootstrap")
|
||||||
|
echo "Executing (bootstrap): cmake $BOOTSTRAP_CMAKE_OPTS $PKG_CMAKE_OPTS_BOOTSTRAP $(dirname $PKG_CMAKE_SCRIPT)" | tr -s " "
|
||||||
# make
|
cmake $BOOTSTRAP_CMAKE_OPTS $PKG_CMAKE_OPTS_BOOTSTRAP $(dirname $PKG_CMAKE_SCRIPT)
|
||||||
if [ "$(type -t pre_make_$TARGET)" = "function" ]; then
|
;;
|
||||||
pre_make_$TARGET
|
|
||||||
fi
|
# configure builds
|
||||||
if [ "$(type -t make_$TARGET)" = "function" ]; then
|
"configure:target"|"autotools:target")
|
||||||
make_$TARGET
|
echo "Executing (target): $PKG_CONFIGURE_SCRIPT $TARGET_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_TARGET" | tr -s " "
|
||||||
else
|
$PKG_CONFIGURE_SCRIPT $TARGET_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_TARGET
|
||||||
case "$PKG_TOOLCHAIN:$TARGET" in
|
;;
|
||||||
# ninja based builds
|
"configure:host"|"autotools:host")
|
||||||
"meson:target"|"cmake:target"|"ninja:target")
|
echo "Executing (host): $PKG_CONFIGURE_SCRIPT $HOST_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_HOST" | tr -s " "
|
||||||
echo "Executing (target): ninja $PKG_MAKE_OPTS_TARGET" | tr -s " "
|
$PKG_CONFIGURE_SCRIPT $HOST_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_HOST
|
||||||
ninja $PKG_MAKE_OPTS_TARGET
|
;;
|
||||||
;;
|
"configure:init"|"autotools:init")
|
||||||
"meson:host"|"cmake:host"|"ninja:host")
|
echo "Executing (init): $PKG_CONFIGURE_SCRIPT $INIT_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_INIT" | tr -s " "
|
||||||
echo "Executing (host): ninja $PKG_MAKE_OPTS_HOST" | tr -s " "
|
$PKG_CONFIGURE_SCRIPT $INIT_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_INIT
|
||||||
ninja $PKG_MAKE_OPTS_HOST
|
;;
|
||||||
;;
|
"configure:bootstrap"|"autotools:bootstrap")
|
||||||
"meson:init"|"cmake:init"|"ninja:init")
|
echo "Executing (bootstrap): $PKG_CONFIGURE_SCRIPT $BOOTSTRAP_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_BOOTSTRAP" | tr -s " "
|
||||||
echo "Executing (init): ninja $PKG_MAKE_OPTS_INIT" | tr -s " "
|
$PKG_CONFIGURE_SCRIPT $BOOTSTRAP_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_BOOTSTRAP
|
||||||
ninja $PKG_MAKE_OPTS_INIT
|
;;
|
||||||
;;
|
esac
|
||||||
"meson:bootstrap"|"cmake:bootstrap"|"ninja:bootstrap")
|
fi
|
||||||
echo "Executing (bootstrap): ninja $PKG_MAKE_OPTS_BOOTSTRAP" | tr -s " "
|
if [ "$(type -t post_configure_$TARGET)" = "function" ]; then
|
||||||
ninja $PKG_MAKE_OPTS_BOOTSTRAP
|
post_configure_$TARGET
|
||||||
;;
|
fi
|
||||||
|
|
||||||
# make based builds
|
# make
|
||||||
"configure:target"|"cmake-make:target"|"autotools:target"|"make:target")
|
if [ "$(type -t pre_make_$TARGET)" = "function" ]; then
|
||||||
echo "Executing (target): make $PKG_MAKE_OPTS_TARGET" | tr -s " "
|
pre_make_$TARGET
|
||||||
make $PKG_MAKE_OPTS_TARGET
|
fi
|
||||||
;;
|
if [ "$(type -t make_$TARGET)" = "function" ]; then
|
||||||
"configure:host"|"cmake-make:host"|"autotools:host"|"make:host")
|
make_$TARGET
|
||||||
echo "Executing (host): make $PKG_MAKE_OPTS_HOST" | tr -s " "
|
else
|
||||||
make $PKG_MAKE_OPTS_HOST
|
case "$PKG_TOOLCHAIN:$TARGET" in
|
||||||
;;
|
# ninja based builds
|
||||||
"configure:init"|"cmake-make:init"|"autotools:init"|"make:init")
|
"meson:target"|"cmake:target"|"ninja:target")
|
||||||
echo "Executing (init): make $PKG_MAKE_OPTS_INIT" | tr -s " "
|
echo "Executing (target): ninja $PKG_MAKE_OPTS_TARGET" | tr -s " "
|
||||||
make $PKG_MAKE_OPTS_INIT
|
ninja $PKG_MAKE_OPTS_TARGET
|
||||||
;;
|
;;
|
||||||
"configure:bootstrap"|"cmake-make:bootstrap"|"autotools:bootstrap"|"make:bootstrap")
|
"meson:host"|"cmake:host"|"ninja:host")
|
||||||
echo "Executing (bootstrap): make $PKG_MAKE_OPTS_BOOTSTRAP" | tr -s " "
|
echo "Executing (host): ninja $PKG_MAKE_OPTS_HOST" | tr -s " "
|
||||||
make $PKG_MAKE_OPTS_BOOTSTRAP
|
ninja $PKG_MAKE_OPTS_HOST
|
||||||
;;
|
;;
|
||||||
esac
|
"meson:init"|"cmake:init"|"ninja:init")
|
||||||
fi
|
echo "Executing (init): ninja $PKG_MAKE_OPTS_INIT" | tr -s " "
|
||||||
if [ "$(type -t post_make_$TARGET)" = "function" ]; then
|
ninja $PKG_MAKE_OPTS_INIT
|
||||||
post_make_$TARGET
|
;;
|
||||||
fi
|
"meson:bootstrap"|"cmake:bootstrap"|"ninja:bootstrap")
|
||||||
|
echo "Executing (bootstrap): ninja $PKG_MAKE_OPTS_BOOTSTRAP" | tr -s " "
|
||||||
# make install
|
ninja $PKG_MAKE_OPTS_BOOTSTRAP
|
||||||
if [ "$(type -t pre_makeinstall_$TARGET)" = "function" ]; then
|
;;
|
||||||
pre_makeinstall_$TARGET
|
|
||||||
fi
|
# make based builds
|
||||||
if [ "$(type -t makeinstall_$TARGET)" = "function" ]; then
|
"configure:target"|"cmake-make:target"|"autotools:target"|"make:target")
|
||||||
makeinstall_$TARGET
|
echo "Executing (target): make $PKG_MAKE_OPTS_TARGET" | tr -s " "
|
||||||
else
|
make $PKG_MAKE_OPTS_TARGET
|
||||||
case "$PKG_TOOLCHAIN:$TARGET" in
|
;;
|
||||||
# ninja based builds
|
"configure:host"|"cmake-make:host"|"autotools:host"|"make:host")
|
||||||
"meson:target"|"cmake:target")
|
echo "Executing (host): make $PKG_MAKE_OPTS_HOST" | tr -s " "
|
||||||
DESTDIR=$SYSROOT_PREFIX ninja install $PKG_MAKEINSTALL_OPTS_TARGET
|
make $PKG_MAKE_OPTS_HOST
|
||||||
DESTDIR=$INSTALL ninja install $PKG_MAKEINSTALL_OPTS_TARGET
|
;;
|
||||||
;;
|
"configure:init"|"cmake-make:init"|"autotools:init"|"make:init")
|
||||||
"meson:host"|"cmake:host")
|
echo "Executing (init): make $PKG_MAKE_OPTS_INIT" | tr -s " "
|
||||||
ninja install $PKG_MAKEINSTALL_OPTS_HOST
|
make $PKG_MAKE_OPTS_INIT
|
||||||
;;
|
;;
|
||||||
"meson:init"|"cmake:init")
|
"configure:bootstrap"|"cmake-make:bootstrap"|"autotools:bootstrap"|"make:bootstrap")
|
||||||
DESTDIR=$INSTALL ninja install $PKG_MAKEINSTALL_OPTS_INIT
|
echo "Executing (bootstrap): make $PKG_MAKE_OPTS_BOOTSTRAP" | tr -s " "
|
||||||
;;
|
make $PKG_MAKE_OPTS_BOOTSTRAP
|
||||||
"meson:bootstrap"|"cmake:bootstrap")
|
;;
|
||||||
ninja install $PKG_MAKEINSTALL_OPTS_BOOTSTRAP
|
esac
|
||||||
;;
|
fi
|
||||||
|
if [ "$(type -t post_make_$TARGET)" = "function" ]; then
|
||||||
# make based builds
|
post_make_$TARGET
|
||||||
"configure:target"|"cmake-make:target"|"autotools:target"|"make:target")
|
fi
|
||||||
$MAKEINSTALL $PKG_MAKEINSTALL_OPTS_TARGET
|
|
||||||
make install DESTDIR=$INSTALL $PKG_MAKEINSTALL_OPTS_TARGET
|
# make install
|
||||||
;;
|
if [ "$(type -t pre_makeinstall_$TARGET)" = "function" ]; then
|
||||||
"configure:host"|"cmake-make:host"|"autotools:host"|"make:host")
|
pre_makeinstall_$TARGET
|
||||||
make install $PKG_MAKEINSTALL_OPTS_HOST
|
fi
|
||||||
;;
|
if [ "$(type -t makeinstall_$TARGET)" = "function" ]; then
|
||||||
"configure:init"|"cmake-make:init"|"autotools:init"|"make:init")
|
makeinstall_$TARGET
|
||||||
make install DESTDIR=$INSTALL $PKG_MAKEINSTALL_OPTS_INIT
|
else
|
||||||
;;
|
case "$PKG_TOOLCHAIN:$TARGET" in
|
||||||
"configure:bootstrap"|"cmake-make:bootstrap"|"autotools:bootstrap"|"make:bootstrap")
|
# ninja based builds
|
||||||
make install $PKG_MAKEINSTALL_OPTS_BOOTSTRAP
|
"meson:target"|"cmake:target")
|
||||||
;;
|
DESTDIR=$SYSROOT_PREFIX ninja install $PKG_MAKEINSTALL_OPTS_TARGET
|
||||||
esac
|
DESTDIR=$INSTALL ninja install $PKG_MAKEINSTALL_OPTS_TARGET
|
||||||
fi
|
;;
|
||||||
if [ "$(type -t post_makeinstall_$TARGET)" = "function" ]; then
|
"meson:host"|"cmake:host")
|
||||||
post_makeinstall_$TARGET
|
ninja install $PKG_MAKEINSTALL_OPTS_HOST
|
||||||
fi
|
;;
|
||||||
|
"meson:init"|"cmake:init")
|
||||||
if [ "$TARGET" = "target" -o "$TARGET" = "init" ]; then
|
DESTDIR=$INSTALL ninja install $PKG_MAKEINSTALL_OPTS_INIT
|
||||||
if [ -d $INSTALL ] ; then
|
;;
|
||||||
rm -rf $INSTALL/{usr/,}include
|
"meson:bootstrap"|"cmake:bootstrap")
|
||||||
rm -rf $INSTALL/{usr/,}lib/cmake
|
ninja install $PKG_MAKEINSTALL_OPTS_BOOTSTRAP
|
||||||
rm -rf $INSTALL/{usr/,}lib/pkgconfig
|
;;
|
||||||
rm -rf $INSTALL/{usr/,}man
|
|
||||||
rm -rf $INSTALL/{usr/,}share/aclocal
|
# make based builds
|
||||||
rm -rf $INSTALL/{usr/,}share/bash-completion
|
"configure:target"|"cmake-make:target"|"autotools:target"|"make:target")
|
||||||
rm -rf $INSTALL/{usr/,}share/doc
|
$MAKEINSTALL $PKG_MAKEINSTALL_OPTS_TARGET
|
||||||
rm -rf $INSTALL/{usr/,}share/gtk-doc
|
make install DESTDIR=$INSTALL $PKG_MAKEINSTALL_OPTS_TARGET
|
||||||
rm -rf $INSTALL/{usr/,}share/info
|
;;
|
||||||
rm -rf $INSTALL/{usr/,}share/locale
|
"configure:host"|"cmake-make:host"|"autotools:host"|"make:host")
|
||||||
rm -rf $INSTALL/{usr/,}share/man
|
make install $PKG_MAKEINSTALL_OPTS_HOST
|
||||||
rm -rf $INSTALL/{usr/,}share/pkgconfig
|
;;
|
||||||
rm -rf $INSTALL/{usr/,}share/zsh
|
"configure:init"|"cmake-make:init"|"autotools:init"|"make:init")
|
||||||
rm -rf $INSTALL/{usr/,}var
|
make install DESTDIR=$INSTALL $PKG_MAKEINSTALL_OPTS_INIT
|
||||||
find $INSTALL \( -name "*.orig" \
|
;;
|
||||||
-o -name "*.rej" \
|
"configure:bootstrap"|"cmake-make:bootstrap"|"autotools:bootstrap"|"make:bootstrap")
|
||||||
-o -name "*.a" \
|
make install $PKG_MAKEINSTALL_OPTS_BOOTSTRAP
|
||||||
-o -name "*.la" \
|
;;
|
||||||
-o -name "*.o" \
|
esac
|
||||||
-o -name "*.in" \
|
fi
|
||||||
-o -name ".git*" \) \
|
if [ "$(type -t post_makeinstall_$TARGET)" = "function" ]; then
|
||||||
-exec rm -f {} \; 2>/dev/null || :
|
post_makeinstall_$TARGET
|
||||||
find $INSTALL -type d -exec rmdir -p {} \; 2>/dev/null || :
|
fi
|
||||||
|
|
||||||
if [ ! "$DEBUG" = yes ]; then
|
if [ "$TARGET" = "target" -o "$TARGET" = "init" ]; then
|
||||||
$STRIP `find $INSTALL \
|
if [ -d $INSTALL ] ; then
|
||||||
-type f -name "*.so*" \
|
rm -rf $INSTALL/{usr/,}include
|
||||||
! -name "ld-*.so" \
|
rm -rf $INSTALL/{usr/,}lib/cmake
|
||||||
! -name "libc-*.so" \
|
rm -rf $INSTALL/{usr/,}lib/pkgconfig
|
||||||
! -name "libpthread-*.so" \
|
rm -rf $INSTALL/{usr/,}man
|
||||||
! -name "libthread_db-*so" \
|
rm -rf $INSTALL/{usr/,}share/aclocal
|
||||||
2>/dev/null` 2>/dev/null || :
|
rm -rf $INSTALL/{usr/,}share/bash-completion
|
||||||
if [ "$TARGET" = "init" ]; then
|
rm -rf $INSTALL/{usr/,}share/doc
|
||||||
$STRIP `find $INSTALL -type f -name "*.so*" 2>/dev/null` 2>/dev/null || :
|
rm -rf $INSTALL/{usr/,}share/gtk-doc
|
||||||
fi
|
rm -rf $INSTALL/{usr/,}share/info
|
||||||
$STRIP `find $INSTALL/bin $INSTALL/usr/bin $INSTALL/sbin $INSTALL/usr/sbin \
|
rm -rf $INSTALL/{usr/,}share/locale
|
||||||
-type f -executable 2>/dev/null` 2>/dev/null || :
|
rm -rf $INSTALL/{usr/,}share/man
|
||||||
fi
|
rm -rf $INSTALL/{usr/,}share/pkgconfig
|
||||||
fi
|
rm -rf $INSTALL/{usr/,}share/zsh
|
||||||
fi
|
rm -rf $INSTALL/{usr/,}var
|
||||||
|
find $INSTALL \( -name "*.orig" \
|
||||||
cd $ROOT
|
-o -name "*.rej" \
|
||||||
fi # ! "$PKG_SECTION" = "virtual"
|
-o -name "*.a" \
|
||||||
|
-o -name "*.la" \
|
||||||
for i in `find $SYSROOT_PREFIX/usr/lib/ -name "*.la" 2>/dev/null`; do \
|
-o -name "*.o" \
|
||||||
$SED "s:\(['= ]\)/usr:\\1$SYSROOT_PREFIX/usr:g" $i; \
|
-o -name "*.in" \
|
||||||
done
|
-o -name ".git*" \) \
|
||||||
|
-exec rm -f {} \; 2>/dev/null || :
|
||||||
PKG_DEEPMD5=$(find $STAMP_DEPENDS -exec md5sum {} \; 2>/dev/null | sort | md5sum | cut -d" " -f1)
|
find $INSTALL -type d -exec rmdir -p {} \; 2>/dev/null || :
|
||||||
for i in PKG_NAME PKG_DEEPMD5; do
|
|
||||||
echo "STAMP_$i=\"${!i}\"" >> $STAMP
|
if [ ! "$DEBUG" = yes ]; then
|
||||||
done
|
$STRIP `find $INSTALL \
|
||||||
|
-type f -name "*.so*" \
|
||||||
if [ "$1" = "u-boot" ]; then
|
! -name "ld-*.so" \
|
||||||
echo "STAMP_UBOOT_SYSTEM=\"${UBOOT_SYSTEM}\"" >> $STAMP
|
! -name "libc-*.so" \
|
||||||
fi
|
! -name "libpthread-*.so" \
|
||||||
|
! -name "libthread_db-*so" \
|
||||||
|
2>/dev/null` 2>/dev/null || :
|
||||||
|
if [ "$TARGET" = "init" ]; then
|
||||||
|
$STRIP `find $INSTALL -type f -name "*.so*" 2>/dev/null` 2>/dev/null || :
|
||||||
|
fi
|
||||||
|
$STRIP `find $INSTALL/bin $INSTALL/usr/bin $INSTALL/sbin $INSTALL/usr/sbin \
|
||||||
|
-type f -executable 2>/dev/null` 2>/dev/null || :
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd $ROOT
|
||||||
|
|
||||||
|
for i in `find $SYSROOT_PREFIX/usr/lib/ -name "*.la" 2>/dev/null`; do \
|
||||||
|
$SED "s:\(['= ]\)/usr:\\1$SYSROOT_PREFIX/usr:g" $i; \
|
||||||
|
done
|
||||||
|
|
||||||
|
PKG_DEEPMD5=$(find $STAMP_DEPENDS -exec md5sum {} \; 2>/dev/null | sort | md5sum | cut -d" " -f1)
|
||||||
|
for i in PKG_NAME PKG_DEEPMD5; do
|
||||||
|
echo "STAMP_$i=\"${!i}\"" >> $STAMP
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$1" = "u-boot" ]; then
|
||||||
|
echo "STAMP_UBOOT_SYSTEM=\"${UBOOT_SYSTEM}\"" >> $STAMP
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user