Created
March 12, 2019 15:21
-
-
Save thejeff77/2279e9320e56d781e110ebd9e0825a0f to your computer and use it in GitHub Desktop.
Example Mac Xcode OpenSSL build & compile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
#Last update: June 2016 | |
echo "===============================" | |
echo "======Configuring OpenSSL======" | |
echo "===============================" | |
git clone https://github.com/openssl/openssl.git | |
if [ $? -eq 0 ] | |
then | |
echo "Successfully cloned openssl" | |
elif [ $? -eq 128 ] || [ $? -eq 1 ] | |
then | |
echo "Openssl directory already exists, removing and re-cloning." | |
sudo rm -rf openssl | |
git clone https://github.com/openssl/openssl.git | |
else | |
echo $? | |
echo "Unsupported error cloning openssl repo, cleaning up the openssl directory" | |
sudo rm -rf openssl | |
exit 1 | |
fi | |
git clone https://github.com/sqlcipher/openssl-xcode.git | |
if [ $? -eq 0 ] | |
then | |
echo "Successfully cloned openssl-xcode" | |
elif [ $? -eq 128 ] || [ $? -eq 1 ] | |
then | |
echo "Openssl-xcode directory already exists, removing and re-cloning." | |
sudo rm -rf openssl-xcode | |
git clone https://github.com/sqlcipher/openssl-xcode.git | |
else | |
echo $? | |
echo "Unsupported error cloning openssl-xcode repo, removing the openssl-xcode directory" | |
sudo rm -rf openssl-xcode | |
exit 1 | |
fi | |
cp -r openssl-xcode/openssl.xcodeproj openssl | |
pushd openssl | |
git checkout tags/OpenSSL_1_0_1f #replace this with a newer version as available | |
sed -ie 's/\(ONLY_ACTIVE_ARCH.*\)YES/\1NO/' openssl.xcodeproj/project.pbxproj | |
echo $? | |
echo "" | |
echo "==============================================================" | |
echo "Successfully grabbed dependencies, starting build in 5 seconds" | |
echo "==============================================================" | |
sleep 1 | |
echo "." | |
sleep 1 | |
echo ".." | |
sleep 1 | |
echo "..." | |
sleep 1 | |
echo "...." | |
sleep 1 | |
echo ".....starting" | |
sleep 1 | |
xcodebuild -configuration Release -sdk iphonesimulator | |
if [ $? -eq 0 ] | |
then | |
echo "Successfully built openssl for Release iphonesimulator configuration" | |
else | |
echo "Failed to build openssl for Release iphonesimulator configuration" | |
exit 1 | |
fi | |
xcodebuild -configuration Release -sdk iphoneos | |
if [ $? -eq 0 ] | |
then | |
echo "Successfully built openssl for Release iphoneos configuration" | |
else | |
echo "Failed to build openssl for Release iphoneos configuration" | |
exit 1 | |
fi | |
xcodebuild -configuration Release | |
if [ $? -eq 0 ] | |
then | |
echo "Successfully built openssl for Release configuration" | |
else | |
echo "Failed to build openssl for Release configuration" | |
exit 1 | |
fi | |
xcodebuild -configuration Debug -sdk iphonesimulator | |
if [ $? -eq 0 ] | |
then | |
echo "Successfully built openssl for Debug iphonesimulator configuration" | |
else | |
echo "Failed to build openssl for Debug iphonesimulator configuration" | |
exit 1 | |
fi | |
xcodebuild -configuration Debug -sdk iphoneos | |
if [ $? -eq 0 ] | |
then | |
echo "Successfully built openssl for Debug iphoneos configuration" | |
else | |
echo "Failed to build openssl for Debug iphoneos configuration" | |
exit 1 | |
fi | |
xcodebuild -configuration Debug | |
if [ $? -eq 0 ] | |
then | |
echo "Successfully built openssl for Debug configuration" | |
else | |
echo "Failed to build openssl for Debug configuration" | |
exit 1 | |
fi | |
popd | |
sudo rm -rf openssl-xcode | |
echo "===========================================================" | |
echo "Successfully built openssl for all required configurations!" | |
echo "===========================================================" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment