Skip to content

Instantly share code, notes, and snippets.

@sparfenyuk
Created March 29, 2017 12:16
Show Gist options
  • Select an option

  • Save sparfenyuk/8bc00fa729ef1c3f401be3e08c221f80 to your computer and use it in GitHub Desktop.

Select an option

Save sparfenyuk/8bc00fa729ef1c3f401be3e08c221f80 to your computer and use it in GitHub Desktop.
Configuring make of 'gettext' sources for iOS target
#! /bin/bash
export MINVER="8.0" # the minimum supported OS version
export SDKVER="10.2" # SDK version
export PREFIX="$HOME/built-for-ios" # where the library goes
export DEVROOT="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain"
export SDKROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVER}.sdk"
export PKG_CONFIG_LIBDIR="${PREFIX}/lib/pkgconfig:${SDKROOT}/usr/lib/pkgconfig"
export COMMON_FLAGS="-arch arm64 -isysroot ${SDKROOT}"
export CPPFLAGS="-I${PREFIX}/include ${COMMON_FLAGS} -miphoneos-version-min=${MINVER}"
export CFLAGS="${CPPFLAGS}"
export LDFLAGS="-L${PREFIX}/lib ${COMMON_FLAGS} -Wl,-iphoneos_version_min,${MINVER}"
export CC="${DEVROOT}/usr/bin/clang"
export CXX="${DEVROOT}/usr/bin/clang++"
export OBJC="${CC}"
export LD="${CC}"
[ ! -d "${PREFIX}" ] && mkdir -p "${PREFIX}"
./configure --prefix="${PREFIX}" \
--build="x86_64-apple-darwin" \
--host="arm-apple-darwin" \
--enable-static \
--disable-shared \
glib_cv_stack_grows=no \
glib_cv_uscore=no \
ac_cv_func_posix_getgrgid_r=yes \
ac_cv_func_posix_getpwuid_r=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment