构建iOS静态库及动态库
前言
通常,需要配置host,以及所使用的SDK所在的目录、C编译器路径、C++编译器路径。
host通常使用--host选项进行指定。
SDK通常使用--with-sysroot选项或--sysroot选项进行指定。
C编译器可使用xcrun -f clang取得。
C++编译器可使用xcrun -f clang++取得。
--prefix选项指定构建输出目录。
--disable-shared及--enable-static选项指定生成静态库。
--enable-shared及--disable-static选项指定生成动态库。
具体选项可在各第三方库根目录下执行./configure --help进行查看。
host
- 对于
arm64架构,host为aarch64-apple-darwin - 对于
armv6、armv7、armv7s架构,host为arm-apple-darwin - 对于
i386架构,host为i386-apple-darwin - 对于
x86_64架构,host为x86_64-apple-darwin 
SDK
- 对于
arm架构,可使用xcrun --show-sdk-path --sdk iphoneos取得 - 对于
i386、x86_64架构,可使用xcrun --show-sdk-path --sdk iphonesimulator取得 
环境变量
在编译时,也可能需要修改如下环境变量,如:
1  |  | 
其中,
1  |  | 
将多个只支持单个CPU架构的库文件合并为通用库文件
1  |  | 
1  |  | 
构建iOS静态库及动态库
      https://daniate.github.io/2018/04/15/构建iOS静态库及动态库/