iOS build cleanup (use platform=ios ./libretro-build.sh now)

This commit is contained in:
T. Joseph Carter 2015-02-19 10:14:22 -08:00
parent 0a107f8ea6
commit 0fdedeb663
3 changed files with 146 additions and 117 deletions

View File

@ -16,5 +16,5 @@ fi
# The iOS build rules have all been moved to libretro-build.sh
FORMAT_COMPILER_TARGET=ios
platform=ios
${BASE_DIR}/libretro-build.sh $@

View File

@ -14,20 +14,7 @@ else
fi
fi
if [ "$FORMAT_COMPILER_TARGET" != "ios" ]; then
. ${BASE_DIR}/libretro-config.sh
else
# FIXME: libretro-config.sh should eventually do this stuff for iOS
DIST_DIR="ios"
FORMAT_EXT=dylib
IOS=1
FORMAT=_ios
FORMAT_COMPILER_TARGET=ios
export IOSSDK=$(xcrun -sdk iphoneos -show-sdk-path)
IOSVER_MAJOR=$(xcrun -sdk iphoneos -show-sdk-platform-version | cut -c '1')
IOSVER_MINOR=$(xcrun -sdk iphoneos -show-sdk-platform-version | cut -c '3')
IOSVER=${IOSVER_MAJOR}${IOSVER_MINOR}
fi
. ${BASE_DIR}/libretro-config.sh
if [ -z "$RARCH_DIST_DIR" ]; then
RARCH_DIR="$WORKDIR/dist"
@ -58,9 +45,7 @@ if [ -z "$MAKE" ]; then
fi
if [ -z "$CC" ]; then
if [ "$FORMAT_COMPILER_TARGET" = "ios" ]; then
CC="clang -arch armv7 -miphoneos-version-min=5.0 -isysroot $IOSSDK"
elif [ $FORMAT_COMPILER_TARGET = "osx" ]; then
if [ $FORMAT_COMPILER_TARGET = "osx" ]; then
CC=cc
elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then
CC=mingw32-gcc
@ -70,10 +55,7 @@ if [ -z "$CC" ]; then
fi
if [ -z "$CXX" ]; then
if [ "$FORMAT_COMPILER_TARGET" = "ios" ]; then
CXX="clang++ -arch armv7 -miphoneos-version-min=5.0 -isysroot $IOSSDK"
CXX11="clang++ -std=c++11 -stdlib=libc++ -arch armv7 -miphoneos-version-min=5.0 -isysroot $IOSSDK"
elif [ $FORMAT_COMPILER_TARGET = "osx" ]; then
if [ $FORMAT_COMPILER_TARGET = "osx" ]; then
CXX=c++
CXX11="clang++ -std=c++11 -stdlib=libc++"
# FIXME: Do this right later.

View File

@ -1,7 +1,51 @@
# vim: set ts=3 sw=3 noet ft=sh : bash
# Architecture Assignment
config_cpu() {
# The platform variable is normally not set at the time libretro-config is
# included by libretro-build.sh. Other platform scripts may begin to include
# libretro-config as well if they define their platform-specific code in the
# case block below. This is a band-aid fix that we will address after 1.1 is
# released.
case "$platform" in
##
## Configs that did not use libretro-config originally
## TODO: Integrate this with everything else (post-1.1)
##
ios)
# NOTE: This config requires a Mac with an Xcode version new enough for
# its xcrun program to support -show-sdk-path. That pretty much
# limits us to Xcode 5 and above unless someone wants to implement
# older Xcode version support using an alternate method. Any such
# support could only be for jailbreakers as any libretro core that
# could ever be added to the App Store would require a recent SDK
# and Xcode version to build.
DIST_DIR="ios"
FORMAT_EXT=dylib
IOS=1
FORMAT=_ios
FORMAT_COMPILER_TARGET=ios
FORMAT_COMPILER_TARGET_ALT=ios
export IOSSDK=$(xcrun -sdk iphoneos -show-sdk-path)
IOSVER_MAJOR=$(xcrun -sdk iphoneos -show-sdk-platform-version | cut -c '1')
IOSVER_MINOR=$(xcrun -sdk iphoneos -show-sdk-platform-version | cut -c '3')
IOSVER=${IOSVER_MAJOR}${IOSVER_MINOR}
# Apple requires this stuff
CC="clang -arch armv7 -miphoneos-version-min=5.0 -isysroot $IOSSDK"
CXX="clang++ -arch armv7 -miphoneos-version-min=5.0 -isysroot $IOSSDK"
CXX11="clang++ -std=c++11 -stdlib=libc++ -arch armv7 -miphoneos-version-min=5.0 -isysroot $IOSSDK"
;;
##
## Original libretro-config path
##
*)
# Architecture Assignment
config_cpu() {
[ -n "$2" ] && ARCH="$1"
[ -z "$ARCH" ] && ARCH="$(uname -m)"
case "$ARCH" in
@ -27,10 +71,10 @@ config_cpu() {
ARCH=x86_64
X86=true && X86_64=true
fi
}
}
# Platform Assignment
config_platform() {
# Platform Assignment
config_platform() {
[ -n "$1" ] && platform="$1"
[ -z "$platform" ] && platform="$(uname)"
case "$platform" in
@ -81,25 +125,28 @@ config_platform() {
;;
esac
export FORMAT_COMPILER_TARGET_ALT="$FORMAT_COMPILER_TARGET"
}
}
config_log_build_host() {
config_log_build_host() {
echo "PLATFORM: $platform"
echo "ARCHITECTURE: $ARCH"
echo "TARGET: $FORMAT_COMPILER_TARGET"
}
}
config_cpu
config_platform
config_log_build_host
config_cpu
config_platform
config_log_build_host
if [ -z "$JOBS" ]; then
if [ -z "$JOBS" ]; then
if command -v nproc >/dev/null; then
JOBS="$(nproc)"
else
JOBS=1
fi
fi
fi
;;
esac
#if uncommented, will build experimental cores as well which are not yet fit for release.
#export BUILD_EXPERIMENTAL=1