SHARE
TWEET

Freetype build script for iOS

SBKarr Aug 27th, 2014 301 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. LIBS_FLAGS="--with-bzip2=no --with-zlib=yes --with-png=yes --enable-static=yes --enable-shared=no"
  4. CC_PATH="CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc"
  5. AR_PATH="AR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar"
  6. RANLIB_PATH="RANLIB=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib"
  7. CPP_PATH="CPP=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cpp"
  8.  
  9. SDK_INCLUDE_SIM="-I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/include"
  10. SDK_INCLUDE_OS="-I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/include"
  11.  
  12. SYSROOT_SIM="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk"
  13. SYSROOT_OS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk"
  14.  
  15. if [ "$1" == "i386" ] || [ "$1" == "all" ]; then
  16.         CFLAGS_EXT="-arch i386 -Wno-extended-offsetof -miphoneos-version-min=4.2"
  17.         LDFLAGS_EXT="-arch i386 -miphoneos-version-min=4.2"
  18.  
  19.         rm libfreetype-i386.a
  20.         make clean
  21.  
  22.         ./configure $LIBS_FLAGS $CC_PATH CFLAGS="$CFLAGS_EXT $SDK_INCLUDE_SIM $SYSROOT_SIM" $CPP_PATH $AR_PATH $RANLIB_PATH LDFLAGS="$LDFLAGS_EXT $SYSROOT_SIM"
  23.  
  24.         make
  25.         cp objs/.libs/libfreetype.a libfreetype-i386.a
  26. fi
  27.  
  28. if [ "$1" == "x86_64" ] || [ "$1" == "all" ]; then
  29.         CFLAGS_EXT="-arch x86_64 -Wno-extended-offsetof -miphoneos-version-min=4.2"
  30.         LDFLAGS_EXT="-arch x86_64 -miphoneos-version-min=4.2"
  31.  
  32.         rm libfreetype-x86_64.a
  33.         make clean
  34.  
  35.         ./configure $LIBS_FLAGS $CC_PATH CFLAGS="$CFLAGS_EXT $SDK_INCLUDE_SIM $SYSROOT_SIM" $CPP_PATH $AR_PATH $RANLIB_PATH LDFLAGS="$LDFLAGS_EXT $SYSROOT_SIM"
  36.  
  37.         make
  38.         cp objs/.libs/libfreetype.a libfreetype-x86_64.a
  39. fi
  40.  
  41. if [ "$1" == "arm7" ] || [ "$1" == "all" ]; then
  42.         CFLAGS_EXT="-arch armv7 -pipe -std=c99 -Wno-extended-offsetof -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=4.2"
  43.         LDFLAGS_EXT="-arch armv7 -miphoneos-version-min=4.2"
  44.  
  45.         rm libfreetype-arm7.a
  46.         make clean
  47.  
  48.         ./configure --host=arm-apple-darwin $LIBS_FLAGS $CC_PATH CFLAGS="$CFLAGS_EXT $SDK_INCLUDE_OS $SYSROOT_OS" $AR_PATH $RANLIB_PATH LDFLAGS="$LDFLAGS_EXT $SYSROOT_OS"
  49.  
  50.         make
  51.         cp objs/.libs/libfreetype.a libfreetype-arm7.a
  52. fi
  53.  
  54. if [ "$1" == "arm7s" ] || [ "$1" == "all" ]; then
  55.         CFLAGS_EXT="-arch armv7s -pipe -std=c99 -Wno-extended-offsetof -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=5.0"
  56.         LDFLAGS_EXT="-arch armv7s -miphoneos-version-min=5.0"
  57.  
  58.         rm libfreetype-arm7s.a
  59.         make clean
  60.  
  61.         ./configure --host=arm-apple-darwin $LIBS_FLAGS $CC_PATH CFLAGS="$CFLAGS_EXT $SDK_INCLUDE_OS $SYSROOT_OS" $AR_PATH $RANLIB_PATH LDFLAGS="$LDFLAGS_EXT $SYSROOT_OS"
  62.  
  63.         make
  64.         cp objs/.libs/libfreetype.a libfreetype-arm7s.a
  65. fi
  66.  
  67. if [ "$1" == "arm64" ] || [ "$1" == "all" ]; then
  68.         CFLAGS_EXT="-arch arm64 -pipe -std=c99 -Wno-extended-offsetof -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=6.0"
  69.         LDFLAGS_EXT="-arch arm64 -miphoneos-version-min=6.0"
  70.  
  71.         rm libfreetype-arm64.a
  72.         make clean
  73.  
  74.         ./configure --host=arm-apple-darwin $LIBS_FLAGS $CC_PATH CFLAGS="$CFLAGS_EXT $SDK_INCLUDE_OS $SYSROOT_OS" $AR_PATH $RANLIB_PATH LDFLAGS="$LDFLAGS_EXT $SYSROOT_OS"
  75.  
  76.         make
  77.         cp objs/.libs/libfreetype.a libfreetype-arm64.a
  78. fi
  79.  
  80. if [ "$1" == "universal" ] || [ "$1" == "all" ]; then
  81.         rm libfreetype.a
  82.         lipo -create -output libfreetype.a libfreetype-i386.a libfreetype-x86_64.a libfreetype-arm7.a libfreetype-arm7s.a libfreetype-arm64.a
  83. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top