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 # The iOS build rules have all been moved to libretro-build.sh
FORMAT_COMPILER_TARGET=ios platform=ios
${BASE_DIR}/libretro-build.sh $@ ${BASE_DIR}/libretro-build.sh $@

View File

@ -14,20 +14,7 @@ else
fi fi
fi fi
if [ "$FORMAT_COMPILER_TARGET" != "ios" ]; then . ${BASE_DIR}/libretro-config.sh
. ${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
if [ -z "$RARCH_DIST_DIR" ]; then if [ -z "$RARCH_DIST_DIR" ]; then
RARCH_DIR="$WORKDIR/dist" RARCH_DIR="$WORKDIR/dist"
@ -58,9 +45,7 @@ if [ -z "$MAKE" ]; then
fi fi
if [ -z "$CC" ]; then if [ -z "$CC" ]; then
if [ "$FORMAT_COMPILER_TARGET" = "ios" ]; then if [ $FORMAT_COMPILER_TARGET = "osx" ]; then
CC="clang -arch armv7 -miphoneos-version-min=5.0 -isysroot $IOSSDK"
elif [ $FORMAT_COMPILER_TARGET = "osx" ]; then
CC=cc CC=cc
elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then
CC=mingw32-gcc CC=mingw32-gcc
@ -70,10 +55,7 @@ if [ -z "$CC" ]; then
fi fi
if [ -z "$CXX" ]; then if [ -z "$CXX" ]; then
if [ "$FORMAT_COMPILER_TARGET" = "ios" ]; then if [ $FORMAT_COMPILER_TARGET = "osx" ]; 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
CXX=c++ CXX=c++
CXX11="clang++ -std=c++11 -stdlib=libc++" CXX11="clang++ -std=c++11 -stdlib=libc++"
# FIXME: Do this right later. # FIXME: Do this right later.

View File

@ -1,105 +1,152 @@
# vim: set ts=3 sw=3 noet ft=sh : bash # vim: set ts=3 sw=3 noet ft=sh : bash
# Architecture Assignment # The platform variable is normally not set at the time libretro-config is
config_cpu() { # included by libretro-build.sh. Other platform scripts may begin to include
[ -n "$2" ] && ARCH="$1" # libretro-config as well if they define their platform-specific code in the
[ -z "$ARCH" ] && ARCH="$(uname -m)" # case block below. This is a band-aid fix that we will address after 1.1 is
case "$ARCH" in # released.
x86_64)
X86=true case "$platform" in
X86_64=true ##
;; ## Configs that did not use libretro-config originally
i386|i686) ## TODO: Integrate this with everything else (post-1.1)
X86=true ##
;;
armv*) ios)
ARM=true # NOTE: This config requires a Mac with an Xcode version new enough for
export FORMAT_COMPILER_TARGET=armv # its xcrun program to support -show-sdk-path. That pretty much
export RARCHCFLAGS="$RARCHCFLAGS -marm" # limits us to Xcode 5 and above unless someone wants to implement
case "${ARCH}" in # older Xcode version support using an alternate method. Any such
armv5tel) ARMV5=true ;; # support could only be for jailbreakers as any libretro core that
armv6l) ARMV6=true ;; # could ever be added to the App Store would require a recent SDK
armv7l) ARMV7=true ;; # 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
x86_64)
X86=true
X86_64=true
;;
i386|i686)
X86=true
;;
armv*)
ARM=true
export FORMAT_COMPILER_TARGET=armv
export RARCHCFLAGS="$RARCHCFLAGS -marm"
case "${ARCH}" in
armv5tel) ARMV5=true ;;
armv6l) ARMV6=true ;;
armv7l) ARMV7=true ;;
esac
;;
esac esac
;; if [ -n "$PROCESSOR_ARCHITEW6432" -a "$PROCESSOR_ARCHITEW6432" = "AMD64" ]; then
esac ARCH=x86_64
if [ -n "$PROCESSOR_ARCHITEW6432" -a "$PROCESSOR_ARCHITEW6432" = "AMD64" ]; then X86=true && X86_64=true
ARCH=x86_64 fi
X86=true && X86_64=true }
fi
}
# Platform Assignment # Platform Assignment
config_platform() { config_platform() {
[ -n "$1" ] && platform="$1" [ -n "$1" ] && platform="$1"
[ -z "$platform" ] && platform="$(uname)" [ -z "$platform" ] && platform="$(uname)"
case "$platform" in case "$platform" in
*BSD*) *BSD*)
FORMAT_EXT="so" FORMAT_EXT="so"
FORMAT_COMPILER_TARGET="unix" FORMAT_COMPILER_TARGET="unix"
DIST_DIR="bsd" DIST_DIR="bsd"
;; ;;
osx|*Darwin*) osx|*Darwin*)
FORMAT_EXT="dylib" FORMAT_EXT="dylib"
FORMAT_COMPILER_TARGET="osx" FORMAT_COMPILER_TARGET="osx"
DIST_DIR="osx" DIST_DIR="osx"
;; ;;
win|*mingw32*|*MINGW32*|*MSYS_NT*) win|*mingw32*|*MINGW32*|*MSYS_NT*)
FORMAT_EXT="dll" FORMAT_EXT="dll"
FORMAT_COMPILER_TARGET="win" FORMAT_COMPILER_TARGET="win"
DIST_DIR="win_x86" DIST_DIR="win_x86"
;; ;;
win64|*mingw64*|*MINGW64*) win64|*mingw64*|*MINGW64*)
FORMAT_EXT="dll" FORMAT_EXT="dll"
FORMAT_COMPILER_TARGET="win" FORMAT_COMPILER_TARGET="win"
DIST_DIR="win_x64" DIST_DIR="win_x64"
;; ;;
*psp1*) *psp1*)
FORMAT_EXT="a" FORMAT_EXT="a"
FORMAT_COMPILER_TARGET="psp1" FORMAT_COMPILER_TARGET="psp1"
DIST_DIR="psp1" DIST_DIR="psp1"
;; ;;
*ios|theos_ios*) *ios|theos_ios*)
FORMAT_EXT="dylib" FORMAT_EXT="dylib"
FORMAT_COMPILER_TARGET="theos_ios" FORMAT_COMPILER_TARGET="theos_ios"
DIST_DIR="theos" DIST_DIR="theos"
;; ;;
android) android)
FORMAT_EXT="so" FORMAT_EXT="so"
FORMAT_COMPILER_TARGET="android" FORMAT_COMPILER_TARGET="android"
DIST_DIR="android" DIST_DIR="android"
;; ;;
*android-armv7*) *android-armv7*)
FORMAT_EXT="so" FORMAT_EXT="so"
FORMAT_COMPILER_TARGET="android-armv7" FORMAT_COMPILER_TARGET="android-armv7"
DIST_DIR="android/armeabi-v7a" DIST_DIR="android/armeabi-v7a"
;; ;;
*) *)
FORMAT_EXT="so" FORMAT_EXT="so"
FORMAT_COMPILER_TARGET="unix" FORMAT_COMPILER_TARGET="unix"
DIST_DIR="unix" DIST_DIR="unix"
;; ;;
esac esac
export FORMAT_COMPILER_TARGET_ALT="$FORMAT_COMPILER_TARGET" export FORMAT_COMPILER_TARGET_ALT="$FORMAT_COMPILER_TARGET"
} }
config_log_build_host() { config_log_build_host() {
echo "PLATFORM: $platform" echo "PLATFORM: $platform"
echo "ARCHITECTURE: $ARCH" echo "ARCHITECTURE: $ARCH"
echo "TARGET: $FORMAT_COMPILER_TARGET" echo "TARGET: $FORMAT_COMPILER_TARGET"
} }
config_cpu config_cpu
config_platform config_platform
config_log_build_host config_log_build_host
if [ -z "$JOBS" ]; then
if command -v nproc >/dev/null; then
JOBS="$(nproc)"
else
JOBS=1
fi
fi
;;
esac
if [ -z "$JOBS" ]; then
if command -v nproc >/dev/null; then
JOBS="$(nproc)"
else
JOBS=1
fi
fi
#if uncommented, will build experimental cores as well which are not yet fit for release. #if uncommented, will build experimental cores as well which are not yet fit for release.
#export BUILD_EXPERIMENTAL=1 #export BUILD_EXPERIMENTAL=1