mirror of
https://github.com/chocolate-doom/chocpkg.git
synced 2025-01-22 16:31:19 +00:00
Split out build environment setup to a separate file.
This commit is contained in:
parent
10f650eb58
commit
9162916169
3 changed files with 26 additions and 22 deletions
19
buildenv.sh
Normal file
19
buildenv.sh
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
|
||||||
|
# The compiler that will be used to build packages for the target system.
|
||||||
|
# Change this to cross-compile, etc.
|
||||||
|
CC=gcc
|
||||||
|
CXX=g++
|
||||||
|
export CC CXX
|
||||||
|
|
||||||
|
# On OS X, we must set additional options: build 32-bit binaries, and the
|
||||||
|
# target API version.
|
||||||
|
if [ $(uname) = "Darwin" ]; then
|
||||||
|
CC="gcc -m32"
|
||||||
|
CXX="g++ -m32"
|
||||||
|
LDFLAGS="-lobjc ${LDFLAGS:-}"
|
||||||
|
MACOSX_DEPLOYMENT_TARGET=10.7
|
||||||
|
export MACOSX_DEPLOYMENT_TARGET
|
||||||
|
else
|
||||||
|
LDFLAGS="-Wl,-rpath -Wl,$INSTALL_DIR/lib ${LDFLAGS:-}"
|
||||||
|
fi
|
||||||
|
|
|
@ -104,26 +104,15 @@ fetch_package() {
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_build_environment() {
|
setup_build_environment() {
|
||||||
CPPFLAGS="-I$INSTALL_DIR/include -I$INSTALL_DIR/include/SDL"
|
. "$CHOCPKG_ROOT/buildenv.sh"
|
||||||
LDFLAGS="-L$INSTALL_DIR/lib $LDFLAGS"
|
|
||||||
ACLOCAL_PATH="$INSTALL_DIR/share/aclocal:$ACLOCAL_PATH"
|
|
||||||
export CPPFLAGS LDFLAGS ACLOCAL_PATH
|
|
||||||
|
|
||||||
if [ $(uname) = "Darwin" ]; then
|
CPPFLAGS="-I$INSTALL_DIR/include"
|
||||||
CC="gcc -m32"
|
LDFLAGS="-L$INSTALL_DIR/lib ${LDFLAGS:-}"
|
||||||
CXX="g++ -m32"
|
ACLOCAL_PATH="$INSTALL_DIR/share/aclocal:${ACLOCAL_PATH:-}"
|
||||||
LDFLAGS="-lobjc $LDFLAGS"
|
export CPPFLAGS LDFLAGS ACLOCAL_PATH
|
||||||
MACOSX_DEPLOYMENT_TARGET=10.5
|
|
||||||
export CC CXX MACOSX_DEPLOYMENT_TARGET
|
|
||||||
else
|
|
||||||
LDFLAGS="-Wl,-rpath -Wl,$INSTALL_DIR/lib $LDFLAGS"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build_package() {
|
build_package() {
|
||||||
if [ "$PACKAGE_NAME" != "pkg-config" ]; then
|
|
||||||
chocpkg install pkg-config
|
|
||||||
fi
|
|
||||||
for dep in $DEPENDENCIES; do
|
for dep in $DEPENDENCIES; do
|
||||||
chocpkg install "$dep"
|
chocpkg install "$dep"
|
||||||
done
|
done
|
||||||
|
@ -134,6 +123,7 @@ build_package() {
|
||||||
echo =======================================================
|
echo =======================================================
|
||||||
echo
|
echo
|
||||||
cd "$PACKAGE_BUILD_DIR"
|
cd "$PACKAGE_BUILD_DIR"
|
||||||
|
setup_build_environment
|
||||||
|
|
||||||
if ! prebuild_setup; then
|
if ! prebuild_setup; then
|
||||||
error_exit "Failed pre-build setup step for $PACKAGE_NAME."
|
error_exit "Failed pre-build setup step for $PACKAGE_NAME."
|
||||||
|
|
|
@ -4,11 +4,6 @@ GIT_BRANCH=sdl2-branch
|
||||||
DEPENDENCIES="SDL2 SDL2_mixer SDL2_net"
|
DEPENDENCIES="SDL2 SDL2_mixer SDL2_net"
|
||||||
|
|
||||||
prebuild_setup() {
|
prebuild_setup() {
|
||||||
mkdir -p autotools
|
bash ./autogen.sh
|
||||||
aclocal -I "$INSTALL_DIR/share/aclocal"
|
|
||||||
autoheader
|
|
||||||
automake -a -c
|
|
||||||
autoconf
|
|
||||||
automake
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue