Skip to content

Instantly share code, notes, and snippets.

@neoighodaro
Forked from mpociot/compile-php-for-ios.sh
Created May 20, 2020 09:28
Show Gist options
  • Save neoighodaro/a459ddd92ca3fbcd495ba1aa1a8f734d to your computer and use it in GitHub Desktop.
Save neoighodaro/a459ddd92ca3fbcd495ba1aa1a8f734d 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