forked from krzyzanowskim/OpenSSL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-framework.sh
executable file
·27 lines (20 loc) · 1.51 KB
/
create-framework.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# Bitcode is not working
FWNAME="openssl"
OSX_MIN="10.9"
IOS_MIN="8.0"
rm -rf Frameworks/ios/$FWNAME.framework
rm -rf Frameworks/macos/$FWNAME.framework
echo "Creating $FWNAME.framework"
mkdir -p Frameworks/ios/$FWNAME.framework/Headers
mkdir -p Frameworks/macos/$FWNAME.framework/Headers
# xcrun --sdk iphoneos ld -dylib -arch armv7 -bitcode_bundle -ios_version_min $IOS_MIN lib-ios/libcrypto.a -o Frameworks/ios/$FWNAME.framework/$FWNAME-armv7
# xcrun --sdk iphoneos ld -dylib -arch armv7s -bitcode_bundle -ios_version_min $IOS_MIN lib-ios/libcrypto.a -o Frameworks/ios/$FWNAME.framework/$FWNAME-armv7s
# xcrun --sdk iphoneos ld -dylib -arch arm64 -bitcode_bundle -ios_version_min $IOS_MIN lib-ios/libcrypto.a -o Frameworks/ios/$FWNAME.framework/$FWNAME-arm64
# xcrun --sdk iphoneos lipo -create Frameworks/ios/$FWNAME.framework/$FWNAME-* -output Frameworks/ios/$FWNAME.framework/$FWNAME
# rm -rf Frameworks/ios/$FWNAME.framework/$FWNAME-*
xcrun --sdk iphoneos libtool -dynamic -no_warning_for_no_symbols -undefined dynamic_lookup -ios_version_min $IOS_MIN -o Frameworks/ios/$FWNAME.framework/$FWNAME lib-ios/libcrypto.a lib-ios/libssl.a
xcrun --sdk macosx libtool -dynamic -no_warning_for_no_symbols -undefined dynamic_lookup -macosx_version_min $OSX_MIN -o Frameworks/macos/$FWNAME.framework/$FWNAME lib-macos/libcrypto.a lib-macos/libssl.a
cp -r include-ios/$FWNAME/* Frameworks/ios/$FWNAME.framework/Headers/
cp -r include-macos/$FWNAME/* Frameworks/macos/$FWNAME.framework/Headers/
echo "Created $FWNAME.framework"