mirror of
https://github.com/chocolate-doom/chocpkg.git
synced 2024-11-10 07:11:39 +00:00
Add variable for doing out-of-tree builds.
Normally we run ./configure from within the build tree, but autotools now allows doing out-of-tree builds by running configure while cd'ed to a different directory. Add a config variable `AUTOTOOLS_BUILD_PATH` to allow this on a per-package basis, and set this for the SDL2 package; SDL2 hg complains when doing in-tree builds because certain files get clobbered.
This commit is contained in:
parent
24650af7d9
commit
e68dca04e0
2 changed files with 14 additions and 1 deletions
|
@ -34,7 +34,13 @@ do_build() {
|
||||||
autoreconf -fi
|
autoreconf -fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./configure --prefix="$PACKAGE_INSTALL_DIR" $host_opt \
|
local configure_path="$PWD/configure"
|
||||||
|
if [ ! -z "${AUTOTOOLS_BUILD_PATH:-}" ]; then
|
||||||
|
mkdir -p "$AUTOTOOLS_BUILD_PATH"
|
||||||
|
cd "$AUTOTOOLS_BUILD_PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$configure_path" --prefix="$PACKAGE_INSTALL_DIR" $host_opt \
|
||||||
$PACKAGE_CONFIGURE_OPTS || (
|
$PACKAGE_CONFIGURE_OPTS || (
|
||||||
error_exit "Failed to configure package $PACKAGE_NAME for build."
|
error_exit "Failed to configure package $PACKAGE_NAME for build."
|
||||||
)
|
)
|
||||||
|
@ -47,6 +53,10 @@ do_build() {
|
||||||
# Function encapsulating the "make install" step which should work for
|
# Function encapsulating the "make install" step which should work for
|
||||||
# most autotools-based packages, but can be overridden by packages.
|
# most autotools-based packages, but can be overridden by packages.
|
||||||
do_install() {
|
do_install() {
|
||||||
|
if [ ! -z "${AUTOTOOLS_BUILD_PATH:-}" ]; then
|
||||||
|
cd "$AUTOTOOLS_BUILD_PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
make install || (
|
make install || (
|
||||||
error_exit "Failed to install package $PACKAGE_NAME."
|
error_exit "Failed to install package $PACKAGE_NAME."
|
||||||
)
|
)
|
||||||
|
|
|
@ -20,4 +20,7 @@ if [ $(uname) = "Cygwin" ] || [[ "$BUILD_HOST" = *mingw* ]]; then
|
||||||
config_options+=" --disable-directx"
|
config_options+=" --disable-directx"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# For SDL, we do an out-of-tree build in a subdirectory, since the configure
|
||||||
|
# script can complain otherwise.
|
||||||
|
AUTOTOOLS_BUILD_PATH=build-artifacts
|
||||||
build_autotools $config_options
|
build_autotools $config_options
|
||||||
|
|
Loading…
Reference in a new issue