Merge changes from upstream/master

This commit is contained in:
Anton Tieleman 2016-09-18 11:26:46 +02:00
commit 40f636f7f9
2 changed files with 66 additions and 32 deletions

View File

@ -1,7 +1,7 @@
osx_image: xcode7.3 osx_image: xcode7.3
language: objective-c language: objective-c
before_install: before_install:
- ./build-libssl.sh verbose - ./build-libssl.sh verbose-on-error
- xcrun -sdk iphoneos lipo -info ./lib/*.a - xcrun -sdk iphoneos lipo -info ./lib/*.a
- ./create-openssl-framework.sh - ./create-openssl-framework.sh
- xcrun -sdk iphoneos lipo -info openssl.framework/openssl - xcrun -sdk iphoneos lipo -info openssl.framework/openssl

View File

@ -42,12 +42,38 @@ spinner()
local spinstr='|/-\' local spinstr='|/-\'
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
local temp=${spinstr#?} local temp=${spinstr#?}
printf " [%c] " "$spinstr" printf " [%c]" "$spinstr"
local spinstr=$temp${spinstr%"$temp"} local spinstr=$temp${spinstr%"$temp"}
sleep $delay sleep $delay
printf "\b\b\b\b\b\b" printf "\b\b\b\b"
done done
printf " \b\b\b\b" printf " \b\b"
wait $pid
return $?
}
# Check for error status
check_status()
{
local STATUS=$1
local COMMAND=$2
echo "\n"
if [ "${STATUS}" != 0 ]; then
if [[ "${LOG_VERBOSE}" != "verbose"* ]]; then
echo "Problem during ${COMMAND} - Please check ${LOG}"
fi
# Dump last 500 lines from log file for verbose-on-error
if [ "${LOG_VERBOSE}" == "verbose-on-error" ]; then
echo "Problem during ${COMMAND} - Dumping last 500 lines from log file"
echo
tail -n 500 "${LOG}"
fi
exit 1
fi
} }
CURRENTPATH=`pwd` CURRENTPATH=`pwd`
@ -55,6 +81,7 @@ ARCHS="x86_64 i386 arm64 armv7s armv7 tv_x86_64 tv_arm64"
DEVELOPER=`xcode-select -print-path` DEVELOPER=`xcode-select -print-path`
IOS_MIN_SDK_VERSION="7.0" IOS_MIN_SDK_VERSION="7.0"
TVOS_MIN_SDK_VERSION="9.0" TVOS_MIN_SDK_VERSION="9.0"
LOG_VERBOSE="$1" # Options: verbose (full output) or verbose-on-error (echo last 500 logged lines when error occurs)
if [ ! -d "$DEVELOPER" ]; then if [ ! -d "$DEVELOPER" ]; then
echo "xcode path is not set correctly $DEVELOPER does not exist" echo "xcode path is not set correctly $DEVELOPER does not exist"
@ -79,7 +106,11 @@ case $CURRENTPATH in
;; ;;
esac esac
set -e # -e Abort script at first error, when a command exits with non-zero status (except in until or while loops, if-tests, list constructs)
# -o pipefail Causes a pipeline to return the exit status of the last command in the pipe that returned a non-zero return value
set -eo pipefail
# Download OpenSSL when not present
OPENSSL_ARCHIVE_BASE_NAME=OpenSSL_${VERSION//./_} OPENSSL_ARCHIVE_BASE_NAME=OpenSSL_${VERSION//./_}
OPENSSL_ARCHIVE_FILE_NAME=${OPENSSL_ARCHIVE_BASE_NAME}.tar.gz OPENSSL_ARCHIVE_FILE_NAME=${OPENSSL_ARCHIVE_BASE_NAME}.tar.gz
if [ ! -e ${OPENSSL_ARCHIVE_FILE_NAME} ]; then if [ ! -e ${OPENSSL_ARCHIVE_FILE_NAME} ]; then
@ -170,13 +201,14 @@ do
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c" sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
fi fi
# Run Configure
echo " Configure...\c" echo " Configure...\c"
set +e set +e
if [ "$1" == "verbose" ]; then if [ "${LOG_VERBOSE}" == "verbose" ]; then
if [ "${ARCH}" == "x86_64" ]; then if [ "${ARCH}" == "x86_64" ]; then
./Configure no-asm darwin64-x86_64-cc --openssldir="${TARGETDIR}" ${LOCAL_CONFIG_OPTIONS} ./Configure no-asm darwin64-x86_64-cc --openssldir="${TARGETDIR}" ${LOCAL_CONFIG_OPTIONS} | tee "${LOG}"
else else
./Configure iphoneos-cross --openssldir="${TARGETDIR}" ${LOCAL_CONFIG_OPTIONS} ./Configure iphoneos-cross --openssldir="${TARGETDIR}" ${LOCAL_CONFIG_OPTIONS} | tee "${LOG}"
fi fi
else else
if [ "${ARCH}" == "x86_64" ]; then if [ "${ARCH}" == "x86_64" ]; then
@ -185,13 +217,11 @@ do
(./Configure iphoneos-cross --openssldir="${TARGETDIR}" ${LOCAL_CONFIG_OPTIONS} > "${LOG}" 2>&1) & spinner (./Configure iphoneos-cross --openssldir="${TARGETDIR}" ${LOCAL_CONFIG_OPTIONS} > "${LOG}" 2>&1) & spinner
fi fi
fi fi
# Check for error status
check_status $? "Configure"
if [ $? != 0 ]; then echo " Patch Makefile..."
echo "Problem while configure - Please check ${LOG}"
exit 1
fi
echo "\n Patch Makefile..."
# add -isysroot to CC= # add -isysroot to CC=
if [[ "${PLATFORM}" == "AppleTVSimulator" || "${PLATFORM}" == "AppleTVOS" ]]; then if [[ "${PLATFORM}" == "AppleTVSimulator" || "${PLATFORM}" == "AppleTVOS" ]]; then
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -mtvos-version-min=${TVOS_MIN_SDK_VERSION} !" "Makefile" sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -mtvos-version-min=${TVOS_MIN_SDK_VERSION} !" "Makefile"
@ -199,35 +229,39 @@ do
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -miphoneos-version-min=${MIN_SDK_VERSION} !" "Makefile" sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -miphoneos-version-min=${MIN_SDK_VERSION} !" "Makefile"
fi fi
echo " Make...\c" # Run make depend if relevant
if [[ ! -z "${CONFIG_OPTIONS}" ]]; then
echo " Make depend...\c"
if [ "${LOG_VERBOSE}" == "verbose" ]; then
make depend | tee -a "${LOG}"
else
(make depend >> "${LOG}" 2>&1) & spinner
fi
if [ "$1" == "verbose" ]; then # Check for error status
if [[ ! -z $CONFIG_OPTIONS ]]; then check_status $? "make depend"
make depend fi
fi
make # Run make
echo " Make...\c"
if [ "${LOG_VERBOSE}" == "verbose" ]; then
make | tee -a "${LOG}"
else else
if [[ ! -z $CONFIG_OPTIONS ]]; then
make depend >> "${LOG}" 2>&1
fi
(make >> "${LOG}" 2>&1) & spinner (make >> "${LOG}" 2>&1) & spinner
fi fi
echo "\n"
if [ $? != 0 ]; then # Check for error status
echo "Problem while make - Please check ${LOG}" check_status $? "make"
exit 1
fi
# Run make install
set -e set -e
if [ "$1" == "verbose" ]; then if [ "${LOG_VERBOSE}" == "verbose" ]; then
make install_sw make install_sw | tee -a "${LOG}"
make clean
else else
make install_sw >> "${LOG}" 2>&1 make install_sw >> "${LOG}" 2>&1
make clean >> "${LOG}" 2>&1
fi fi
# Remove source dir
rm -rf "$src_work_dir" rm -rf "$src_work_dir"
# Add references to library files to relevant arrays # Add references to library files to relevant arrays