Skip to content

Instantly share code, notes, and snippets.

@TheNoim
Created June 9, 2017 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheNoim/34d24357e1f79a061afb8048e2505336 to your computer and use it in GitHub Desktop.
Save TheNoim/34d24357e1f79a061afb8048e2505336 to your computer and use it in GitHub Desktop.
unset CPATH
unset C_INCLUDE_PATH
unset CPLUS_INCLUDE_PATH
unset OBJC_INCLUDE_PATH
unset LIBS
unset DYLD_FALLBACK_LIBRARY_PATH
unset DYLD_FALLBACK_FRAMEWORK_PATH
export SDKVER="11.o"
#export DEVROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer"
#export SDKROOT="$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk"
export SDKROOT="$(xcrun -sdk iphoneos --show-sdk-path)"
export DEVROOT="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain"
if [ ! \( -d "$DEVROOT" \) ] ; then
echo "The iPhone SDK could not be found. Folder \"$DEVROOT\" does not exist."
exit 1
fi
if [ ! \( -d "$SDKROOT" \) ] ; then
echo "The iPhone SDK could not be found. Folder \"$SDKROOT\" does not exist."
exit 1
fi
if [ ! \( -x "./configure" \) ] ; then
echo "This script must be run in the folder containing the \"configure\" script."
exit 1
fi
#export PKG_CONFIG_PATH="$SDKROOT/usr/lib/pkgconfig":"/opt/iphone-$SDKVER/lib/pkgconfig":"/usr/local/iphone-$SDKVER/lib/pkgconfig"
#export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH"
export PREFIX="/opt/iphone-$SDKVER"
export AS="$(xcrun -sdk iphoneos -find as)"
export ASCPP="$(xcrun -sdk iphoneos -find as)"
export AR="$(xcrun -sdk iphoneos -find ar)"
export RANLIB="$(xcrun -sdk iphoneos -find ranlib)"
export CPPFLAGS="-miphoneos-version-min=10.1 -std=c99 -pipe -no-cpp-precomp -I$SDKROOT/usr/include -I/opt/iphone-$SDKVER/include -I/usr/local/iphone-$SDKVER/include"
export CFLAGS="-miphoneos-version-min=10.1 -std=c99 -pipe -no-cpp-precomp --sysroot='$SDKROOT' -isystem $SDKROOT/usr/include -isystem /opt/iphone-$SDKVER/include -isystem /usr/local/iphone-$SDKVER/include"
export CXXFLAGS="-miphoneos-version-min=10.1 -std=c99 -pipe -no-cpp-precomp --sysroot='$SDKROOT' -isystem $SDKROOT/usr/include -isystem /opt/iphone-$SDKVER/include -isystem /usr/local/iphone-$SDKVER/include"
export LDFLAGS="-miphoneos-version-min=10.1 -I$SDKROOT/usr/include -I/opt/iphone-$SDKVER/include -I/usr/local/iphone-$SDKVER/include -L$SDKROOT/usr/lib -L/opt/iphone-$SDKVER/lib -L/usr/local/iphone-$SDKVER/lib"
export CPP="$(xcrun -sdk iphoneos -find cpp) -E"
export CXXCPP="$(xcrun -sdk iphoneos -find cpp)"
export CC="$(xcrun -sdk iphoneos -find clang)"
export CXX="$(xcrun -sdk iphoneos -find c++)"
export LD="$(xcrun -sdk iphoneos -find ld)"
export STRIP="$(xcrun -sdk iphoneos -find strip)"
export GYP_DEFINES="target_arch=arm64"
export GYP_DEFINES+=" v8_target_arch=arm64"
export GYP_DEFINES+=" android_target_arch=arm64"
export GYP_DEFINES+=" host_os=macos OS=iPhoneOs"
export icu_path="/usr/local/Cellar/icu4c/58.2"
./configure \
--prefix="$PREFIX" \
--dest-os="iPhoneOs" \
--dest-cpu="arm64" \
--cross-compiling \
--without-snapshot \
--without-inspector \
--without-intl \
--without-dtrace \
--without-etw \
--without-perfctr \
--openssl-no-asm \
--shared
$@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment