Script for building OpenSSL

This commit is contained in:
Felix Schulze 2010-12-16 20:08:02 +01:00
parent d405190e35
commit 04a1f49878
4 changed files with 123 additions and 1573 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,178 +0,0 @@
// !$*UTF8*$!
{
1D3623240D0F684500981E51 /* OpenSSL_for_iOSAppDelegate.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {646, 618}}";
sepNavSelRange = "{157, 0}";
sepNavVisRange = "{0, 748}";
};
};
1D3623250D0F684500981E51 /* OpenSSL_for_iOSAppDelegate.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {803, 1820}}";
sepNavSelRange = "{161, 0}";
sepNavVisRange = "{0, 1211}";
};
};
1D6058900D05DD3D006BFB54 /* OpenSSL-for-iOS */ = {
activeExec = 0;
executables = (
2AA51BAD12AA7F3400AEA776 /* OpenSSL-for-iOS */,
);
};
29B97313FDCFA39411CA2CEA /* Project object */ = {
activeBuildConfigurationName = Debug;
activeExecutable = 2AA51BAD12AA7F3400AEA776 /* OpenSSL-for-iOS */;
activeSDKPreference = iphonesimulator4.2;
activeTarget = 1D6058900D05DD3D006BFB54 /* OpenSSL-for-iOS */;
addToTargets = (
1D6058900D05DD3D006BFB54 /* OpenSSL-for-iOS */,
);
codeSenseManager = 2AA51BBD12AA7F3700AEA776 /* Code sense */;
executables = (
2AA51BAD12AA7F3400AEA776 /* OpenSSL-for-iOS */,
);
perUserDictionary = {
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
468,
20,
48,
43,
43,
20,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
PBXFileDataSource_Target_ColumnID,
);
};
PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
428,
60,
20,
48,
43,
43,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXTargetDataSource_PrimaryAttribute,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
);
};
PBXPerProjectTemplateStateSaveDate = 313164984;
PBXWorkspaceStateSaveDate = 313164984;
};
perUserProjectItems = {
2A1A6E0512AA84C000E4B343 /* PBXTextBookmark */ = 2A1A6E0512AA84C000E4B343 /* PBXTextBookmark */;
2A1A6E0612AA84C000E4B343 /* PBXTextBookmark */ = 2A1A6E0612AA84C000E4B343 /* PBXTextBookmark */;
2A1A6E1912AA851C00E4B343 /* PBXTextBookmark */ = 2A1A6E1912AA851C00E4B343 /* PBXTextBookmark */;
2A28EE7212AA849800C0D35A /* PlistBookmark */ = 2A28EE7212AA849800C0D35A /* PlistBookmark */;
};
sourceControlManager = 2AA51BBC12AA7F3700AEA776 /* Source Control */;
userBuildSettings = {
};
};
2A1A6E0512AA84C000E4B343 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 1D3623250D0F684500981E51 /* OpenSSL_for_iOSAppDelegate.m */;
name = "OpenSSL_for_iOSAppDelegate.m: 8";
rLen = 0;
rLoc = 161;
rType = 0;
vrLen = 1211;
vrLoc = 0;
};
2A1A6E0612AA84C000E4B343 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 1D3623240D0F684500981E51 /* OpenSSL_for_iOSAppDelegate.h */;
name = "OpenSSL_for_iOSAppDelegate.h: 6";
rLen = 0;
rLoc = 157;
rType = 0;
vrLen = 748;
vrLoc = 0;
};
2A1A6E1912AA851C00E4B343 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 1D3623240D0F684500981E51 /* OpenSSL_for_iOSAppDelegate.h */;
name = "OpenSSL_for_iOSAppDelegate.h: 6";
rLen = 0;
rLoc = 157;
rType = 0;
vrLen = 748;
vrLoc = 0;
};
2A28EE7212AA849800C0D35A /* PlistBookmark */ = {
isa = PlistBookmark;
fRef = 8D1107310486CEB800E47090 /* OpenSSL_for_iOS-Info.plist */;
fallbackIsa = PBXBookmark;
isK = 0;
kPath = (
);
name = "/Users/x2on/Projects/iPhone/OpenSSL-for-iOS/OpenSSL_for_iOS-Info.plist";
rLen = 0;
rLoc = 9223372036854775808;
};
2AA51BAD12AA7F3400AEA776 /* OpenSSL-for-iOS */ = {
isa = PBXExecutable;
activeArgIndices = (
);
argumentStrings = (
);
autoAttachOnCrash = 1;
breakpointsEnabled = 0;
configStateDict = {
};
customDataFormattersEnabled = 1;
dataTipCustomDataFormattersEnabled = 1;
dataTipShowTypeColumn = 1;
dataTipSortType = 0;
debuggerPlugin = GDBDebugging;
disassemblyDisplayState = 0;
dylibVariantSuffix = "";
enableDebugStr = 1;
environmentEntries = (
);
executableSystemSymbolLevel = 0;
executableUserSymbolLevel = 0;
libgmallocEnabled = 0;
name = "OpenSSL-for-iOS";
savedGlobals = {
};
showTypeColumn = 0;
sourceDirectories = (
);
};
2AA51BBC12AA7F3700AEA776 /* Source Control */ = {
isa = PBXSourceControlManager;
fallbackIsa = XCSourceControlManager;
isSCMEnabled = 0;
scmConfiguration = {
repositoryNamesForRoots = {
"" = "";
};
};
};
2AA51BBD12AA7F3700AEA776 /* Code sense */ = {
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
}

1
README
View File

@ -1,5 +1,6 @@
From: http://www.x2on.de/2010/02/01/tutorial-iphone-app-with-compiled-openssl-library/ and http://www.x2on.de/2010/07/13/tutorial-iphone-app-with-compiled-openssl-1-0-0a-library/
UPDATE 2010-12-16: Script for building OpenSSL
UPDATE 2010-12-04: SHA256 Hash + Clean project file with iOS 4.2 as base SDK
UPDATE 2010-12-04: I habe updated OpemSSL to 1.0.0c
UPDATE 2010-11-16: I have updated OpenSSL to 1.0.0b

122
build-libssl.sh Executable file
View File

@ -0,0 +1,122 @@
#!/bin/sh
# Automatic build script for libssl and libcrypto
# for iPhoneOS and iPhoneSimulator
#
# Created by Felix Schulze on 16.12.10.
# Copyright 2010 Felix Schulze. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###########################################################################
# Change values here #
# #
VERSION="1.0.0c" #
SDKVERSION="4.2" #
# #
###########################################################################
# #
# Don't change anything under this line! #
# #
###########################################################################
CURRENTPATH=`pwd`
set -e
if [ ! -e openssl-${VERSION}.tar.gz ]; then
echo "Downloading openssl-${VERSION}.tar.gz"
curl -O http://www.openssl.org/source/openssl-${VERSION}.tar.gz
else
echo "Using openssl-${VERSION}.tar.gz"
fi
mkdir -p "${CURRENTPATH}/src"
tar zxf openssl-${VERSION}.tar.gz -C "${CURRENTPATH}/src"
cd "${CURRENTPATH}/src/openssl-${VERSION}"
############
# iPhone Simulator
echo "Building openssl for iPhoneSimulator ${SDKVERSION} i386"
echo "Please stand by..."
export CC="/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386"
mkdir -p "${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}.sdk"
LOG="${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}.sdk/build-openssl-${VERSION}.log"
./configure BSD-generic32 --openssldir="${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}.sdk" > "${LOG}" 2>&1
# add -isysroot to CC=
sed -ie "s!^CFLAG=!CFLAG=-isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator${SDKVERSION}.sdk !" "Makefile"
make >> "${LOG}" 2>&1
make install >> "${LOG}" 2>&1
make clean >> "${LOG}" 2>&1
#############
#############
# iPhoneOS armv6
echo "Building openssl for iPhoneOS ${SDKVERSION} armv6"
echo "Please stand by..."
export CC="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv6"
mkdir -p "${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv6.sdk"
LOG="${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv6.sdk/build-openssl-${VERSION}.log"
./configure BSD-generic32 --openssldir="${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv6.sdk" > "${LOG}" 2>&1
sed -ie "s!^CFLAG=!CFLAG=-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVERSION}.sdk !" "Makefile"
# remove sig_atomic for iPhoneOS
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
make >> "${LOG}" 2>&1
make install >> "${LOG}" 2>&1
make clean >> "${LOG}" 2>&1
#############
#############
# iPhoneOS armv7
echo "Building openssl for iPhoneOS ${SDKVERSION} armv7"
echo "Please stand by..."
export CC="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv7"
mkdir -p "${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk"
LOG="${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk/build-openssl-${VERSION}.log"
./configure BSD-generic32 --openssldir="${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk" >> "${LOG}" 2>&1
sed -ie "s!^CFLAG=!CFLAG=-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVERSION}.sdk !" "Makefile"
# remove sig_atomic for iPhoneOS
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
make >> "${LOG}" 2>&1
make install >> "${LOG}" 2>&1
make clean >> "${LOG}" 2>&1
#############
echo "Build library..."
lipo -create ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}.sdk/lib/libssl.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv6.sdk/lib/libssl.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk/lib/libssl.a -output ${CURRENTPATH}/libssl.a
lipo -create ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}.sdk/lib/libcrypto.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv6.sdk/lib/libcrypto.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk/lib/libcrypto.a -output ${CURRENTPATH}/libcrypto.a
mkdir -p ${CURRENTPATH}/include
cp -R ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}.sdk/include/openssl ${CURRENTPATH}/include/
echo "Building done."
echo "Cleaning up..."
rm -rf ${CURRENTPATH}/src
rm -rf ${CURRENTPATH}/bin
echo "Done."