IOS Universal cross-compilation script

Source: Internet
Author: User


Well, normally on a PC, we're all

./configure

Make

Make install

A set of end-of-call. But how is it broken on iOS?

-0-is primarily a number of environments that require manual configuration ...

Some of the more common environments are written here.


Put this thing under the same path as the Configure. The execution of this script is OK.


Test Bson and lame libraries are OK


#!/bin/bash build_i386_ios_sim=1build_armv7_iphone=1build_armv7s_iphone=1build_target=lame IOS_MIN_SDK=6.1 (PWD= ' PWD ' prefix=${pwd}/${build_target}rm-rf ${prefix}/platformmkdir-p ${prefix}/platform EXTRA_MAKE_FLAGS= "-j4" Xcodedir= ' Xcode-select--print-path ' ios_sdk=$ (Xcodebuild-showsdks | grep iphoneos | sort | head-n 1 | awk ' {print $NF} ') sim_sdk=$ (Xcodebuild-showsdks | grep iphonesimulator | sort | head-n 1 | awk ' {print $NF} ') Iphoneos_platform=${xcodedir} /platforms/iphoneos.platformiphoneos_sysroot=${iphoneos_platform}/developer/sdks/${ios_sdk}.sdkiphonesimulator _platform=${xcodedir}/platforms/iphonesimulator.platformiphonesimulator_sysroot=${iphonesimulator_platform}/ developer/sdks/${sim_sdk}.sdkcc=clangcflags= "-dndebug-g-o0-pipe-fpic-fcxx-exceptions" CXX=clangCXXFLAGS= "${ CFLAGS}-std=c++11-stdlib=libc++ "ldflags="-stdlib=libc++ "libs="-lc++-lc++abi "if [$BUILD _armv7_iphone-eq 1] Thenecho "##################" echo "ARMv7 for IPhone" echo "##################" (CD ${pwd} mAke ${extra_make_flags} distclean./configure--build=x86_64-apple-darwin13.0.0--host=armv7-apple-darwin13.0.0-- Enable-static--disable-shared--prefix=${prefix} "cc=${cc}" "Cflags=${cflags}-MIPHONEOS-VERSION-MIN=${IOS_MIN_SDK }-arch armv7-isysroot ${iphoneos_sysroot} "" Cxx=${cxx} "" Cxxflags=${cxxflags}-arch armv7-isysroot ${IPHONEOS_SYSROOT } "ldflags="-arch Armv7-miphoneos-version-min=${ios_min_sdk} ${ldflags} "" Libs=${libs} "make ${extra_make_flags} ma KE ${extra_make_flags} install cd ${PREFIX}/PLATFORMRM-RF armv7mkdir ARMV7CP ${prefix}/lib/*.a ${PREFIX}/platform/ ARMV7) armv7_iphone_output= ' Find ${prefix}/platform/armv7/*.a ' elsearmv7_iphone_output=fiif [$BUILD _armv7s_iphone- EQ 1]thenecho "###################" echo "armv7s for IPhone" echo "###################" (CD ${pwd} make ${extra_make_fla GS} distclean./configure--build=x86_64-apple-darwin13.0.0--host=armv7s-apple-darwin13.0.0--enable-static-- Disable-shared--prefix=${prefix} "cc=${cc}" "Cflags=${cflagS}-miphoneos-version-min=${ios_min_sdk}-arch armv7s-isysroot ${iphoneos_sysroot} "" Cxx=${cxx} "" CXXFLAGS=${ Cxxflags}-arch armv7s-isysroot ${iphoneos_sysroot} "ldflags="-arch armv7s-miphoneos-version-min=${ios_min_sdk} ${ Ldflags} "" Libs=${libs} "make ${extra_make_flags} make ${extra_make_flags} install CD ${PREFIX}/PLATFORMRM-RF armv7 Smkdir armv7scp ${prefix}/lib/*.a ${prefix}/platform/armv7s) armv7s_iphone_output= ' Find ${PREFIX}/platform/armv7s/* . A ' elsearmv7s_iphone_output=fiif [$BUILD _i386_ios_sim-eq 1]thenecho "###########################" echo "i386 for IPhone Simulator "echo" ########################### "(CD ${pwd}make ${extra_make_flags} distclean./configure--build= x86_64-apple-darwin13.0.0--host=i386-apple-darwin13.0.0--enable-static--disable-shared--prefix=${PREFIX} "CC=${ CC} "" Cflags=${cflags}-miphoneos-version-min=${ios_min_sdk}-arch i386-isysroot ${iphonesimulator_sysroot} "" CXX=${ CXX} "" Cxxflags=${cxxflags}-arch i386-isysroot ${IPHONESIMULATOR_SYSROOT} "ldflags="-arch I386-miphoneos-version-min=${ios_min_sdk} ${ldflags} "Libs=${libs}" make ${extra_make_flags} Make ${extra_make_flags} installcd ${prefix}/platformrm-rf simmkdir simcp ${prefix}/lib/*.a ${PREFIX}/platform/sim) ios_sim_output= ' Find ${prefix}/platform/sim/*.a ' Elseios_sim_output=fiecho "############################" echo " Create mixd Libraries "echo" ############################ "(CD ${PREFIX}/PLATFORMRM-RF mixdmkdir-p mixd Lipo ${ios_sim_ OUTPUT} ${armv7_iphone_output} ${armv7s_iphone_output}-create-output ${prefix}/platform/mixd/lib${build_target}.a )) 2>&1#) >build.log 2>&1echo "Done"


IOS Universal cross-compilation script

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.