Merge branch 'bugfix/dynamic-framework'

This commit is contained in:
Davide De Rosa 2018-02-08 16:44:13 +01:00
commit d49bf7f61c
9 changed files with 211 additions and 62 deletions

View File

@ -7,6 +7,10 @@
objects = {
/* Begin PBXBuildFile section */
0EA706651F817CCC001E4F88 /* libcrypto-iPhone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EA706611F817CCB001E4F88 /* libcrypto-iPhone.a */; };
0EA706661F817CCC001E4F88 /* libssl-iPhone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EA706621F817CCB001E4F88 /* libssl-iPhone.a */; };
0EA706681F817CE5001E4F88 /* libcrypto-AppleTV.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EA706601F817CCB001E4F88 /* libcrypto-AppleTV.a */; };
0EA706691F817CE5001E4F88 /* libssl-AppleTV.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EA706631F817CCC001E4F88 /* libssl-AppleTV.a */; };
2A1DDC8F1BFB1DF600F7722A /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2A1DDC8E1BFB1DF600F7722A /* ViewController.xib */; };
2A3821001BFB5EEB00328618 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A3820FF1BFB5EEB00328618 /* AppDelegate.swift */; };
2A3821021BFB607A00328618 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A3821011BFB607A00328618 /* ViewController.swift */; };
@ -15,13 +19,9 @@
2A8A9A7E1BFA59F7002944B4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2A8A9A7D1BFA59F7002944B4 /* Assets.xcassets */; };
2A8A9A851BFA5AFF002944B4 /* ViewController~tv.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2A8A9A841BFA5AFF002944B4 /* ViewController~tv.xib */; };
2A8A9A871BFA5B6A002944B4 /* FSOpenSSL.m in Sources */ = {isa = PBXBuildFile; fileRef = D1E97EE2A904D58DAE4231E2 /* FSOpenSSL.m */; };
2A8A9A8A1BFA5B85002944B4 /* libcrypto-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A8A9A881BFA5B85002944B4 /* libcrypto-tvOS.a */; };
2A8A9A8B1BFA5B85002944B4 /* libssl-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A8A9A891BFA5B85002944B4 /* libssl-tvOS.a */; };
533ED3001528C4840005C6FA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 533ED2FF1528C4840005C6FA /* UIKit.framework */; };
533ED3021528C4840005C6FA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 533ED3011528C4840005C6FA /* Foundation.framework */; };
533ED3041528C4840005C6FA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 533ED3031528C4840005C6FA /* CoreGraphics.framework */; };
533ED32C1528C53B0005C6FA /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 533ED32A1528C53B0005C6FA /* libcrypto.a */; };
533ED32D1528C53B0005C6FA /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 533ED32B1528C53B0005C6FA /* libssl.a */; };
534FB2AE180975D700B5F868 /* Icons.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 534FB2AD180975D700B5F868 /* Icons.xcassets */; };
53572A4D183AAFFE00B21832 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53572A4C183AAFFE00B21832 /* XCTest.framework */; };
53572A4E183AAFFE00B21832 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 533ED3011528C4840005C6FA /* Foundation.framework */; };
@ -42,24 +42,24 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
0EA706601F817CCB001E4F88 /* libcrypto-AppleTV.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libcrypto-AppleTV.a"; path = "lib/libcrypto-AppleTV.a"; sourceTree = "<group>"; };
0EA706611F817CCB001E4F88 /* libcrypto-iPhone.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libcrypto-iPhone.a"; path = "lib/libcrypto-iPhone.a"; sourceTree = "<group>"; };
0EA706621F817CCB001E4F88 /* libssl-iPhone.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libssl-iPhone.a"; path = "lib/libssl-iPhone.a"; sourceTree = "<group>"; };
0EA706631F817CCC001E4F88 /* libssl-AppleTV.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libssl-AppleTV.a"; path = "lib/libssl-AppleTV.a"; sourceTree = "<group>"; };
2A1DDC8E1BFB1DF600F7722A /* ViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ViewController.xib; sourceTree = "<group>"; };
2A3820FE1BFB5EEA00328618 /* OpenSSL-for-iOS-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OpenSSL-for-iOS-Bridging-Header.h"; sourceTree = "<group>"; };
2A3820FE1BFB5EEA00328618 /* Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
2A3820FF1BFB5EEB00328618 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
2A3821011BFB607A00328618 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
2A8A9A6F1BFA59F7002944B4 /* OpenSSL-for-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "OpenSSL-for-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2A8A9A7D1BFA59F7002944B4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
2A8A9A7F1BFA59F7002944B4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2A8A9A841BFA5AFF002944B4 /* ViewController~tv.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "ViewController~tv.xib"; sourceTree = "<group>"; };
2A8A9A881BFA5B85002944B4 /* libcrypto-tvOS.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libcrypto-tvOS.a"; path = "lib/libcrypto-tvOS.a"; sourceTree = "<group>"; };
2A8A9A891BFA5B85002944B4 /* libssl-tvOS.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libssl-tvOS.a"; path = "lib/libssl-tvOS.a"; sourceTree = "<group>"; };
533ED2FB1528C4840005C6FA /* OpenSSL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenSSL.app; sourceTree = BUILT_PRODUCTS_DIR; };
533ED2FF1528C4840005C6FA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
533ED3011528C4840005C6FA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
533ED3031528C4840005C6FA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
533ED3071528C4840005C6FA /* OpenSSL-for-iOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OpenSSL-for-iOS-Info.plist"; sourceTree = "<group>"; };
533ED30D1528C4840005C6FA /* OpenSSL-for-iOS-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OpenSSL-for-iOS-Prefix.pch"; sourceTree = "<group>"; };
533ED32A1528C53B0005C6FA /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcrypto.a; path = lib/libcrypto.a; sourceTree = "<group>"; };
533ED32B1528C53B0005C6FA /* libssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libssl.a; path = lib/libssl.a; sourceTree = "<group>"; };
533ED3071528C4840005C6FA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
533ED30D1528C4840005C6FA /* Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = "<group>"; };
534FB2AD180975D700B5F868 /* Icons.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Icons.xcassets; sourceTree = "<group>"; };
53572A4B183AAFFE00B21832 /* OpenSSL-for-iOS_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "OpenSSL-for-iOS_Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
53572A4C183AAFFE00B21832 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
@ -79,8 +79,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2A8A9A8B1BFA5B85002944B4 /* libssl-tvOS.a in Frameworks */,
2A8A9A8A1BFA5B85002944B4 /* libcrypto-tvOS.a in Frameworks */,
0EA706681F817CE5001E4F88 /* libcrypto-AppleTV.a in Frameworks */,
0EA706691F817CE5001E4F88 /* libssl-AppleTV.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -89,10 +89,10 @@
buildActionMask = 2147483647;
files = (
533ED3001528C4840005C6FA /* UIKit.framework in Frameworks */,
0EA706661F817CCC001E4F88 /* libssl-iPhone.a in Frameworks */,
533ED3021528C4840005C6FA /* Foundation.framework in Frameworks */,
533ED3041528C4840005C6FA /* CoreGraphics.framework in Frameworks */,
533ED32C1528C53B0005C6FA /* libcrypto.a in Frameworks */,
533ED32D1528C53B0005C6FA /* libssl.a in Frameworks */,
0EA706651F817CCC001E4F88 /* libcrypto-iPhone.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -144,10 +144,10 @@
533ED2FE1528C4840005C6FA /* Frameworks */ = {
isa = PBXGroup;
children = (
2A8A9A881BFA5B85002944B4 /* libcrypto-tvOS.a */,
2A8A9A891BFA5B85002944B4 /* libssl-tvOS.a */,
533ED32A1528C53B0005C6FA /* libcrypto.a */,
533ED32B1528C53B0005C6FA /* libssl.a */,
0EA706601F817CCB001E4F88 /* libcrypto-AppleTV.a */,
0EA706611F817CCB001E4F88 /* libcrypto-iPhone.a */,
0EA706631F817CCC001E4F88 /* libssl-AppleTV.a */,
0EA706621F817CCB001E4F88 /* libssl-iPhone.a */,
533ED2FF1528C4840005C6FA /* UIKit.framework */,
533ED3011528C4840005C6FA /* Foundation.framework */,
533ED3031528C4840005C6FA /* CoreGraphics.framework */,
@ -174,9 +174,9 @@
533ED3061528C4840005C6FA /* Supporting Files */ = {
isa = PBXGroup;
children = (
533ED3071528C4840005C6FA /* OpenSSL-for-iOS-Info.plist */,
533ED30D1528C4840005C6FA /* OpenSSL-for-iOS-Prefix.pch */,
2A3820FE1BFB5EEA00328618 /* OpenSSL-for-iOS-Bridging-Header.h */,
533ED3071528C4840005C6FA /* Info.plist */,
533ED30D1528C4840005C6FA /* Prefix.pch */,
2A3820FE1BFB5EEA00328618 /* Bridging-Header.h */,
);
name = "Supporting Files";
sourceTree = "<group>";
@ -349,7 +349,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ ! -f lib/libcrypto.a ]; then\n echo \"error: Please run ./build-libssl.h first\"\n exit 1\nfi";
shellScript = "if [ ! -f lib/libcrypto-iPhone.a ]; then\n echo \"error: Please run ./build-libssl.h first\"\n exit 1\nfi";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@ -428,7 +428,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "de.felixschulze.OpenSSL-for-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/OpenSSL-for-iOS-Bridging-Header.h";
SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/Bridging-Header.h";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
@ -460,7 +460,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "de.felixschulze.OpenSSL-for-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/OpenSSL-for-iOS-Bridging-Header.h";
SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/Bridging-Header.h";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
@ -554,16 +554,17 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_MODULES = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "OpenSSL-for-iOS/OpenSSL-for-iOS-Prefix.pch";
INFOPLIST_FILE = "OpenSSL-for-iOS/OpenSSL-for-iOS-Info.plist";
GCC_PREFIX_HEADER = "OpenSSL-for-iOS/Prefix.pch";
INFOPLIST_FILE = "$(SRCROOT)/OpenSSL-for-iOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/lib\"",
"$(PROJECT_DIR)/lib",
);
PRODUCT_BUNDLE_IDENTIFIER = "de.felixschulze.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = OpenSSL;
SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/OpenSSL-for-iOS-Bridging-Header.h";
SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
WRAPPER_EXTENSION = app;
@ -577,16 +578,17 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_MODULES = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "OpenSSL-for-iOS/OpenSSL-for-iOS-Prefix.pch";
INFOPLIST_FILE = "OpenSSL-for-iOS/OpenSSL-for-iOS-Info.plist";
GCC_PREFIX_HEADER = "OpenSSL-for-iOS/Prefix.pch";
INFOPLIST_FILE = "$(SRCROOT)/OpenSSL-for-iOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/lib\"",
"$(PROJECT_DIR)/lib",
);
PRODUCT_BUNDLE_IDENTIFIER = "de.felixschulze.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = OpenSSL;
SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/OpenSSL-for-iOS-Bridging-Header.h";
SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/Bridging-Header.h";
SWIFT_VERSION = 3.0;
WRAPPER_EXTENSION = app;
};

24
assets/AppleTV/Info.plist Normal file
View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>openssl</string>
<key>CFBundleIdentifier</key>
<string>org.openssl.OpenSSL</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>openssl</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
</dict>
</plist>

24
assets/iPhone/Info.plist Normal file
View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>openssl</string>
<key>CFBundleIdentifier</key>
<string>org.openssl.OpenSSL</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>openssl</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
</dict>
</plist>

View File

@ -473,15 +473,15 @@ fi
# Build iOS library if selected for build
if [ ${#LIBSSL_IOS[@]} -gt 0 ]; then
echo "Build library for iOS..."
lipo -create ${LIBSSL_IOS[@]} -output "${CURRENTPATH}/lib/libssl.a"
lipo -create ${LIBCRYPTO_IOS[@]} -output "${CURRENTPATH}/lib/libcrypto.a"
lipo -create ${LIBSSL_IOS[@]} -output "${CURRENTPATH}/lib/libssl-iPhone.a"
lipo -create ${LIBCRYPTO_IOS[@]} -output "${CURRENTPATH}/lib/libcrypto-iPhone.a"
fi
# Build tvOS library if selected for build
if [ ${#LIBSSL_TVOS[@]} -gt 0 ]; then
echo "Build library for tvOS..."
lipo -create ${LIBSSL_TVOS[@]} -output "${CURRENTPATH}/lib/libssl-tvOS.a"
lipo -create ${LIBCRYPTO_TVOS[@]} -output "${CURRENTPATH}/lib/libcrypto-tvOS.a"
lipo -create ${LIBSSL_TVOS[@]} -output "${CURRENTPATH}/lib/libssl-AppleTV.a"
lipo -create ${LIBCRYPTO_TVOS[@]} -output "${CURRENTPATH}/lib/libcrypto-AppleTV.a"
fi
# Copy include directory

View File

@ -1,36 +1,135 @@
#!/bin/sh
#!/bin/bash
FWNAME=openssl
set -euo pipefail
if [ $# == 0 ]; then
echo "Usage: `basename $0` static|dynamic"
exit 1
fi
if [ ! -d lib ]; then
echo "Please run build-libssl.sh first!"
exit 1
fi
if [ -d $FWNAME.framework ]; then
echo "Removing previous $FWNAME.framework copy"
rm -rf $FWNAME.framework
FWTYPE=$1
FWNAME=openssl
FWROOT=frameworks
if [ -d $FWROOT ]; then
echo "Removing previous $FWNAME.framework copies"
rm -rf $FWROOT
fi
if [ "$1" == "dynamic" ]; then
LIBTOOL_FLAGS="-dynamic -undefined dynamic_lookup -ios_version_min 8.0"
ALL_SYSTEMS=("iPhone" "AppleTV")
function check_bitcode() {
local FWDIR=$1
if [[ $FWTYPE == "dynamic" ]]; then
BITCODE_PATTERN="__LLVM"
else
LIBTOOL_FLAGS="-static"
BITCODE_PATTERN="__bitcode"
fi
echo "Creating $FWNAME.framework"
mkdir -p $FWNAME.framework/Headers
libtool -no_warning_for_no_symbols $LIBTOOL_FLAGS -o $FWNAME.framework/$FWNAME lib/libcrypto.a lib/libssl.a
cp -r include/$FWNAME/* $FWNAME.framework/Headers/
DIR="$(cd "$(dirname "$0")" && pwd)"
cp $DIR/"OpenSSL-for-iOS/OpenSSL-for-iOS-Info.plist" $FWNAME.framework/Info.plist
echo "Created $FWNAME.framework"
check_bitcode=`otool -arch arm64 -l $FWNAME.framework/$FWNAME | grep __bitcode`
if [ -z "$check_bitcode" ]
then
echo "INFO: $FWNAME.framework doesn't contain Bitcode"
if otool -l "$FWDIR/$FWNAME" | grep "${BITCODE_PATTERN}" >/dev/null; then
echo "INFO: $FWDIR contains Bitcode"
else
echo "INFO: $FWNAME.framework contains Bitcode"
echo "INFO: $FWDIR doesn't contain Bitcode"
fi
}
if [ $FWTYPE == "dynamic" ]; then
DEVELOPER=`xcode-select -print-path`
FW_EXEC_NAME="${FWNAME}.framework/${FWNAME}"
INSTALL_NAME="@rpath/${FW_EXEC_NAME}"
COMPAT_VERSION="1.0.0"
CURRENT_VERSION="1.0.0"
RX='([A-z]+)([0-9]+(\.[0-9]+)*)-([A-z0-9]+)\.sdk'
cd bin
for TARGETDIR in `ls -d *.sdk`; do
if [[ $TARGETDIR =~ $RX ]]; then
PLATFORM="${BASH_REMATCH[1]}"
SDKVERSION="${BASH_REMATCH[2]}"
ARCH="${BASH_REMATCH[4]}"
fi
echo "Assembling .dylib for $PLATFORM $SDKVERSION ($ARCH)"
CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
CROSS_SDK="${PLATFORM}${SDKVERSION}.sdk"
SDK="${CROSS_TOP}/SDKs/${CROSS_SDK}"
if [[ $PLATFORM == "AppleTV"* ]]; then
MIN_SDK="-tvos_version_min 9.0"
else
MIN_SDK="-ios_version_min 8.0"
fi
#cd $TARGETDIR
#libtool -dynamic -lSystem $MIN_SDK -syslibroot $SDK -install_name $INSTALL_NAME -compatibility_version $COMPAT_VERSION -current_version $CURRENT_VERSION lib/*.a -o $FWNAME.dylib
TARGETOBJ="${TARGETDIR}/obj"
rm -rf $TARGETOBJ
mkdir $TARGETOBJ
cd $TARGETOBJ
ar -x ../lib/libcrypto.a
ar -x ../lib/libssl.a
cd ..
ld obj/*.o \
-dylib \
-bitcode_bundle \
-lSystem \
-arch $ARCH \
$MIN_SDK \
-syslibroot $SDK \
-compatibility_version $COMPAT_VERSION \
-current_version $CURRENT_VERSION \
-application_extension \
-o $FWNAME.dylib
install_name_tool -id $INSTALL_NAME $FWNAME.dylib
cd ..
done
cd ..
for SYS in ${ALL_SYSTEMS[@]}; do
SYSDIR="$FWROOT/$SYS"
FWDIR="$SYSDIR/$FWNAME.framework"
DYLIBS=(bin/${SYS}*/$FWNAME.dylib)
if [[ ${#DYLIBS[@]} -gt 0 && -e ${DYLIBS[0]} ]]; then
echo "Creating framework for $SYS"
mkdir -p $FWDIR/Headers
lipo -create ${DYLIBS[@]} -output $FWDIR/$FWNAME
cp -r include/$FWNAME/* $FWDIR/Headers/
cp -L assets/$SYS/Info.plist $FWDIR/Info.plist
echo "Created $FWDIR"
check_bitcode $FWDIR
else
echo "Skipped framework for $SYS"
fi
done
rm bin/*/$FWNAME.dylib
else
for SYS in ${ALL_SYSTEMS[@]}; do
SYSDIR="$FWROOT/$SYS"
FWDIR="$SYSDIR/$FWNAME.framework"
if [[ -e lib/libcrypto-$SYS.a && -e lib/libssl-$SYS.a ]]; then
echo "Creating framework for $SYS"
mkdir -p $FWDIR/Headers
libtool -static -o $FWDIR/$FWNAME lib/libcrypto-$SYS.a lib/libssl-$SYS.a
cp -r include/$FWNAME/* $FWDIR/Headers/
cp -L assets/$SYS/Info.plist $FWDIR/Info.plist
echo "Created $FWDIR"
check_bitcode $FWDIR
else
echo "Skipped framework for $SYS"
fi
done
fi

View File

@ -29,12 +29,12 @@ wait ${PID_TARGETS}
# Verify/prepare 1.1.0 build dir
xcrun -sdk iphoneos lipo -info ./lib/*.a | log_output "TARGETS"
../create-openssl-framework.sh | log_output "TARGETS"
xcrun -sdk iphoneos lipo -info openssl.framework/openssl | log_output "TARGETS"
xcrun -sdk iphoneos lipo -info frameworks/iPhone/openssl.framework/openssl | log_output "TARGETS"
cp -r ../OpenSSL-for-* .
# Back to main dir
cd ..
xcrun -sdk iphoneos lipo -info ./lib/*.a | log_output "ARCHS "
./create-openssl-framework.sh | log_output "ARCHS "
xcrun -sdk iphoneos lipo -info openssl.framework/openssl | log_output "ARCHS "
xcrun -sdk iphoneos lipo -info frameworks/iPhone/openssl.framework/openssl | log_output "ARCHS "