Skip to content

Instantly share code, notes, and snippets.

@mpociot
Created December 2, 2019 19:56
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mpociot/2bac951d4fd4078837603b37430aea79 to your computer and use it in GitHub Desktop.
Save mpociot/2bac951d4fd4078837603b37430aea79 to your computer and use it in GitHub Desktop.
#!/bin/bash
PLATFORM=iPhoneOS # iPhoneSimulator # iPhoneOS
HOST=arm-apple-darwin # i386-apple-darwin10 # arm-apple-darwin10
ARCH=arm64 # i386 # armv7s #armv7
SDK_VERSION=13.0
XCODE_ROOT=`xcode-select -print-path`
PLATFORM_PATH=$XCODE_ROOT/Platforms/$PLATFORM.platform/Developer
SDK_PATH=$PLATFORM_PATH/SDKs/$PLATFORM$SDK_VERSION.sdk
FLAGS="-isysroot $SDK_PATH -arch $ARCH -miphoneos-version-min=$SDK_VERSION"
PLATFORM_BIN_PATH=$XCODE_ROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin
CC=$PLATFORM_BIN_PATH/clang
CXX=$PLATFORM_BIN_PATH/clang++
CFLAGS="$FLAGS -std=gnu99"
CXXFLAGS="$FLAGS -std=gnu++11 -stdlib=libc++"
LDFLAGS=$FLAGS
export CC CXX CFLAGS CXXFLAGS LDFLAGS
CONFIGURE_FLAGS="--host=$HOST --enable-embed=static --disable-phpdbg --enable-static --without-pear --disable-opcache --without-iconv --disable-cgi --disable-shared --disable-cli --enable-mysqlnd --with-pdo-mysql --with-mysqli --with-tsrm-pthreads"
./configure $CONFIGURE_FLAGS
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment