Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 286887d

Browse files
committed
Adapted for use with a source tarball
1 parent a3791db commit 286887d

File tree

2 files changed

+46
-91
lines changed

2 files changed

+46
-91
lines changed

README

+36-12
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,58 @@
1-
== openssl-xcode ==
1+
openssl-xcode
2+
=============
23

34
This is an XCode project skeleton structure that can be used to build a static
45
libcrypto.a library for use in Mac and iPhone projects.
56

67
It is specifically intended for use in building secure iPhone
7-
applications alongside SQLCipher (http://www.zetetic.net/software/sqlcipher).
8+
applications alongside [SQLCipher](http://www.zetetic.net/software/sqlcipher).
89

910
openssl-xcode was developed by Stephen Lombardo at Zetetic LLC.
1011

11-
sjlombardo at zetetic.net
12+
sjlombardo at zetetic.net
1213
http://www.zetetic.net
14+
15+
It was adapted for use with source archives by Michael Tyson of
16+
A Tasty Pixel (michael at atastypixel.com)
1317

14-
[ Usage ]
18+
Usage
19+
-----
1520

1621
In a normal case you would use it thusly:
1722

18-
1. download the OpenSSL source code directly from
23+
1. Download the OpenSSL source code directly from
1924
http://www.openssl.org/source/
20-
2. Tar an unzip the archive and move it to your desired build location
21-
3. Clone the openssl-xcode git repo to make a local copy
22-
4. Copy or move openssl.xcodeproj into the OpenSSL source directory
23-
5. Open openssl.xcodeproj in xcode and initiate a build
25+
2. Clone the openssl-xcode git repo to make a local copy
26+
3. Put the downloaded OpenSSL source tar.gz into the same folder
27+
as openssl.xcodeproj.
28+
The extracted OpenSSL distribution can also be placed in a folder called 'openssl'
29+
within the same folder as openssl.xcodeproj, or just extracted within the
30+
same folder as openssl.xcodeproj.
31+
32+
Then, either open openssl.xcodeproj in XCode and initiate a build, or integrate
33+
it within another project:
34+
35+
1. Drag the openssl.xcodeproj file into your main project
36+
2. Right-click on your project target, and add openssl.xcodeproj under "Direct
37+
Dependencies" on the General tab.
38+
3. On the Build tab for your project's target, find the "Header Search Paths"
39+
option, and add the path:
40+
> `$(SRCROOT)/Library/openssl/build/openssl.build/openssl/include`
41+
42+
(Assuming you've put openssl.xcodeproj at the path Library/openssl, and are
43+
building from a source tarball)
44+
4. Expand your target's "Link Binary With Libraries" build stage, and drag
45+
libcrypto.a from the openssl.xcodeproj group.
46+
2447

2548
This project actually relies on the OpenSSL configure and make
26-
system to build the libraries. However, it does attemt to automatically
49+
system to build the libraries. However, it does attempt to automatically
2750
detect and use the appropriate build settings for arch (i386/ppc/armv6),
28-
build tools, and SDK directories. This makes it approprate for inclusion
51+
build tools, and SDK directories. This makes it appropriate for inclusion
2952
as a project reference into an iPhone application project.
3053

31-
[ License ]
54+
License
55+
-------
3256

3357
Copyright (c) 2009, ZETETIC LLC
3458
All rights reserved.

openssl.xcodeproj/project.pbxproj

+10-79
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,10 @@
66
objectVersion = 42;
77
objects = {
88

9-
/* Begin PBXAggregateTarget section */
10-
9069D13C0FCE35730042E34C /* make */ = {
11-
isa = PBXAggregateTarget;
12-
buildConfigurationList = 9069D13F0FCE35910042E34C /* Build configuration list for PBXAggregateTarget "make" */;
13-
buildPhases = (
14-
9069D13B0FCE35730042E34C /* ShellScript */,
15-
);
16-
dependencies = (
17-
);
18-
name = make;
19-
productName = libcrypto.a;
20-
};
21-
/* End PBXAggregateTarget section */
22-
23-
/* Begin PBXContainerItemProxy section */
24-
9069D2920FCE65A70042E34C /* PBXContainerItemProxy */ = {
25-
isa = PBXContainerItemProxy;
26-
containerPortal = 9069D12F0FCE340B0042E34C /* Project object */;
27-
proxyType = 1;
28-
remoteGlobalIDString = 9069D13C0FCE35730042E34C;
29-
remoteInfo = make;
30-
};
31-
/* End PBXContainerItemProxy section */
32-
339
/* Begin PBXFileReference section */
3410
9069D28C0FCE659A0042E34C /* libcrypto.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcrypto.a; sourceTree = BUILT_PRODUCTS_DIR; };
3511
/* End PBXFileReference section */
3612

37-
/* Begin PBXFrameworksBuildPhase section */
38-
9069D28A0FCE659A0042E34C /* Frameworks */ = {
39-
isa = PBXFrameworksBuildPhase;
40-
buildActionMask = 2147483647;
41-
files = (
42-
);
43-
runOnlyForDeploymentPostprocessing = 0;
44-
};
45-
/* End PBXFrameworksBuildPhase section */
46-
4713
/* Begin PBXGroup section */
4814
9069D12D0FCE340B0042E34C = {
4915
isa = PBXGroup;
@@ -67,12 +33,11 @@
6733
isa = PBXNativeTarget;
6834
buildConfigurationList = 9069D2980FCE65C10042E34C /* Build configuration list for PBXNativeTarget "crypto" */;
6935
buildPhases = (
70-
9069D28A0FCE659A0042E34C /* Frameworks */,
36+
27558DB412CE64BC00692BA9 /* ShellScript */,
7137
);
7238
buildRules = (
7339
);
7440
dependencies = (
75-
9069D2930FCE65A70042E34C /* PBXTargetDependency */,
7641
);
7742
name = crypto;
7843
productName = crypto;
@@ -86,43 +51,39 @@
8651
isa = PBXProject;
8752
buildConfigurationList = 9069D1320FCE340B0042E34C /* Build configuration list for PBXProject "openssl" */;
8853
compatibilityVersion = "Xcode 2.4";
54+
developmentRegion = English;
8955
hasScannedForEncodings = 0;
56+
knownRegions = (
57+
English,
58+
Japanese,
59+
French,
60+
German,
61+
);
9062
mainGroup = 9069D12D0FCE340B0042E34C;
9163
projectDirPath = "";
9264
projectRoot = "";
9365
targets = (
94-
9069D13C0FCE35730042E34C /* make */,
9566
9069D28B0FCE659A0042E34C /* crypto */,
9667
);
9768
};
9869
/* End PBXProject section */
9970

10071
/* Begin PBXShellScriptBuildPhase section */
101-
9069D13B0FCE35730042E34C /* ShellScript */ = {
72+
27558DB412CE64BC00692BA9 /* ShellScript */ = {
10273
isa = PBXShellScriptBuildPhase;
10374
buildActionMask = 2147483647;
10475
files = (
10576
);
10677
inputPaths = (
107-
"$(SRCROOT)/Makefile",
10878
);
10979
outputPaths = (
110-
"$(BUILT_PRODUCTS_DIR)/libcrypto.a",
11180
);
11281
runOnlyForDeploymentPostprocessing = 0;
11382
shellPath = /bin/sh;
114-
shellScript = "set\n\nif [ \"$SDKROOT\" != \"\" ]; then\n\tISYSROOT=\"-isysroot $SDKROOT\"\nfi\n\nOPENSSL_OPTIONS=\"no-krb5 no-gost\"\n\n## this is a universal build\nif [ \"$ARCHS_STANDARD_32_BIT\" = \"i386 ppc\" ]; then\n\n\tmkdir -p temp-universal\n\t\n\tBUILDARCH=\"ppc\"\n\techo \"***** BUILDING UNIVERSAL ARCH $BUILDARCH ******\"\n\tmake clean\n\t./config no-asm $OPENSSL_OPTIONS -openssldir=\"$BUILD_DIR\"\n\tASM_DEF=\"-UOPENSSL_BN_ASM_PART_WORDS\"\n\tmake CC=$PLATFORM_DEVELOPER_BIN_DIR/gcc-4.2 CFLAG=\"-D_DARWIN_C_SOURCE $ASM_DEF -arch $BUILDARCH $ISYSROOT\" SHARED_LDFLAGS=\"-arch $BUILDARCH -dynamiclib\"\n\tcp libcrypto.a temp-universal/$BUILDARCH-libcrypto.a\n\tcp libssl.a temp-universal/$BUILDARCH-libssl.a\n\t\n\tBUILDARCH=\"i386\"\n\techo \"***** BUILDING UNIVERSAL ARCH $BUILDARCH ******\"\n\tmake clean\n\t./config $OPENSSL_OPTIONS -openssldir=\"$BUILD_DIR\"\n\tASM_DEF=\"-DOPENSSL_BN_ASM_PART_WORDS\"\n\tmake CC=$PLATFORM_DEVELOPER_BIN_DIR/gcc-4.2 CFLAG=\"-D_DARWIN_C_SOURCE $ASM_DEF -arch $BUILDARCH $ISYSROOT\" SHARED_LDFLAGS=\"-arch $BUILDARCH -dynamiclib\"\n\tcp libcrypto.a temp-universal/$BUILDARCH-libcrypto.a\n\tcp libssl.a temp-universal/$BUILDARCH-libssl.a\n\n\tlipo -create temp-universal/*-libcrypto.a -output libcrypto.a\n \tlipo -create temp-universal/*-libssl.a -output libssl.a\nelse\n\tBUILDARCH=$ARCHS\n\techo \"***** BUILDING ARCH $BUILDARCH ******\"\n\tmake clean\n\n\tif [ \"$BUILDARCH\" = \"i386\" ]; then\n\t\t./config $OPENSSL_OPTIONS -openssldir=\"$BUILD_DIR\"\n\t\tASM_DEF=\"-DOPENSSL_BN_ASM_PART_WORDS\"\n else\n\t\t./config no-asm $OPENSSL_OPTIONS -openssldir=\"$BUILD_DIR\"\n\t\tASM_DEF=\"-UOPENSSL_BN_ASM_PART_WORDS\"\n fi\n\tmake CC=$PLATFORM_DEVELOPER_BIN_DIR/gcc-4.2 CFLAG=\"-D_DARWIN_C_SOURCE $ASM_DEF -arch $BUILDARCH $ISYSROOT\" SHARED_LDFLAGS=\"-arch $BUILDARCH -dynamiclib\"\nfi\n\nranlib libcrypto.a \nranlib libssl.a\ncp libcrypto.a libssl.a \"$BUILT_PRODUCTS_DIR\"\nexit 0";
83+
shellScript = "if [ -f \"$CONFIGURATION_BUILD_DIR/libcrypto.a\" ]; then\n\texit 0;\nfi\n\nOPENSSL_SRCROOT=\"$SRCROOT/openssl\"\nif [ ! -d \"$OPENSSL_SRCROOT\" ]; then\n OPENSSL_SRCROOT=\"$SRCROOT\"\nfi;\n\nSRC_ARCHIVE=`ls openssl*tar.gz 2>/dev/null`\nif [ -f \"$SRC_ARCHIVE\" ]; then\n\tOPENSSL_SRCROOT=\"$PROJECT_TEMP_DIR/openssl\"\n\tif [ ! -d \"$OPENSSL_SRCROOT\" ]; then\n\t\techo \"Extracting $SRC_ARCHIVE...\"\n\t\tmkdir \"$OPENSSL_SRCROOT\"\n\t\ttar -C \"$OPENSSL_SRCROOT\" --strip-components=1 -zxf \"$SRC_ARCHIVE\" || exit 1\n\t\tcp -RL \"$OPENSSL_SRCROOT/include\" \"$CONFIGURATION_BUILD_DIR\"\n\tfi\nfi\n\nif [ \"$SDKROOT\" != \"\" ]; then\n\tISYSROOT=\"-isysroot $SDKROOT\"\nfi\n\nOPENSSL_OPTIONS=\"no-krb5 no-gost\"\n\ncd \"$OPENSSL_SRCROOT\"\n\n## this is a universal build\nif [ \"$ARCHS_STANDARD_32_BIT\" = \"i386 ppc\" ]; then\n\n\tBUILDARCH=\"ppc\"\n\techo \"***** BUILDING UNIVERSAL ARCH $BUILDARCH ******\"\n\tmake clean\n\t./config no-asm $OPENSSL_OPTIONS -openssldir=\"$BUILD_DIR\"\n\tASM_DEF=\"-UOPENSSL_BN_ASM_PART_WORDS\"\n\tmake CC=$PLATFORM_DEVELOPER_BIN_DIR/gcc-4.2 CFLAG=\"-D_DARWIN_C_SOURCE $ASM_DEF -arch $BUILDARCH $ISYSROOT\" SHARED_LDFLAGS=\"-arch $BUILDARCH -dynamiclib\"\n\tcp libcrypto.a \"$CONFIGURATION_TEMP_DIR\"/$BUILDARCH-libcrypto.a\n\tcp libssl.a \"$CONFIGURATION_TEMP_DIR\"/$BUILDARCH-libssl.a\n\t\n\tBUILDARCH=\"i386\"\n\techo \"***** BUILDING UNIVERSAL ARCH $BUILDARCH ******\"\n\tmake clean\n\t./config $OPENSSL_OPTIONS -openssldir=\"$BUILD_DIR\"\n\tASM_DEF=\"-DOPENSSL_BN_ASM_PART_WORDS\"\n\tmake CC=$PLATFORM_DEVELOPER_BIN_DIR/gcc-4.2 CFLAG=\"-D_DARWIN_C_SOURCE $ASM_DEF -arch $BUILDARCH $ISYSROOT\" SHARED_LDFLAGS=\"-arch $BUILDARCH -dynamiclib\"\n\tcp libcrypto.a \"$CONFIGURATION_TEMP_DIR\"/$BUILDARCH-libcrypto.a\n\tcp libssl.a \"$CONFIGURATION_TEMP_DIR\"/$BUILDARCH-libssl.a\n\tmkdir -p \"$CONFIGURATION_BUILD_DIR\"\n\tlipo -create \"$CONFIGURATION_TEMP_DIR\"/*-libcrypto.a -output \"$CONFIGURATION_BUILD_DIR/libcrypto.a\"\n \tlipo -create \"$CONFIGURATION_TEMP_DIR\"/*-libssl.a -output \"$CONFIGURATION_BUILD_DIR/libssl.a\"\nelse\n\tBUILDARCH=$ARCHS\n\techo \"***** BUILDING ARCH $BUILDARCH ******\"\n\tmake clean\n\n\tif [ \"$BUILDARCH\" = \"i386\" ]; then\n\t\t./config $OPENSSL_OPTIONS -openssldir=\"$BUILD_DIR\"\n\t\tASM_DEF=\"-DOPENSSL_BN_ASM_PART_WORDS\"\n else\n\t\t./config no-asm $OPENSSL_OPTIONS -openssldir=\"$BUILD_DIR\"\n\t\tASM_DEF=\"-UOPENSSL_BN_ASM_PART_WORDS\"\n fi\n\tmake CC=$PLATFORM_DEVELOPER_BIN_DIR/gcc-4.2 CFLAG=\"-D_DARWIN_C_SOURCE $ASM_DEF -arch $BUILDARCH $ISYSROOT\" SHARED_LDFLAGS=\"-arch $BUILDARCH -dynamiclib\"\n\tmkdir -p \"$CONFIGURATION_BUILD_DIR\"\n\tcp libcrypto.a \"$CONFIGURATION_BUILD_DIR\"\n\tcp libssl.a \"$CONFIGURATION_BUILD_DIR\"\nfi\n\nranlib \"$CONFIGURATION_BUILD_DIR/libcrypto.a\"\nranlib \"$CONFIGURATION_BUILD_DIR/libssl.a\"";
11584
};
11685
/* End PBXShellScriptBuildPhase section */
11786

118-
/* Begin PBXTargetDependency section */
119-
9069D2930FCE65A70042E34C /* PBXTargetDependency */ = {
120-
isa = PBXTargetDependency;
121-
target = 9069D13C0FCE35730042E34C /* make */;
122-
targetProxy = 9069D2920FCE65A70042E34C /* PBXContainerItemProxy */;
123-
};
124-
/* End PBXTargetDependency section */
125-
12687
/* Begin XCBuildConfiguration section */
12788
9069D1300FCE340B0042E34C /* Debug */ = {
12889
isa = XCBuildConfiguration;
@@ -138,27 +99,6 @@
13899
};
139100
name = Release;
140101
};
141-
9069D13D0FCE35730042E34C /* Debug */ = {
142-
isa = XCBuildConfiguration;
143-
buildSettings = {
144-
COPY_PHASE_STRIP = NO;
145-
GCC_DYNAMIC_NO_PIC = NO;
146-
GCC_OPTIMIZATION_LEVEL = 0;
147-
PRODUCT_NAME = libcrypto.a;
148-
};
149-
name = Debug;
150-
};
151-
9069D13E0FCE35730042E34C /* Release */ = {
152-
isa = XCBuildConfiguration;
153-
buildSettings = {
154-
COPY_PHASE_STRIP = YES;
155-
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
156-
GCC_ENABLE_FIX_AND_CONTINUE = NO;
157-
PRODUCT_NAME = libcrypto.a;
158-
ZERO_LINK = NO;
159-
};
160-
name = Release;
161-
};
162102
9069D28D0FCE659B0042E34C /* Debug */ = {
163103
isa = XCBuildConfiguration;
164104
buildSettings = {
@@ -201,15 +141,6 @@
201141
defaultConfigurationIsVisible = 0;
202142
defaultConfigurationName = Release;
203143
};
204-
9069D13F0FCE35910042E34C /* Build configuration list for PBXAggregateTarget "make" */ = {
205-
isa = XCConfigurationList;
206-
buildConfigurations = (
207-
9069D13D0FCE35730042E34C /* Debug */,
208-
9069D13E0FCE35730042E34C /* Release */,
209-
);
210-
defaultConfigurationIsVisible = 0;
211-
defaultConfigurationName = Release;
212-
};
213144
9069D2980FCE65C10042E34C /* Build configuration list for PBXNativeTarget "crypto" */ = {
214145
isa = XCConfigurationList;
215146
buildConfigurations = (

0 commit comments

Comments
 (0)