IOS compilation FreeType2 memo

Source: Internet
Author: User
Document directory
  • Download the source
  • Compiling the library
  • Bringing it all together as a universal library
If you want to download the tar format, the zip press enter is incorrect. confg may be faulty. The following is a record of the library has build deployments for most platforms, but unfortunately not IOS. this document describes how to build libfreetype. A as a universal binary for iOS and the MAC (i386, x86_64, ARM7 ). Download the sourcedownload the latest FreeType sourcecode from
SourceForge. Open a terminal and extract the archive. Compiling the librarywe have to compile the library four times, once for each architecture. i386
$ ./configure CFLAGS="-arch i386"$ make
This forces configure to use the i386 architecture and build the library. the built library is located at objs /. libs/libfreetype. a. we copy this to our top level folder and build the next architecture.
$ cp objs/.libs/libfreetype.a libfreetype-i386.a
X86_64similar build setup for x86_64, notice the addition of make clean, we want to completely remove the i386 code.
$ ./configure CFLAGS="-arch x86_64";make clean;make$ cp objs/.libs/libfreetype.a libfreetype-x86_64.a
Arm77.is used on iPhone 3gs and newer. there are quite a few arguments that need to be passed to configure to make it build for arm7. I'm going under the assumption that you're targeting IOS 5.1 using gcc-4.2 as your compiler. if this is not what you want,
Please update the arguments below accordingly.
$ ./configure --prefix=/usr/local/iphone --host=arm-apple-darwin --enable-static=yes --enable-shared=no CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc  CFLAGS="-arch armv7 -pipe -mdynamic-no-pic -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=5.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/include/libxml2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk" CPP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-cpp-4.2 AR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar LDFLAGS="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -miphoneos-version-min=5.1"$ make clean;make$ cp objs/.libs/libfreetype.a libfreetype-arm7.a
Bringing it all together as a universal librarywe now have 4 individual libraries. to combine them into a single universal library use the lipo tool.
$ lipo -create -output libfreetype.a libfreetype-i386.a libfreetype-x86_64.a libfreetype-arm7.a
And thats it. You can check which ubuntures are in a library with the-Info argument.
$ lipo -info libfreetype.a
Ubuntures In the FAT file: libfreetype. A are: armv7 i386 x86_64refer to
Original text.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.