一、下載好GMSSL源碼,終端 cd到目錄下,分別編譯各個版本的包
./Configure ios64-cross(arm64)
./Configure iphoneos-cross(armv7、armv7s)
./Configure darwin64-x86_64-cc (x86_64)
./Configure darwin-i386-cc (i386)
出現(xiàn)錯誤
Operating system: x86_64-whatever-linux2 “glob” is not exported by the File::Glob module Can’t continue after import errors at ./Configure line 18. BEGIN failed–compilation aborted at ./Configure line 18. “glob” is not exported by the File::Glob module Can’t continue after import errors at ./Configure line 18. BEGIN failed–compilation aborted at ./Configure line 18. This system (linux-x86_64) is not supported. See file INSTALL for details
glob相關(guān)問題
This issue is due to the Perl package File::Glob, 一些簡單的修改就能修復(fù)這個. 在 Configure文件和 test/build.info這個文件,
把
use if ^O ne "VMS", 'File::Glob' => qw/:glob/;
重置第一步不報錯即可
二、終端輸入 open Makefile 做以下修改
打開Makefile
1、CC=/Applications/XCode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7s
2、搜索“-isysroot”,把-isysroot后面的
&(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common
修改為
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk(-isysroot后面修改前的代碼可能不一樣,直接把-isysroot后面的代碼按上面改就好。
三、修改完成后保存下 ,輸入 make 在目錄下會多出2個編譯好的.a文件
四、sudo make install 安裝完成
至此 一個架構(gòu)的包編譯完成。make clean 下 編譯其他架構(gòu)的包
全部編譯完成后
lipo -create 目錄下的libssl_armv7.a libssl_armv7s.a libssl_arm64.a libssl_x86.a -output libssl.a
合并各個架構(gòu)的文件
lipo -info libssl.a 查看支持的架構(gòu)