2013-07-19 00:35:52 +00:00
|
|
|
#!/bin/bash
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2011-01-09 20:26:03 +00:00
|
|
|
################################################################################
|
|
|
|
# This file is part of OpenELEC - http://www.openelec.tv
|
2016-01-02 16:26:58 +00:00
|
|
|
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
2011-01-09 20:26:03 +00:00
|
|
|
#
|
2013-12-21 20:51:48 +00:00
|
|
|
# OpenELEC is free software: you can redistribute it and/or modify
|
2011-01-09 20:26:03 +00:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
2013-12-21 20:51:48 +00:00
|
|
|
# the Free Software Foundation, either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
2011-01-09 20:26:03 +00:00
|
|
|
#
|
2013-12-21 20:51:48 +00:00
|
|
|
# OpenELEC is distributed in the hope that it will be useful,
|
2011-01-09 20:26:03 +00:00
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2013-12-21 20:51:48 +00:00
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2011-01-09 20:26:03 +00:00
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2013-12-21 20:51:48 +00:00
|
|
|
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
2011-01-09 20:26:03 +00:00
|
|
|
################################################################################
|
|
|
|
|
2010-07-21 16:54:45 +00:00
|
|
|
. config/options $1
|
2009-03-18 12:02:53 +00:00
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
2014-01-27 21:12:15 +00:00
|
|
|
echo "usage: $0 package_name[:<host|target|init|bootstrap>]"
|
2009-03-18 12:02:53 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2014-01-27 13:05:34 +00:00
|
|
|
if [ ! -f $PKG_DIR/package.mk ]; then
|
2014-08-17 16:13:43 +00:00
|
|
|
printf "${boldred}$1: no package.mk file found${endcolor}\n"
|
2014-01-27 13:05:34 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2013-07-17 04:12:14 +00:00
|
|
|
# set defaults
|
|
|
|
PKG_CONFIGURE_SCRIPT=""
|
|
|
|
PKG_MAKE_OPTS=""
|
|
|
|
PKG_MAKEINSTALL_OPTS=""
|
|
|
|
|
|
|
|
PACKAGE_NAME=$(echo $1 | awk -F : '{print $1}')
|
|
|
|
TARGET=$(echo $1 | awk -F : '{print $2}')
|
|
|
|
if [ -z "$TARGET" ]; then
|
|
|
|
TARGET="target"
|
|
|
|
fi
|
|
|
|
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 21:01:08 +00:00
|
|
|
if [ -n "$PKG_ARCH" -a ! "$PKG_ARCH" = "any" ]; then
|
|
|
|
echo "$PKG_ARCH" | grep -q "$TARGET_ARCH" || exit 0
|
|
|
|
echo "$PKG_ARCH" | grep -q "\-$TARGET_ARCH" && exit 0
|
2009-03-18 12:02:53 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
unset INSTALL
|
|
|
|
|
2013-07-17 04:12:14 +00:00
|
|
|
mkdir -p $STAMPS/$PACKAGE_NAME
|
|
|
|
STAMP=$STAMPS/$PACKAGE_NAME/build_$TARGET
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2013-07-17 04:12:14 +00:00
|
|
|
$SCRIPTS/unpack $PACKAGE_NAME
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 21:01:08 +00:00
|
|
|
|
2015-08-02 20:59:29 +00:00
|
|
|
STAMP_DEPENDS="$PKG_DIR $PKG_NEED_UNPACK $PROJECT_DIR/$PROJECT/patches/$PKG_NAME"
|
2016-10-15 22:54:53 +00:00
|
|
|
[ -n "$DEVICE" ] && STAMP_DEPENDS="$STAMP_DEPENDS $PROJECT_DIR/$PROJECT/devices/$DEVICE/patches/$PKG_NAME"
|
2015-08-02 20:59:29 +00:00
|
|
|
|
|
|
|
if [ -f $STAMP ] ; then
|
|
|
|
. $STAMP
|
2015-10-23 10:53:36 +00:00
|
|
|
PKG_DEEPMD5=$(find $STAMP_DEPENDS -exec md5sum {} \; 2>/dev/null | sort | md5sum | cut -d" " -f1)
|
2015-08-02 20:59:29 +00:00
|
|
|
if [ ! "$PKG_DEEPMD5" = "$STAMP_PKG_DEEPMD5" ] ; then
|
|
|
|
rm -f $STAMP
|
|
|
|
fi
|
2009-03-18 12:02:53 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f $STAMP ]; then
|
|
|
|
rm -f $STAMP
|
|
|
|
|
2016-09-23 21:29:49 +00:00
|
|
|
setup_toolchain $TARGET
|
2013-07-17 04:12:14 +00:00
|
|
|
|
2014-01-27 02:34:44 +00:00
|
|
|
# unset functions
|
|
|
|
unset -f pre_build_target
|
|
|
|
unset -f pre_configure_target
|
|
|
|
unset -f configure_target
|
|
|
|
unset -f post_configure_target
|
|
|
|
unset -f pre_make_target
|
|
|
|
unset -f make_target
|
|
|
|
unset -f post_make_target
|
|
|
|
unset -f pre_makeinstall_target
|
|
|
|
unset -f makeinstall_target
|
|
|
|
unset -f post_makeinstall_target
|
|
|
|
|
|
|
|
unset -f pre_build_host
|
|
|
|
unset -f pre_configure_host
|
|
|
|
unset -f configure_host
|
|
|
|
unset -f post_configure_host
|
|
|
|
unset -f pre_make_host
|
|
|
|
unset -f make_host
|
|
|
|
unset -f post_make_host
|
|
|
|
unset -f pre_makeinstall_host
|
|
|
|
unset -f makeinstall_host
|
|
|
|
unset -f post_makeinstall_host
|
|
|
|
|
|
|
|
unset -f pre_build_init
|
|
|
|
unset -f pre_configure_init
|
|
|
|
unset -f configure_init
|
|
|
|
unset -f post_configure_init
|
|
|
|
unset -f pre_make_init
|
|
|
|
unset -f make_init
|
|
|
|
unset -f post_make_init
|
|
|
|
unset -f pre_makeinstall_init
|
|
|
|
unset -f makeinstall_init
|
|
|
|
unset -f post_makeinstall_init
|
|
|
|
|
|
|
|
unset -f pre_build_bootstrap
|
|
|
|
unset -f pre_configure_bootstrap
|
|
|
|
unset -f configure_bootstrap
|
|
|
|
unset -f post_configure_bootstrap
|
|
|
|
unset -f pre_make_bootstrap
|
|
|
|
unset -f make_bootstrap
|
|
|
|
unset -f post_make_bootstrap
|
|
|
|
unset -f pre_makeinstall_bootstrap
|
|
|
|
unset -f makeinstall_bootstrap
|
|
|
|
unset -f post_makeinstall_bootstrap
|
|
|
|
|
|
|
|
# configure TARGET build defaults
|
|
|
|
TARGET_CONFIGURE_OPTS="--host=$TARGET_NAME \
|
2013-10-14 13:24:33 +00:00
|
|
|
--build=$HOST_NAME \
|
|
|
|
--prefix=/usr \
|
|
|
|
--bindir=/usr/bin \
|
|
|
|
--sbindir=/usr/sbin \
|
|
|
|
--sysconfdir=/etc \
|
2016-12-04 21:23:41 +00:00
|
|
|
--libdir=/usr/lib \
|
2013-10-14 13:24:33 +00:00
|
|
|
--libexecdir=/usr/lib \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--disable-static \
|
|
|
|
--enable-shared"
|
|
|
|
|
2016-09-29 19:17:51 +00:00
|
|
|
if [ "$DEBUG" = "yes" ]; then
|
|
|
|
CMAKE_BUILD_TYPE="Debug"
|
|
|
|
else
|
2016-10-13 07:29:17 +00:00
|
|
|
CMAKE_BUILD_TYPE="MinSizeRel"
|
2016-09-29 19:17:51 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 21:29:49 +00:00
|
|
|
TARGET_CMAKE_OPTS="-DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \
|
2016-09-24 08:19:48 +00:00
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
2016-09-29 19:17:51 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE"
|
2016-09-23 21:29:49 +00:00
|
|
|
|
2014-01-27 02:34:44 +00:00
|
|
|
# configure HOST build defaults
|
|
|
|
HOST_CONFIGURE_OPTS="--host=$HOST_NAME \
|
|
|
|
--build=$HOST_NAME \
|
|
|
|
--prefix=$ROOT/$TOOLCHAIN \
|
|
|
|
--bindir=$ROOT/$TOOLCHAIN/bin \
|
|
|
|
--sbindir=$ROOT/$TOOLCHAIN/sbin \
|
|
|
|
--sysconfdir=$ROOT/$TOOLCHAIN/etc \
|
|
|
|
--libexecdir=$ROOT/$TOOLCHAIN/lib \
|
|
|
|
--localstatedir=$ROOT/$TOOLCHAIN/var \
|
|
|
|
--disable-static \
|
|
|
|
--enable-shared"
|
|
|
|
|
2016-09-23 21:29:49 +00:00
|
|
|
HOST_CMAKE_OPTS="-DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \
|
2016-09-24 08:19:48 +00:00
|
|
|
-DCMAKE_INSTALL_PREFIX=$ROOT/$TOOLCHAIN \
|
2016-09-29 19:17:51 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=Release"
|
2016-09-23 21:29:49 +00:00
|
|
|
|
2014-01-27 02:34:44 +00:00
|
|
|
# configure INIT build defaults
|
2016-09-23 21:29:49 +00:00
|
|
|
INIT_CONFIGURE_OPTS="$TARGET_CONFIGURE_OPTS"
|
2016-09-23 21:29:49 +00:00
|
|
|
INIT_CMAKE_OPTS="$TARGET_CMAKE_OPTS"
|
2014-01-27 02:34:44 +00:00
|
|
|
|
|
|
|
# configure BOOTSTRAP build defaults
|
2016-09-23 21:29:49 +00:00
|
|
|
BOOTSTRAP_CONFIGURE_OPTS="$HOST_CONFIGURE_OPTS"
|
2016-09-23 21:29:49 +00:00
|
|
|
BOOTSTRAP_CMAKE_OPTS="$HOST_CMAKE_OPTS"
|
2014-01-27 02:34:44 +00:00
|
|
|
|
|
|
|
# include buildfile
|
|
|
|
. $PKG_DIR/package.mk
|
|
|
|
|
|
|
|
if [ "$TARGET" = "target" ]; then
|
2014-01-30 13:44:26 +00:00
|
|
|
for p in $PKG_DEPENDS_TARGET; do
|
2014-01-27 02:34:44 +00:00
|
|
|
$SCRIPTS/build $p
|
|
|
|
done
|
|
|
|
elif [ "$TARGET" = "host" ]; then
|
2014-01-30 13:44:26 +00:00
|
|
|
for p in $PKG_DEPENDS_HOST; do
|
2014-01-27 02:34:44 +00:00
|
|
|
$SCRIPTS/build $p
|
|
|
|
done
|
|
|
|
elif [ "$TARGET" = "init" ]; then
|
2014-01-30 13:44:26 +00:00
|
|
|
for p in $PKG_DEPENDS_INIT; do
|
2014-01-27 02:34:44 +00:00
|
|
|
$SCRIPTS/build $p
|
|
|
|
done
|
|
|
|
elif [ "$TARGET" = "bootstrap" ]; then
|
2014-01-30 13:44:26 +00:00
|
|
|
for p in $PKG_DEPENDS_BOOTSTRAP; do
|
2014-01-27 02:34:44 +00:00
|
|
|
$SCRIPTS/build $p
|
|
|
|
done
|
|
|
|
fi
|
2013-07-17 04:12:14 +00:00
|
|
|
|
2014-04-02 09:17:04 +00:00
|
|
|
printf "%${BUILD_INDENT}c ${boldyellow}BUILD${endcolor} $PACKAGE_NAME ${boldwhite}($TARGET)${endcolor}\n" ' '>&$SILENT_OUT
|
|
|
|
export BUILD_INDENT=$((${BUILD_INDENT:-1}+$BUILD_INDENT_SIZE))
|
|
|
|
|
2014-01-27 02:34:44 +00:00
|
|
|
if [ "$PKG_AUTORECONF" = yes ]; then
|
|
|
|
$SCRIPTS/autoreconf $PACKAGE_NAME
|
|
|
|
fi
|
2013-07-17 04:12:14 +00:00
|
|
|
|
2014-01-27 02:34:44 +00:00
|
|
|
# virtual packages dont must be build, they only contains dependencies, so dont go further here
|
|
|
|
if [ ! "$PKG_SECTION" = "virtual" ]; then
|
2013-07-17 04:12:14 +00:00
|
|
|
|
|
|
|
# configure other variables
|
2014-01-27 02:34:44 +00:00
|
|
|
if [ "$TARGET" = "target" ]; then
|
|
|
|
INSTALL=$ROOT/$PKG_BUILD/.install_pkg
|
|
|
|
elif [ "$TARGET" = "init" ]; then
|
|
|
|
INSTALL=$ROOT/$PKG_BUILD/.install_init
|
|
|
|
fi
|
2013-07-17 04:12:14 +00:00
|
|
|
|
2013-10-25 18:48:14 +00:00
|
|
|
# clean up
|
|
|
|
if [ ! -z "$INSTALL" ] ; then
|
|
|
|
if [ -d "$INSTALL" ] ; then
|
|
|
|
rm -rf $INSTALL
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-07-17 04:12:14 +00:00
|
|
|
# setup configure script
|
2014-01-27 02:34:44 +00:00
|
|
|
if [ -z "$PKG_CONFIGURE_SCRIPT" ]; then
|
|
|
|
PKG_CONFIGURE_SCRIPT="$ROOT/$PKG_BUILD/configure"
|
|
|
|
else
|
|
|
|
PKG_CONFIGURE_SCRIPT="$ROOT/$PKG_BUILD/$PKG_CONFIGURE_SCRIPT"
|
|
|
|
fi
|
|
|
|
if [ -z "$PKG_CMAKE_SCRIPT" ]; then
|
|
|
|
PKG_CMAKE_SCRIPT="$ROOT/$PKG_BUILD/CMakeLists.txt"
|
|
|
|
fi
|
2013-07-17 04:12:14 +00:00
|
|
|
|
|
|
|
# include build template and build
|
2014-01-27 02:34:44 +00:00
|
|
|
if [ "$(type -t pre_build_$TARGET)" = "function" ]; then
|
|
|
|
pre_build_$TARGET
|
|
|
|
fi
|
2013-07-17 04:12:14 +00:00
|
|
|
|
2013-12-15 23:11:11 +00:00
|
|
|
# ensure $PKG_BUILD is there. (installer? PKG_URL="")
|
2014-01-27 02:34:44 +00:00
|
|
|
if [ ! -d $PKG_BUILD ] ; then
|
|
|
|
mkdir -p $PKG_BUILD
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $PKG_BUILD
|
2013-12-15 23:11:11 +00:00
|
|
|
|
2014-01-27 02:34:44 +00:00
|
|
|
if [ "$TARGET" = "target" ]; then
|
|
|
|
if [ -f "$PKG_CONFIGURE_SCRIPT" -o -f "$PKG_CMAKE_SCRIPT" ]; then
|
|
|
|
mkdir -p .$TARGET_NAME
|
|
|
|
cd .$TARGET_NAME
|
|
|
|
fi
|
|
|
|
elif [ "$TARGET" = "host" ]; then
|
|
|
|
if [ -f "$PKG_CONFIGURE_SCRIPT" -o -f "$PKG_CMAKE_SCRIPT" ]; then
|
|
|
|
mkdir -p .$HOST_NAME
|
|
|
|
cd .$HOST_NAME
|
|
|
|
fi
|
|
|
|
elif [ "$TARGET" = "init" ]; then
|
|
|
|
if [ -f "$PKG_CONFIGURE_SCRIPT" -o -f "$PKG_CMAKE_SCRIPT" ]; then
|
2016-09-23 21:29:49 +00:00
|
|
|
mkdir -p .$TARGET_NAME-$TARGET
|
|
|
|
cd .$TARGET_NAME-$TARGET
|
2014-01-27 02:34:44 +00:00
|
|
|
fi
|
|
|
|
elif [ "$TARGET" = "bootstrap" ]; then
|
|
|
|
if [ -f "$PKG_CONFIGURE_SCRIPT" -o -f "$PKG_CMAKE_SCRIPT" ]; then
|
2016-09-23 21:29:49 +00:00
|
|
|
mkdir -p .$HOST_NAME-$TARGET
|
|
|
|
cd .$HOST_NAME-$TARGET
|
2014-01-27 02:34:44 +00:00
|
|
|
fi
|
|
|
|
fi
|
2013-07-17 04:12:14 +00:00
|
|
|
|
2014-01-27 02:34:44 +00:00
|
|
|
# configure
|
|
|
|
if [ "$(type -t pre_configure_$TARGET)" = "function" ]; then
|
|
|
|
pre_configure_$TARGET
|
|
|
|
fi
|
|
|
|
if [ "$(type -t configure_$TARGET)" = "function" ]; then
|
|
|
|
configure_$TARGET
|
2016-09-23 21:29:49 +00:00
|
|
|
elif [ -f "$PKG_CMAKE_SCRIPT" -a ! "$PKG_USE_CMAKE" = "no" ]; then
|
|
|
|
if [ "$TARGET" = "target" ]; then
|
|
|
|
cmake $TARGET_CMAKE_OPTS $PKG_CMAKE_OPTS_TARGET $(dirname $PKG_CMAKE_SCRIPT)
|
|
|
|
elif [ "$TARGET" = "host" ]; then
|
|
|
|
cmake $HOST_CMAKE_OPTS $PKG_CMAKE_OPTS_HOST $(dirname $PKG_CMAKE_SCRIPT)
|
|
|
|
elif [ "$TARGET" = "init" ]; then
|
|
|
|
cmake $INIT_CMAKE_OPTS $PKG_CMAKE_OPTS_INIT $(dirname $PKG_CMAKE_SCRIPT)
|
|
|
|
elif [ "$TARGET" = "bootstrap" ]; then
|
|
|
|
cmake $BOOTSTRAP_CMAKE_OPTS $PKG_CMAKE_OPTS_BOOTSTRAP $(dirname $PKG_CMAKE_SCRIPT)
|
|
|
|
fi
|
2014-01-27 02:34:44 +00:00
|
|
|
elif [ -f "$PKG_CONFIGURE_SCRIPT" ]; then
|
2013-07-28 02:47:39 +00:00
|
|
|
if [ "$TARGET" = "target" ]; then
|
2014-01-27 02:34:44 +00:00
|
|
|
$PKG_CONFIGURE_SCRIPT $TARGET_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_TARGET
|
2013-07-17 04:12:14 +00:00
|
|
|
elif [ "$TARGET" = "host" ]; then
|
2014-01-27 02:34:44 +00:00
|
|
|
$PKG_CONFIGURE_SCRIPT $HOST_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_HOST
|
2013-10-14 13:24:33 +00:00
|
|
|
elif [ "$TARGET" = "init" ]; then
|
2014-01-27 02:34:44 +00:00
|
|
|
$PKG_CONFIGURE_SCRIPT $INIT_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_INIT
|
2013-08-05 22:48:16 +00:00
|
|
|
elif [ "$TARGET" = "bootstrap" ]; then
|
2014-01-27 02:34:44 +00:00
|
|
|
$PKG_CONFIGURE_SCRIPT $BOOTSTRAP_CONFIGURE_OPTS $PKG_CONFIGURE_OPTS_BOOTSTRAP
|
2013-07-17 04:12:14 +00:00
|
|
|
fi
|
2014-01-27 02:34:44 +00:00
|
|
|
fi
|
|
|
|
if [ "$(type -t post_configure_$TARGET)" = "function" ]; then
|
|
|
|
post_configure_$TARGET
|
|
|
|
fi
|
2013-07-17 04:12:14 +00:00
|
|
|
|
|
|
|
# make
|
2014-01-27 02:34:44 +00:00
|
|
|
if [ "$(type -t pre_make_$TARGET)" = "function" ]; then
|
|
|
|
pre_make_$TARGET
|
|
|
|
fi
|
|
|
|
if [ "$(type -t make_$TARGET)" = "function" ]; then
|
|
|
|
make_$TARGET
|
|
|
|
else
|
|
|
|
if [ "$TARGET" = "target" ]; then
|
|
|
|
make $PKG_MAKE_OPTS_TARGET
|
|
|
|
elif [ "$TARGET" = "host" ]; then
|
|
|
|
make $PKG_MAKE_OPTS_HOST
|
|
|
|
elif [ "$TARGET" = "init" ]; then
|
|
|
|
make $PKG_MAKE_OPTS_INIT
|
|
|
|
elif [ "$TARGET" = "bootstrap" ]; then
|
|
|
|
make $PKG_MAKE_OPTS_BOOTSTRAP
|
2013-07-17 04:12:14 +00:00
|
|
|
fi
|
2014-01-27 02:34:44 +00:00
|
|
|
fi
|
|
|
|
if [ "$(type -t post_make_$TARGET)" = "function" ]; then
|
|
|
|
post_make_$TARGET
|
|
|
|
fi
|
2013-07-17 04:12:14 +00:00
|
|
|
|
|
|
|
# make install
|
2014-01-27 02:34:44 +00:00
|
|
|
if [ "$(type -t pre_makeinstall_$TARGET)" = "function" ]; then
|
|
|
|
pre_makeinstall_$TARGET
|
|
|
|
fi
|
|
|
|
if [ "$(type -t makeinstall_$TARGET)" = "function" ]; then
|
|
|
|
makeinstall_$TARGET
|
|
|
|
else
|
|
|
|
if [ "$TARGET" = "target" ]; then
|
|
|
|
$MAKEINSTALL $PKG_MAKEINSTALL_OPTS_TARGET
|
|
|
|
make install DESTDIR=$INSTALL $PKG_MAKEINSTALL_OPTS_TARGET
|
|
|
|
elif [ "$TARGET" = "host" ]; then
|
|
|
|
make install $PKG_MAKEINSTALL_OPTS_HOST
|
|
|
|
elif [ "$TARGET" = "init" ]; then
|
|
|
|
make install DESTDIR=$INSTALL $PKG_MAKEINSTALL_OPTS_INIT
|
|
|
|
elif [ "$TARGET" = "bootstrap" ]; then
|
2016-09-23 21:29:49 +00:00
|
|
|
make install $PKG_MAKEINSTALL_OPTS_BOOTSTRAP
|
2013-07-17 04:12:14 +00:00
|
|
|
fi
|
2014-01-27 02:34:44 +00:00
|
|
|
fi
|
|
|
|
if [ "$(type -t post_makeinstall_$TARGET)" = "function" ]; then
|
|
|
|
post_makeinstall_$TARGET
|
|
|
|
fi
|
2013-07-17 04:12:14 +00:00
|
|
|
|
2014-01-27 02:34:44 +00:00
|
|
|
if [ "$TARGET" = "target" -o "$TARGET" = "init" ]; then
|
2016-10-03 00:17:47 +00:00
|
|
|
if [ -d $INSTALL ] ; then
|
|
|
|
rm -rf $INSTALL/{usr/,}include
|
|
|
|
rm -rf $INSTALL/{usr/,}lib/cmake
|
|
|
|
rm -rf $INSTALL/{usr/,}lib/pkgconfig
|
|
|
|
rm -rf $INSTALL/{usr/,}man
|
|
|
|
rm -rf $INSTALL/{usr/,}share/aclocal
|
|
|
|
rm -rf $INSTALL/{usr/,}share/bash-completion
|
|
|
|
rm -rf $INSTALL/{usr/,}share/doc
|
|
|
|
rm -rf $INSTALL/{usr/,}share/gtk-doc
|
|
|
|
rm -rf $INSTALL/{usr/,}share/info
|
|
|
|
rm -rf $INSTALL/{usr/,}share/locale
|
|
|
|
rm -rf $INSTALL/{usr/,}share/man
|
|
|
|
rm -rf $INSTALL/{usr/,}share/pkgconfig
|
|
|
|
rm -rf $INSTALL/{usr/,}share/zsh
|
|
|
|
rm -rf $INSTALL/{usr/,}var
|
|
|
|
find $INSTALL \( -name "*.orig" \
|
|
|
|
-o -name "*.rej" \
|
|
|
|
-o -name "*.a" \
|
|
|
|
-o -name "*.la" \
|
|
|
|
-o -name "*.o" \
|
|
|
|
-o -name "*.in" \
|
|
|
|
-o -name ".git*" \) \
|
|
|
|
-exec rm -f {} \; 2>/dev/null || :
|
|
|
|
find $INSTALL -type d -exec rmdir -p {} \; 2>/dev/null || :
|
2014-01-27 02:34:44 +00:00
|
|
|
|
|
|
|
if [ ! "$DEBUG" = yes ]; then
|
2016-01-30 23:21:45 +00:00
|
|
|
$STRIP `find $INSTALL \
|
|
|
|
-type f -name "*.so*" \
|
|
|
|
! -name "ld-*.so" \
|
|
|
|
! -name "libc-*.so" \
|
|
|
|
! -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
|
2016-01-30 23:21:56 +00:00
|
|
|
$STRIP `find $INSTALL/bin $INSTALL/usr/bin $INSTALL/sbin $INSTALL/usr/sbin \
|
|
|
|
-type f -executable 2>/dev/null` 2>/dev/null || :
|
2013-07-17 04:12:14 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-01-27 02:34:44 +00:00
|
|
|
cd $ROOT
|
|
|
|
fi # ! "$PKG_SECTION" = "virtual"
|
2013-07-17 04:12:14 +00:00
|
|
|
|
2014-01-27 02:34:44 +00:00
|
|
|
for i in `find $SYSROOT_PREFIX/usr/lib/ -name "*.la" 2>/dev/null`; do \
|
|
|
|
$SED "s:\(['= ]\)/usr:\\1$SYSROOT_PREFIX/usr:g" $i; \
|
|
|
|
done
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2015-10-23 10:53:36 +00:00
|
|
|
PKG_DEEPMD5=$(find $STAMP_DEPENDS -exec md5sum {} \; 2>/dev/null | sort | md5sum | cut -d" " -f1)
|
2015-08-02 20:59:29 +00:00
|
|
|
for i in PKG_NAME PKG_DEEPMD5; do
|
2014-01-27 02:34:44 +00:00
|
|
|
eval val=\$$i
|
|
|
|
echo "STAMP_$i=\"$val\"" >> $STAMP
|
|
|
|
done
|
2009-03-18 12:02:53 +00:00
|
|
|
fi
|