From 4f16f7e0bf63b2ccc6d69791be38f05a8155c61b Mon Sep 17 00:00:00 2001 From: Bogdan-Constantin Popescu Date: Tue, 20 Feb 2018 13:46:21 +0100 Subject: [PATCH 1/4] Add safe flags for bash --- build_libcurl_dist.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_libcurl_dist.sh b/build_libcurl_dist.sh index 57c60c4..3bff081 100755 --- a/build_libcurl_dist.sh +++ b/build_libcurl_dist.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -euo pipefail export DEVROOT=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain DFT_DIST_DIR=${HOME}/Desktop/libcurl-ios-dist @@ -24,7 +24,7 @@ function build_for_arch() { ./configure --disable-shared --without-zlib --enable-static --enable-ipv6 ${SSL_FLAG} --host="${HOST}" --prefix=${PREFIX} && make -j8 && make install } -if [ "$1" == "openssl" ] +if [ "${1:-''}" == "openssl" ] then if [ ! -d ${HOME}/Desktop/openssl-ios-dist ] then From 248684a69512935aefd01ad2d9c3632c01a81f09 Mon Sep 17 00:00:00 2001 From: Bogdan-Constantin Popescu Date: Tue, 20 Feb 2018 13:45:18 +0100 Subject: [PATCH 2/4] Use "xcode-select -p" instead of absolute path --- build_libcurl_dist.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/build_libcurl_dist.sh b/build_libcurl_dist.sh index 3bff081..c06cee1 100755 --- a/build_libcurl_dist.sh +++ b/build_libcurl_dist.sh @@ -1,6 +1,7 @@ #!/bin/bash -euo pipefail -export DEVROOT=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain +readonly XCODE_DEV="$(xcode-select -p)" +export DEVROOT="${XCODE_DEV}/Toolchains/XcodeDefault.xctoolchain" DFT_DIST_DIR=${HOME}/Desktop/libcurl-ios-dist DIST_DIR=${DIST_DIR:-$DFT_DIST_DIR} @@ -39,11 +40,11 @@ fi TMP_DIR=/tmp/build_libcurl_$$ -#build_for_arch i386 i386-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/i386 || exit 1 -build_for_arch x86_64 x86_64-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/x86_64 || exit 2 -build_for_arch arm64 arm-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/arm64 || exit 3 -build_for_arch armv7s armv7s-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7s || exit 4 -build_for_arch armv7 armv7-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7 || exit 5 +#build_for_arch i386 i386-apple-darwin ${XCODE_DEV}/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/i386 || exit 1 +build_for_arch x86_64 x86_64-apple-darwin ${XCODE_DEV}/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/x86_64 || exit 2 +build_for_arch arm64 arm-apple-darwin ${XCODE_DEV}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/arm64 || exit 3 +build_for_arch armv7s armv7s-apple-darwin ${XCODE_DEV}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7s || exit 4 +build_for_arch armv7 armv7-apple-darwin ${XCODE_DEV}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7 || exit 5 mkdir -p ${TMP_DIR}/lib/ ${DEVROOT}/usr/bin/lipo \ From 1ac35faa842815380c447f19abd4cda1f72f96be Mon Sep 17 00:00:00 2001 From: Bogdan-Constantin Popescu Date: Tue, 20 Feb 2018 14:27:03 +0100 Subject: [PATCH 3/4] Unconmment build for i386 --- build_libcurl_dist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_libcurl_dist.sh b/build_libcurl_dist.sh index c06cee1..af6ac64 100755 --- a/build_libcurl_dist.sh +++ b/build_libcurl_dist.sh @@ -40,7 +40,7 @@ fi TMP_DIR=/tmp/build_libcurl_$$ -#build_for_arch i386 i386-apple-darwin ${XCODE_DEV}/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/i386 || exit 1 +build_for_arch i386 i386-apple-darwin ${XCODE_DEV}/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/i386 || exit 1 build_for_arch x86_64 x86_64-apple-darwin ${XCODE_DEV}/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/x86_64 || exit 2 build_for_arch arm64 arm-apple-darwin ${XCODE_DEV}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/arm64 || exit 3 build_for_arch armv7s armv7s-apple-darwin ${XCODE_DEV}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7s || exit 4 From 352ebab9e31600d1ea193cdc8c62938965cd37de Mon Sep 17 00:00:00 2001 From: Bogdan-Constantin Popescu Date: Tue, 20 Feb 2018 13:55:10 +0100 Subject: [PATCH 4/4] Replace indentation tabs with spaces This commit is changing a few lines indented using tabs. The file was mainly using spaces for indenting, except for some lines. --- build_libcurl_dist.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build_libcurl_dist.sh b/build_libcurl_dist.sh index af6ac64..8eef757 100755 --- a/build_libcurl_dist.sh +++ b/build_libcurl_dist.sh @@ -48,11 +48,11 @@ build_for_arch armv7 armv7-apple-darwin ${XCODE_DEV}/Platforms/iPhoneOS.platform mkdir -p ${TMP_DIR}/lib/ ${DEVROOT}/usr/bin/lipo \ - -arch x86_64 ${TMP_DIR}/x86_64/lib/libcurl.a \ - -arch armv7 ${TMP_DIR}/armv7/lib/libcurl.a \ - -arch armv7s ${TMP_DIR}/armv7s/lib/libcurl.a \ - -arch arm64 ${TMP_DIR}/arm64/lib/libcurl.a \ - -output ${TMP_DIR}/lib/libcurl.a -create + -arch x86_64 ${TMP_DIR}/x86_64/lib/libcurl.a \ + -arch armv7 ${TMP_DIR}/armv7/lib/libcurl.a \ + -arch armv7s ${TMP_DIR}/armv7s/lib/libcurl.a \ + -arch arm64 ${TMP_DIR}/arm64/lib/libcurl.a \ + -output ${TMP_DIR}/lib/libcurl.a -create cp -r ${TMP_DIR}/arm64/include ${TMP_DIR}/