使用 Xcode 和 SDK 4+ 构建胖静态库(设备 + 模拟器)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3520977/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Build fat static library (device + simulator) using Xcode and SDK 4+
提问by Adam
It appears that we can - theoretically - build a single static library that includes both simulator and iPhone and iPad.
从理论上讲,我们似乎可以构建一个包含模拟器、iPhone 和 iPad 的静态库。
However, Apple has no documentation on this that I can find, and Xcode's default templates are NOT configured to do this.
但是,Apple 没有我可以找到的关于此的文档,并且 Xcode 的默认模板未配置为执行此操作。
I'm looking for a simple, portable, re-usable technique that can be done inside Xcode.
我正在寻找一种可以在 Xcode 中完成的简单、便携、可重用的技术。
Some history:
一些历史:
- In 2008, we used to be able to make single static-libs that included both sim and device. Apple disabled that.
- Throughout 2009, we made pairs of static libs - one for sim, one for device. Apple has now disabled that too.
- 2008 年,我们曾经能够制作包含 sim 和设备的单个静态库。苹果禁用了。
- 整个 2009 年,我们制作了成对的静态库——一个用于 sim,一个用于设备。苹果现在也禁用了它。
References:
参考:
This is a great idea, it's an excellent approach, but it doesn't work: http://www.drobnik.com/touch/2010/04/universal-static-libraries/
- There's some bugs in his script that means it only works on his machine - he should be using BUILT_PRODUCTS_DIR and/or BUILD_DIR instead of "guesstimating" them)
- Apple's latest Xcode prevents you from doing what he's done - it simply will not work, due to the (Documented) change in how Xcode processes targets)
Another SO questioner asked how to do it WITHOUT xcode, and with responses that focussed on the arm6 vs arm7 part - but ignored the i386 part: How do i compile a static library (fat) for armv6, armv7 and i386
- Since Apple's latest changes, the Simulator part isn't the same as the arm6/arm7 difference any more - it's a different problem, see above)
这是一个好主意,它是一个很好的方法,但它不起作用:http: //www.drobnik.com/touch/2010/04/universal-static-libraries/
- 他的脚本中有一些错误,这意味着它只能在他的机器上运行——他应该使用 BUILT_PRODUCTS_DIR 和/或 BUILD_DIR 而不是“猜测”它们)
- Apple 最新的 Xcode 阻止您执行他所做的操作 - 由于 Xcode 处理目标的方式发生了(已记录的)更改,因此它根本无法工作)
另一个 SO 提问者询问如何在没有 xcode 的情况下做到这一点,并且回答侧重于 arm6 与 arm7 部分 - 但忽略了 i386 部分:如何为 armv6、armv7 和 i386 编译静态库(胖)
- 由于 Apple 的最新变化,模拟器部分不再与 arm6/arm7 的区别相同 - 这是一个不同的问题,见上文)
采纳答案by Adam
ALTERNATIVES:
备择方案:
Easy copy/paste of latest version(but install instructions may change - see below!)
轻松复制/粘贴最新版本(但安装说明可能会更改 - 见下文!)
Karl's librarytakes much more effort to setup, but much nicer long-term solution (it converts your library into a Framework).
Karl 的库需要更多的努力来设置,但更好的长期解决方案(它将您的库转换为框架)。
Use this, then tweak it to add support for Archive builds- c.f. @Frederik's comment below on the changes he's using to make this work nicely with Archive mode.
使用它,然后调整它以添加对存档构建的支持- 参见下面@Frederik 对他使用的更改的评论,以使其在存档模式下可以很好地工作。
RECENT CHANGES: 1. Added support for iOS 10.x (while maintaining support for older platforms)
最近的变化: 1. 添加了对 iOS 10.x 的支持(同时保持对旧平台的支持)
Info on how to use this script with a project-embedded-in-another-project (although I highly recommend NOT doing that, ever - Apple has a couple of show-stopper bugs in Xcode if you embed projects inside each other, from Xcode 3.x through to Xcode 4.6.x)
Bonus script to let you auto-include Bundles (i.e. include PNG files, PLIST files etc from your library!) - see below (scroll to bottom)
now supports iPhone5 (using Apple's workaround to the bugs in lipo). NOTE: the install instructions have changed (I can probably simplify this by changing the script in future, but don't want to risk it now)
"copy headers" section now respects the build setting for the location of the public headers (courtesy of Frederik Wallner)
Added explicit setting of SYMROOT (maybe need OBJROOT to be set too?), thanks to Doug Dickinson
有关如何将此脚本与项目嵌入另一个项目一起使用的信息(尽管我强烈建议不要这样做,但如果您从 Xcode 将项目相互嵌入,Apple 在 Xcode 中有几个显示停止器错误3.x 到 Xcode 4.6.x)
奖励脚本让您自动包含捆绑包(即包含库中的 PNG 文件、PLIST 文件等!) - 见下文(滚动到底部)
现在支持 iPhone5(使用 Apple 解决 lipo 中的错误的方法)。注意:安装说明已更改(我可能可以通过将来更改脚本来简化此操作,但现在不想冒险)
“复制标题”部分现在尊重公共标题位置的构建设置(由 Frederik Wallner 提供)
添加了 SYMROOT 的显式设置(也许还需要设置 OBJROOT?),感谢 Doug Dickinson
SCRIPT (this is what you have to copy/paste)
脚本(这是您必须复制/粘贴的内容)
For usage / install instructions, see below
有关使用/安装说明,请参见下文
##########################################
#
# c.f. https://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.82
#
# Latest Change:
# - MORE tweaks to get the iOS 10+ and 9- working
# - Support iOS 10+
# - Corrected typo for iOS 1-10+ (thanks @stuikomma)
#
# Purpose:
# Automatically create a Universal static library for iPhone + iPad + iPhone Simulator from within XCode
#
# Author: Adam Martin - http://twitter.com/redglassesapps
# Based on: original script from Eonil (main changes: Eonil's script WILL NOT WORK in Xcode GUI - it WILL CRASH YOUR COMPUTER)
#
set -e
set -o pipefail
#################[ Tests: helps workaround any future bugs in Xcode ]########
#
DEBUG_THIS_SCRIPT="false"
if [ $DEBUG_THIS_SCRIPT = "true" ]
then
echo "########### TESTS #############"
echo "Use the following variables when debugging this script; note that they may change on recursions"
echo "BUILD_DIR = $BUILD_DIR"
echo "BUILD_ROOT = $BUILD_ROOT"
echo "CONFIGURATION_BUILD_DIR = $CONFIGURATION_BUILD_DIR"
echo "BUILT_PRODUCTS_DIR = $BUILT_PRODUCTS_DIR"
echo "CONFIGURATION_TEMP_DIR = $CONFIGURATION_TEMP_DIR"
echo "TARGET_BUILD_DIR = $TARGET_BUILD_DIR"
fi
#####################[ part 1 ]##################
# First, work out the BASESDK version number (NB: Apple ought to report this, but they hide it)
# (incidental: searching for substrings in sh is a nightmare! Sob)
SDK_VERSION=$(echo ${SDK_NAME} | grep -o '\d\{1,2\}\.\d\{1,2\}$')
# Next, work out if we're in SIM or DEVICE
if [ ${PLATFORM_NAME} = "iphonesimulator" ]
then
OTHER_SDK_TO_BUILD=iphoneos${SDK_VERSION}
else
OTHER_SDK_TO_BUILD=iphonesimulator${SDK_VERSION}
fi
echo "XCode has selected SDK: ${PLATFORM_NAME} with version: ${SDK_VERSION} (although back-targetting: ${IPHONEOS_DEPLOYMENT_TARGET})"
echo "...therefore, OTHER_SDK_TO_BUILD = ${OTHER_SDK_TO_BUILD}"
#
#####################[ end of part 1 ]##################
#####################[ part 2 ]##################
#
# IF this is the original invocation, invoke WHATEVER other builds are required
#
# Xcode is already building ONE target...
#
# ...but this is a LIBRARY, so Apple is wrong to set it to build just one.
# ...we need to build ALL targets
# ...we MUST NOT re-build the target that is ALREADY being built: Xcode WILL CRASH YOUR COMPUTER if you try this (infinite recursion!)
#
#
# So: build ONLY the missing platforms/configurations.
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: I am NOT the root invocation, so I'm NOT going to recurse"
else
# CRITICAL:
# Prevent infinite recursion (Xcode sucks)
export ALREADYINVOKED="true"
echo "RECURSION: I am the root ... recursing all missing build targets NOW..."
echo "RECURSION: ...about to invoke: xcodebuild -configuration \"${CONFIGURATION}\" -project \"${PROJECT_NAME}.xcodeproj\" -target \"${TARGET_NAME}\" -sdk \"${OTHER_SDK_TO_BUILD}\" ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO" BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\" SYMROOT=\"${SYMROOT}\"
xcodebuild -configuration "${CONFIGURATION}" -project "${PROJECT_NAME}.xcodeproj" -target "${TARGET_NAME}" -sdk "${OTHER_SDK_TO_BUILD}" ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" SYMROOT="${SYMROOT}"
ACTION="build"
#Merge all platform binaries as a fat binary for each configurations.
# Calculate where the (multiple) built files are coming from:
CURRENTCONFIG_DEVICE_DIR=${SYMROOT}/${CONFIGURATION}-iphoneos
CURRENTCONFIG_SIMULATOR_DIR=${SYMROOT}/${CONFIGURATION}-iphonesimulator
echo "Taking device build from: ${CURRENTCONFIG_DEVICE_DIR}"
echo "Taking simulator build from: ${CURRENTCONFIG_SIMULATOR_DIR}"
CREATING_UNIVERSAL_DIR=${SYMROOT}/${CONFIGURATION}-universal
echo "...I will output a universal build to: ${CREATING_UNIVERSAL_DIR}"
# ... remove the products of previous runs of this script
# NB: this directory is ONLY created by this script - it should be safe to delete!
rm -rf "${CREATING_UNIVERSAL_DIR}"
mkdir "${CREATING_UNIVERSAL_DIR}"
#
echo "lipo: for current configuration (${CONFIGURATION}) creating output file: ${CREATING_UNIVERSAL_DIR}/${EXECUTABLE_NAME}"
xcrun -sdk iphoneos lipo -create -output "${CREATING_UNIVERSAL_DIR}/${EXECUTABLE_NAME}" "${CURRENTCONFIG_DEVICE_DIR}/${EXECUTABLE_NAME}" "${CURRENTCONFIG_SIMULATOR_DIR}/${EXECUTABLE_NAME}"
#########
#
# Added: StackOverflow suggestion to also copy "include" files
# (untested, but should work OK)
#
echo "Fetching headers from ${PUBLIC_HEADERS_FOLDER_PATH}"
echo " (if you embed your library project in another project, you will need to add"
echo " a "User Search Headers" build setting of: (NB INCLUDE THE DOUBLE QUOTES BELOW!)"
echo ' "$(TARGET_BUILD_DIR)/usr/local/include/"'
if [ -d "${CURRENTCONFIG_DEVICE_DIR}${PUBLIC_HEADERS_FOLDER_PATH}" ]
then
mkdir -p "${CREATING_UNIVERSAL_DIR}${PUBLIC_HEADERS_FOLDER_PATH}"
# * needs to be outside the double quotes?
cp -r "${CURRENTCONFIG_DEVICE_DIR}${PUBLIC_HEADERS_FOLDER_PATH}"* "${CREATING_UNIVERSAL_DIR}${PUBLIC_HEADERS_FOLDER_PATH}"
fi
fi
INSTALL INSTRUCTIONS
安装说明
- Create a static lib project
- Select the Target
- In "Build Settings" tab, set "Build Active Architecture Only" to "NO" (for allitems)
- In "Build Phases" tab, select "Add ... New Build Phase ... New Run Script Build Phase"
- Copy/paste the script (above) into the box
- 创建一个静态库项目
- 选择目标
- 在“Build Settings”选项卡中,将“Build Active Architecture Only”设置为“NO”(对于所有项目)
- 在“Build Phases”选项卡中,选择“Add ... New Build Phase ... New Run Script Build Phase”
- 将脚本(上图)复制/粘贴到框中
...BONUS OPTIONAL usage:
...奖金可选用法:
- OPTIONAL: if you have headers in your library, add them to the "Copy Headers" phase
- OPTIONAL: ...and drag/drop them from the "Project" section to the "Public" section
- OPTIONAL: ...and they will AUTOMATICALLY be exported every time you build the app, into a sub-directory of the "debug-universal" directory (they will be in usr/local/include)
- OPTIONAL: NOTE: if you alsotry to drag/drop your project into another Xcode project, this exposes a bug in Xcode 4, where it cannot create an .IPA file if you have Public Headers in your drag/dropped project. The workaround: dont' embed xcode projects (too many bugs in Apple's code!)
- 可选:如果您的库中有标题,请将它们添加到“复制标题”阶段
- 可选:...并将它们从“项目”部分拖放到“公共”部分
- 可选:...并且每次构建应用程序时它们都会自动导出到“调试通用”目录的子目录中(它们将在 usr/local/include 中)
- 可选:注意:如果您还尝试将您的项目拖放到另一个 Xcode 项目中,这会暴露 Xcode 4 中的一个错误,如果您的拖放项目中有公共标题,则它无法创建 .IPA 文件。解决方法:不要嵌入 xcode 项目(Apple 代码中的错误太多!)
If you can't find the output file, here's a workaround:
如果找不到输出文件,这里有一个解决方法:
Add the following code to the very end of the script (courtesy of Frederik Wallner): open "${CREATING_UNIVERSAL_DIR}"
Apple deletes all output after 200 lines. Select your Target, and in the Run Script Phase, you MUST untick: "Show environment variables in build log"
if you're using a custom "build output" directory for XCode4, then XCode puts all your "unexpected" files in the wrong place.
- Build the project
- Click on the last icon on the right, in the top left area of Xcode4.
- Select the top item (this is your "most recent build". Apple should auto-select it, but they didn't think of that)
- in the main window, scroll to bottom. The very last line should read: lipo: for current configuration (Debug) creating output file: /Users/blah/Library/Developer/Xcode/DerivedData/AppName-ashwnbutvodmoleijzlncudsekyf/Build/Products/Debug-universal/libTargetName.a
...that is the location of your Universal Build.
将以下代码添加到脚本的最后(由 Frederik Wallner 提供):打开“${CREATING_UNIVERSAL_DIR}”
Apple 删除 200 行后的所有输出。选择您的目标,在运行脚本阶段,您必须取消勾选:“在构建日志中显示环境变量”
如果您为 XCode4 使用自定义的“构建输出”目录,那么 XCode 会将您所有的“意外”文件放在错误的位置。
- 构建项目
- 单击右侧最后一个图标,位于 Xcode4 的左上角区域。
- 选择顶部项目(这是您的“最新版本”。Apple 应该自动选择它,但他们没有想到这一点)
- 在主窗口中,滚动到底部。最后一行应该是: lipo: for current configuration (Debug) 创建输出文件:/Users/blah/Library/Developer/Xcode/DerivedData/AppName-ashwnbutvodmoleijzlncudsekyf/Build/Products/Debug-universal/libTargetName.a
...那是您的通用构建的位置。
How to include "non sourcecode" files in your project (PNG, PLIST, XML, etc)
如何在项目中包含“非源代码”文件(PNG、PLIST、XML 等)
- Do everything above, check it works
- Create a new Run Script phase that comes AFTER THE FIRST ONE (copy/paste the code below)
- Create a new Target in Xcode, of type "bundle"
- In your MAIN PROJECT, in "Build Phases", add the new bundle as something it "depends on" (top section, hit the plus button, scroll to bottom, find the ".bundle" file in your Products)
- In your NEW BUNDLE TARGET, in "Build Phases", add a "Copy Bundle Resources" section, and drag/drop all the PNG files etc into it
- 做上面的一切,检查它是否有效
- 在第一个阶段之后创建一个新的运行脚本阶段(复制/粘贴下面的代码)
- 在 Xcode 中创建一个新的 Target,类型为“bundle”
- 在您的主项目中,在“构建阶段”中,将新包添加为它“依赖”的内容(顶部部分,点击加号按钮,滚动到底部,在您的产品中找到“.bundle”文件)
- 在您的新捆绑包目标的“构建阶段”中,添加一个“复制捆绑包资源”部分,然后将所有 PNG 文件等拖放到其中
Script to auto-copy the built bundle(s) into same folder as your FAT static library:
将构建的包自动复制到与 FAT 静态库相同的文件夹中的脚本:
echo "RunScript2:"
echo "Autocopying any bundles into the 'universal' output folder created by RunScript1"
CREATING_UNIVERSAL_DIR=${SYMROOT}/${CONFIGURATION}-universal
cp -r "${BUILT_PRODUCTS_DIR}/"*.bundle "${CREATING_UNIVERSAL_DIR}"
回答by g_low
I have spent many hours trying to build a fat static library that will work on armv7, armv7s, and the simulator. Finally found a solution.
我花了很多时间试图构建一个可以在 armv7、armv7s 和模拟器上运行的胖静态库。终于找到了解决办法。
The gist is to build the two libraries (one for the device and then one for the simulator) separately, rename them to distinguish from each other, and then lipo -create them into one library.
要点是分别构建两个库(一个用于设备,一个用于模拟器),重命名它们以区分彼此,然后将它们 lipo -create 合并到一个库中。
lipo -create libPhone.a libSimulator.a -output libUniversal.a
I tried it and it works!
我试过了,它有效!
回答by Karl
I've made an XCode 4 project templatethat lets you make a universal framework as easily as making a regular library.
我制作了一个XCode 4 项目模板,让您可以像制作常规库一样轻松制作通用框架。
回答by Eonil
There is a command-line utility xcodebuild
and you can run shell command within xcode.
So, if you don't mind using custom script, this script may help you.
有一个命令行实用程序xcodebuild
,您可以在 xcode 中运行 shell 命令。因此,如果您不介意使用自定义脚本,此脚本可能会对您有所帮助。
#Configurations.
#This script designed for Mac OS X command-line, so does not use Xcode build variables.
#But you can use it freely if you want.
TARGET=sns
ACTION="clean build"
FILE_NAME=libsns.a
DEVICE=iphoneos3.2
SIMULATOR=iphonesimulator3.2
#Build for all platforms/configurations.
xcodebuild -configuration Debug -target ${TARGET} -sdk ${DEVICE} ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO
xcodebuild -configuration Debug -target ${TARGET} -sdk ${SIMULATOR} ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO
xcodebuild -configuration Release -target ${TARGET} -sdk ${DEVICE} ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO
xcodebuild -configuration Release -target ${TARGET} -sdk ${SIMULATOR} ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO
#Merge all platform binaries as a fat binary for each configurations.
DEBUG_DEVICE_DIR=${SYMROOT}/Debug-iphoneos
DEBUG_SIMULATOR_DIR=${SYMROOT}/Debug-iphonesimulator
DEBUG_UNIVERSAL_DIR=${SYMROOT}/Debug-universal
RELEASE_DEVICE_DIR=${SYMROOT}/Release-iphoneos
RELEASE_SIMULATOR_DIR=${SYMROOT}/Release-iphonesimulator
RELEASE_UNIVERSAL_DIR=${SYMROOT}/Release-universal
rm -rf "${DEBUG_UNIVERSAL_DIR}"
rm -rf "${RELEASE_UNIVERSAL_DIR}"
mkdir "${DEBUG_UNIVERSAL_DIR}"
mkdir "${RELEASE_UNIVERSAL_DIR}"
lipo -create -output "${DEBUG_UNIVERSAL_DIR}/${FILE_NAME}" "${DEBUG_DEVICE_DIR}/${FILE_NAME}" "${DEBUG_SIMULATOR_DIR}/${FILE_NAME}"
lipo -create -output "${RELEASE_UNIVERSAL_DIR}/${FILE_NAME}" "${RELEASE_DEVICE_DIR}/${FILE_NAME}" "${RELEASE_SIMULATOR_DIR}/${FILE_NAME}"
Maybe looks inefficient(I'm not good at shell script), but easy to understand. I configured a new target running only this script. The script is designed for command-line but not tested in :)
也许看起来效率低下(我不擅长 shell 脚本),但很容易理解。我配置了一个仅运行此脚本的新目标。该脚本是为命令行设计的,但未在 :) 中进行测试
The core concept is xcodebuild
and lipo
.
核心概念是xcodebuild
和lipo
。
I tried many configurations within Xcode UI, but nothing worked. Because this is a kind of batch processing, so command-line design is more suitable, so Apple removed batch build feature from Xcode gradually. So I don't expect they offer UI based batch build feature in future.
我在 Xcode UI 中尝试了许多配置,但没有任何效果。因为这是一种批处理,所以命令行设计更适合,所以苹果逐渐从 Xcode 中删除了批处理构建功能。所以我不希望他们将来提供基于 UI 的批量构建功能。
回答by Brad Robinson
I needed a fat static lib for JsonKit so created a static lib project in Xcode and then ran this bash script in the project directory. So long as you've configured the xcode project with "Build active configuration only" turned off, you should get all architectures in one lib.
我需要一个用于 JsonKit 的静态库,所以在 Xcode 中创建了一个静态库项目,然后在项目目录中运行这个 bash 脚本。只要您在关闭“仅构建活动配置”的情况下配置了 xcode 项目,您就应该在一个库中获得所有架构。
#!/bin/bash
xcodebuild -sdk iphoneos
xcodebuild -sdk iphonesimulator
lipo -create -output libJsonKit.a build/Release-iphoneos/libJsonKit.a build/Release-iphonesimulator/libJsonKit.a
回答by ben
IOS 10 Update:
IOS 10 更新:
I had a problem with building the fatlib with iphoneos10.0 because the regular expression in the script only expects 9.x and lower and returns 0.0 for ios 10.0
我在用 iphoneos10.0 构建 fatlib 时遇到了问题,因为脚本中的正则表达式只需要 9.x 及更低版本,而对于 ios 10.0 则返回 0.0
to fix this just replace
要解决这个问题,只需更换
SDK_VERSION=$(echo ${SDK_NAME} | grep -o '.\{3\}$')
with
和
SDK_VERSION=$(echo ${SDK_NAME} | grep -o '[\.0-9]\{3,4\}$')
回答by Michael Tyson
I've made this into an Xcode 4 template, in the same vein as Karl's static framework template.
我已经把它变成了一个Xcode 4 模板,与 Karl 的静态框架模板一样。
I found that building static frameworks (instead of plain static libraries) was causing random crashes with LLVM, due to an apparent linker bug - so, I guess static libraries are still useful!
我发现由于明显的链接器错误,构建静态框架(而不是普通静态库)会导致 LLVM 随机崩溃 - 所以,我猜静态库仍然有用!
回答by user503821
Great job! I hacked together something similar, but had to run it separately. Having it just be part of the build process makes it so much simpler.
很好!我将类似的东西拼凑在一起,但不得不单独运行。将它作为构建过程的一部分使它变得更加简单。
One item of note. I noticed that it doesn't copy over any of the include files that you mark as public. I've adapted what I had in my script to yours and it works fairly well. Paste the following to the end of your script.
注意事项之一。我注意到它不会复制您标记为公开的任何包含文件。我已经将我的脚本中的内容改编为您的脚本,并且效果很好。将以下内容粘贴到脚本的末尾。
if [ -d "${CURRENTCONFIG_DEVICE_DIR}/usr/local/include" ]
then
mkdir -p "${CURRENTCONFIG_UNIVERSAL_DIR}/usr/local/include"
cp "${CURRENTCONFIG_DEVICE_DIR}"/usr/local/include/* "${CURRENTCONFIG_UNIVERSAL_DIR}/usr/local/include"
fi
回答by whooops
I actually just wrote my own scriptfor this purpose. It doesn't use Xcode. (It's based off a similar script in the Gambit Scheme project.)
我实际上只是为此目的编写了自己的脚本。它不使用 Xcode。(它基于 Gambit Scheme 项目中的类似脚本。)
Basically, it runs ./configure and make three times (for i386, armv7, and armv7s), and combines each of the resulting libraries into a fat lib.
基本上,它运行 ./configure 并 make 三次(对于 i386、armv7 和 armv7s),并将每个生成的库组合到一个胖库中。