From 508b4e3ec0cb3e365942f4dc0626edda4789932b Mon Sep 17 00:00:00 2001 From: Que Quotion Date: Tue, 27 Nov 2018 18:23:02 +0900 Subject: Split prepare_buildenv() to libmakepkg This opens the door for third parties to provide libmakepkg extentions for the purpose of altering the build environment. Signed-off-by: Que Quotion Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 44 +------------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index d92e4aac..4449ccf7 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -48,11 +48,10 @@ declare -r startdir="$(pwd -P)" LIBRARY=${LIBRARY:-'@libmakepkgdir@'} -build_options=('ccache' 'distcc' 'buildflags' 'makeflags') splitpkg_overrides=('pkgdesc' 'arch' 'url' 'license' 'groups' 'depends' 'optdepends' 'provides' 'conflicts' 'replaces' 'backup' 'options' 'install' 'changelog') -readonly -a build_options splitpkg_overrides +readonly -a splitpkg_overrides known_hash_algos=('md5' 'sha1' 'sha224' 'sha256' 'sha384' 'sha512') @@ -380,47 +379,6 @@ source_buildfile() { source_safe "$@" } -prepare_buildenv() { - # clear user-specified buildflags if requested - if check_option "buildflags" "n"; then - unset CPPFLAGS CFLAGS DEBUG_CFLAGS CXXFLAGS DEBUG_CXXFLAGS LDFLAGS - fi - - if check_option "debug" "y"; then - DEBUG_CFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}" - DEBUG_CXXFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}" - CFLAGS+=" $DEBUG_CFLAGS" - CXXFLAGS+=" $DEBUG_CXXFLAGS" - fi - - # clear user-specified makeflags if requested - if check_option "makeflags" "n"; then - unset MAKEFLAGS - fi - - # ensure all necessary build variables are exported - export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS MAKEFLAGS CHOST - - local ccache=0 - - # use ccache if it is requested (check buildenv and PKGBUILD opts) - if check_buildoption "ccache" "y" && [[ -d /usr/lib/ccache/bin ]]; then - export PATH="/usr/lib/ccache/bin:$PATH" - ccache=1 - fi - - # use distcc if it is requested (check buildenv and PKGBUILD opts) - if check_buildoption "distcc" "y"; then - if (( ccache )); then - export CCACHE_PREFIX="${CCACHE_PREFIX:+$CCACHE_PREFIX }distcc" - export CCACHE_BASEDIR="$srcdir" - elif [[ -d /usr/lib/distcc/bin ]]; then - export PATH="/usr/lib/distcc/bin:$PATH" - fi - export DISTCC_HOSTS - fi -} - run_function_safe() { local restoretrap restoreshopt -- cgit v1.2.3-54-g00ecf