Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/libraries/osx/build-osx-libs.sh
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
NVTT_VERSION="nvtt-2.1.1+wildfiregames.1" | NVTT_VERSION="nvtt-2.1.1+wildfiregames.1" | ||||
FCOLLADA_VERSION="fcollada-3.05+wildfiregames.1" | FCOLLADA_VERSION="fcollada-3.05+wildfiregames.1" | ||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Provided by OS X: | # Provided by OS X: | ||||
# * OpenAL | # * OpenAL | ||||
# * OpenGL | # * OpenGL | ||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Force build architecture, as sometimes environment is broken. | |||||
# For a universal fat binary, the approach would be to build every | |||||
# dependency with both archs and combine them with lipo, then do the | |||||
# same thing with the game itself. | |||||
# Choices are "x86_64" or "i386" (ppc and ppc64 not supported) | |||||
ARCH=${ARCH:="x86_64"} | |||||
# Define compiler as "clang", this is all Mavericks supports. | # Define compiler as "clang", this is all Mavericks supports. | ||||
# gcc symlinks may still exist, but they are simply clang with | # gcc symlinks may still exist, but they are simply clang with | ||||
# slightly different config, which confuses build scripts. | # slightly different config, which confuses build scripts. | ||||
# llvm-gcc and gcc 4.2 are no longer supported by SpiderMonkey. | # llvm-gcc and gcc 4.2 are no longer supported by SpiderMonkey. | ||||
export CC=${CC:="clang"} CXX=${CXX:="clang++"} | export CC=${CC:="clang"} CXX=${CXX:="clang++"} | ||||
export MIN_OSX_VERSION=${MIN_OSX_VERSION:="10.9"} | export MIN_OSX_VERSION=${MIN_OSX_VERSION:="10.9"} | ||||
# The various libs offer inconsistent configure options, some allow | # The various libs offer inconsistent configure options, some allow | ||||
Show All 10 Lines | |||||
fi | fi | ||||
# Check if MIN_OSX_VERSION is set and not empty | # Check if MIN_OSX_VERSION is set and not empty | ||||
if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then | if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then | ||||
C_FLAGS="$C_FLAGS -mmacosx-version-min=$MIN_OSX_VERSION" | C_FLAGS="$C_FLAGS -mmacosx-version-min=$MIN_OSX_VERSION" | ||||
# clang and llvm-gcc look at mmacosx-version-min to determine link target | # clang and llvm-gcc look at mmacosx-version-min to determine link target | ||||
# and CRT version, and use it to set the macosx_version_min linker flag | # and CRT version, and use it to set the macosx_version_min linker flag | ||||
LDFLAGS="$LDFLAGS -mmacosx-version-min=$MIN_OSX_VERSION" | LDFLAGS="$LDFLAGS -mmacosx-version-min=$MIN_OSX_VERSION" | ||||
fi | fi | ||||
# Force using libc++ since it has better C++11 support required by the game | |||||
# but pre-Mavericks still use libstdc++ by default | |||||
# Also enable c++0x for consistency with the game build | |||||
C_FLAGS="$C_FLAGS -arch $ARCH -fvisibility=hidden" | |||||
LDFLAGS="$LDFLAGS -arch $ARCH -stdlib=libc++" | |||||
CFLAGS="$CFLAGS $C_FLAGS" | CFLAGS="$CFLAGS $C_FLAGS -fvisibility=hidden" | ||||
CXXFLAGS="$CXXFLAGS $C_FLAGS -stdlib=libc++ -std=c++0x" | CXXFLAGS="$CXXFLAGS $C_FLAGS -stdlib=libc++ -std=c++14 -msse3" | ||||
OBJCFLAGS="$OBJCFLAGS $C_FLAGS" | OBJCFLAGS="$OBJCFLAGS $C_FLAGS" | ||||
OBJCXXFLAGS="$OBJCXXFLAGS $C_FLAGS" | OBJCXXFLAGS="$OBJCXXFLAGS $C_FLAGS" | ||||
LDFLAGS="$LDFLAGS -stdlib=libc++" | |||||
JOBS=${JOBS:="-j2"} | JOBS=${JOBS:="-j2"} | ||||
set -e | set -e | ||||
die() | die() | ||||
{ | { | ||||
echo ERROR: $* | echo ERROR: $* | ||||
exit 1 | exit 1 | ||||
▲ Show 20 Lines • Show All 310 Lines • ▼ Show 20 Lines | then | ||||
tar -xf $LIB_ARCHIVE | tar -xf $LIB_ARCHIVE | ||||
pushd $LIB_DIRECTORY | pushd $LIB_DIRECTORY | ||||
mkdir -p build-release | mkdir -p build-release | ||||
pushd build-release | pushd build-release | ||||
CONF_OPTS="--prefix=$INSTALL_DIR | CONF_OPTS="--prefix=$INSTALL_DIR | ||||
--disable-shared | --disable-shared | ||||
--enable-macosx_arch=$ARCH | |||||
--enable-unicode | --enable-unicode | ||||
--with-cocoa | --with-cocoa | ||||
--with-opengl | --with-opengl | ||||
--with-libiconv-prefix=${ICONV_DIR} | --with-libiconv-prefix=${ICONV_DIR} | ||||
--with-expat=builtin | --with-expat=builtin | ||||
--with-libpng=builtin | --with-libpng=builtin | ||||
--without-libtiff | --without-libtiff | ||||
--without-sdl | --without-sdl | ||||
▲ Show 20 Lines • Show All 554 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator