diff --git a/.gitignore b/.gitignore index 956643d..7112fcf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ -bin -src +bin/ +build/ +src/ *.gz +libssh2-*/ libssh2-for-iOS.xcodeproj/project.xcworkspace/xcuserdata libssh2-for-iOS.xcodeproj/xcuserdata -lib +lib/ *.xccheckout openssl.framework include/ diff --git a/.travis.yml b/.travis.yml index 75ce4b8..ff98db1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ -osx_image: xcode9.2 +osx_image: xcode11.3 language: objective-c -before_install: +before_install: -script: - - ./build-all.sh openssl - - xcrun -sdk iphoneos lipo -info libssh2.framework/libssh2 - - xcrun -sdk iphoneos lipo -info openssl.framework/openssl +script: + - ./build-all.sh openssl + - xcrun -sdk iphoneos lipo -info libssh2.framework/libssh2 + - xcrun -sdk iphoneos lipo -info openssl.framework/openssl diff --git a/README.md b/README.md index 74a98b9..c8549e2 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,20 @@ You can build the libssh2 library with openssl or with libgcrypt! - Xcode 7.1 - Xcode Command Line Tools + brew install automake autoconf libssh2 + +Be sure to include libssh2 headers. Brew recommends steps to do so: + +If you need to have openssl@1.1 first in your PATH run: + + echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc + +For compilers to find openssl@1.1 you may need to set: + + export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" + export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include" + + ## Readme ### Checkout the submodules: ```bash diff --git a/build-all.sh b/build-all.sh index 3309377..cd1ce46 100755 --- a/build-all.sh +++ b/build-all.sh @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/bash -x -e -# Automatic build script for libssh2 +# Automatic build script for libssh2 # for iPhoneOS and iPhoneSimulator # # Created by Felix Schulze on 01.02.11. @@ -20,30 +20,30 @@ # if [ "$1" == "openssl" ]; then - echo "Building openssl:" - # ./openssl/build-libssl.sh --version=1.1.0j --deprecated $2 - ./openssl/build-libssl.sh $2 + echo "Building openssl: $2" + ./build-libssl.sh --archs="x86_64 arm64" --targets="ios-sim-cross-x86_64 ios64-cross-arm64" $2 # Make dynamic framework, with embed-bitcode, iOS + Simulator: rm -rf build rm -rf openssl.framework - xcodebuild -project libssh2-for-iOS.xcodeproj -target openssl -sdk iphoneos -configuration Debug + xcodebuild -project libssh2-for-iOS.xcodeproj -UseModernBuildSystem=NO -target openssl -sdk iphoneos -configuration Debug mkdir -p build/Debug-iphoneos/openssl.framework/Headers/ cp include/openssl/* build/Debug-iphoneos/openssl.framework/Headers/ - xcodebuild -project libssh2-for-iOS.xcodeproj -target openssl -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=10.0' -arch x86_64 -arch i386 -configuration Debug + xcodebuild -project libssh2-for-iOS.xcodeproj -UseModernBuildSystem=NO -target openssl -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=13.4' -arch x86_64 -arch arm64 -configuration Debug mkdir -p build/Debug-iphonesimulator/openssl.framework/Headers/ cp include/openssl/* build/Debug-iphonesimulator/openssl.framework/Headers/ cp -r build/Debug-iphoneos/openssl.framework . lipo -create -output openssl.framework/openssl build/Debug-iphonesimulator/openssl.framework/openssl build/Debug-iphoneos/openssl.framework/openssl # if you don't need bitcode, use this line instead: # ./openssl/create-openssl-framework.sh dynamic + echo "Build libssh2:" ./build-libssh2.sh openssl # Make dynamic framework, with embed-bitcode, iOS + Simulator: rm -rf libssh2.framework - xcodebuild -project libssh2-for-iOS.xcodeproj -target libssh2 -sdk iphoneos -configuration Debug + xcodebuild -UseModernBuildSystem=NO -project libssh2-for-iOS.xcodeproj -target libssh2 -sdk iphoneos -configuration Debug mkdir -p build/Debug-iphoneos/libssh2.framework/Headers/ cp include/libssh2/* build/Debug-iphoneos/libssh2.framework/Headers/ - xcodebuild -project libssh2-for-iOS.xcodeproj -target libssh2 -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=10.0' -arch x86_64 -arch i386 -configuration Debug + xcodebuild -UseModernBuildSystem=NO -project libssh2-for-iOS.xcodeproj -target libssh2 -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=13.4' -arch x86_64 -arch i386 -configuration Debug mkdir -p build/Debug-iphonesimulator/libssh2.framework/Headers/ cp include/libssh2/* build/Debug-iphonesimulator/libssh2.framework/Headers/ cp -r build/Debug-iphoneos/libssh2.framework . diff --git a/build-libssh2.sh b/build-libssh2.sh index fb45b8e..4f5c1b2 100755 --- a/build-libssh2.sh +++ b/build-libssh2.sh @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/bash -x -e -# Automatic build script for libssh2 +# Automatic build script for libssh2 # for iPhoneOS and iPhoneSimulator # # Created by Felix Schulze on 02.02.11. @@ -21,27 +21,27 @@ ########################################################################### # Change values here # -VERSION="1.8.0" +VERSION="1.9.0" # ########################################################################### # # Don't change anything here -SDKVERSION=`xcrun -sdk iphoneos --show-sdk-version` +SDKVERSION=`xcrun -sdk iphoneos --show-sdk-version` CURRENTPATH=`pwd` -ARCHS="i386 x86_64 armv7 armv7s arm64" +ARCHS="x86_64 arm64" DEVELOPER=`xcode-select -print-path` ########## set -e if [ ! -e libssh2-${VERSION}.tar.gz ]; then echo "Downloading libssh2-${VERSION}.tar.gz" - curl -O https://www.libssh2.org/download/libssh2-${VERSION}.tar.gz + curl --fail -O https://www.libssh2.org/download/libssh2-${VERSION}.tar.gz else echo "Using libssh2-${VERSION}.tar.gz" fi echo "Checking file: libssh2-${VERSION}.tar.gz" md5=`md5 -q libssh2-${VERSION}.tar.gz` -if [ $md5 != "3d1147cae66e2959ea5441b183de1b1c" ] +if [ $md5 != "1beefafe8963982adc84b408b2959927" ] then echo "File corrupt, please download again." exit 1 @@ -62,12 +62,8 @@ do PLATFORM="iPhoneOS" fi echo "Building libssh2 for ${PLATFORM} ${SDKVERSION} ${ARCH}" - echo "Please stand by..." - tar zxf libssh2-${VERSION}.tar.gz -C src - cd src/libssh2-${VERSION} + echo "Please stand by...!" - PATCHFILE=`find ../.. | grep with-libgcrypt-prefix.patch` - patch -p2 < $PATCHFILE export M4="${DEVELOPER}/Toolchains/XcodeDefault.xctoolchain/usr/bin/gm4" export DEVROOT="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer" @@ -87,33 +83,30 @@ do LOG="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/build-libssh2-${VERSION}.log" echo ${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk - - + HOST="${ARCH}" if [ "${ARCH}" == "arm64" ]; then HOST="aarch64" fi - - autoconf if [ "$1" == "openssl" ]; then - ./configure --host=${HOST}-apple-darwin --prefix="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" --with-openssl --with-libssl-prefix=${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk --disable-shared --enable-static >> "${LOG}" 2>&1 + pwd + ./configure --host=${HOST}-apple-darwin --prefix="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" --with-crypto=openssl --with-libssl-prefix=${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk --disable-shared --enable-static >> "${LOG}" else - ./configure --host=${HOST}-apple-darwin --prefix="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" --with-libgcrypt --with-libgcrypt-prefix=${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk --disable-shared --enable-static >> "${LOG}" 2>&1 + ./configure --host=${HOST}-apple-darwin --prefix="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" --with-crypto=libgcrypt --with-libgcrypt-prefix=${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk --disable-shared --enable-static >> "${LOG}" fi - + make >> "${LOG}" 2>&1 make install >> "${LOG}" 2>&1 - cd ${CURRENTPATH} - rm -rf src/libssh2-${VERSION} - + done echo "Build library..." -# -lipo -create ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-i386.sdk/lib/libssh2.a ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-x86_64.sdk/lib/libssh2.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7s.sdk/lib/libssh2.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk/lib/libssh2.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-arm64.sdk/lib/libssh2.a -output ${CURRENTPATH}/lib/libssh2.a + +lipo -create ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-x86_64.sdk/lib/libssh2.a -output ${CURRENTPATH}/lib/libssh2-x86_64.a +lipo -create ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-arm64.sdk/lib/libssh2.a -output ${CURRENTPATH}/lib/libssh2.a mkdir -p ${CURRENTPATH}/include/libssh2 -cp -R ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-i386.sdk/include/libssh2* ${CURRENTPATH}/include/libssh2/ +#cp -vR ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-arm64.sdk/include/libssh2* ${CURRENTPATH}/include/libssh2/ echo "Building done." diff --git a/build-libssl.sh b/build-libssl.sh new file mode 100755 index 0000000..5016933 --- /dev/null +++ b/build-libssl.sh @@ -0,0 +1,558 @@ +#!/bin/sh -x + +# Automatic build script for libssl and libcrypto +# for iPhoneOS and iPhoneSimulator +# +# Created by Felix Schulze on 16.12.10. +# Copyright 2010-2019 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. +# + +# -u Attempt to use undefined variable outputs error message, and forces an exit +set -u + +# SCRIPT DEFAULTS + +# Default version in case no version is specified +DEFAULTVERSION="1.1.0l" +DEVELOPER=`xcode-select -print-path` + +# Default (=full) set of targets to build +DEFAULTTARGETS="ios-sim-cross-x86_64 ios64-cross-arm64 tvos-sim-cross-x86_64 tvos64-cross-arm64" # mac-catalyst-x86_64 is a valid target that is not in the DEFAULTTARGETS because it's incompatible with "ios-sim-cross-x86_64" + +# Minimum iOS/tvOS SDK version to build for +IOS_MIN_SDK_VERSION="13.0" +TVOS_MIN_SDK_VERSION="13.0" +MACOSX_MIN_SDK_VERSION="10.15" + +# Init optional env variables (use available variable or default to empty string) +CURL_OPTIONS="${CURL_OPTIONS:-}" +CONFIG_OPTIONS="${CONFIG_OPTIONS:-}" + +echo_help() +{ + echo "Usage: $0 [options...]" + echo "Generic options" + echo " --branch=BRANCH Select OpenSSL branch to build. The script will determine and download the latest release for that branch" + echo " --cleanup Clean up build directories (bin, include/openssl, lib, src) before starting build" + echo " --ec-nistp-64-gcc-128 Enable configure option enable-ec_nistp_64_gcc_128 for 64 bit builds" + echo " -h, --help Print help (this message)" + echo " --ios-sdk=SDKVERSION Override iOS SDK version" + echo " --macosx-sdk=SDKVERSION Override MacOSX SDK version" + echo " --noparallel Disable running make with parallel jobs (make -j)" + echo " --tvos-sdk=SDKVERSION Override tvOS SDK version" + echo " --disable-bitcode Disable embedding Bitcode" + echo " -v, --verbose Enable verbose logging" + echo " --verbose-on-error Dump last 500 lines from log file if an error occurs (for Travis builds)" + echo " --version=VERSION OpenSSL version to build (defaults to ${DEFAULTVERSION})" + echo " --deprecated Exclude no-deprecated configure option and build with deprecated methods" + echo " --targets=\"TARGET TARGET ...\" Space-separated list of build targets" + echo " Options: ${DEFAULTTARGETS} mac-catalyst-x86_64" + echo + echo "For custom configure options, set variable CONFIG_OPTIONS" + echo "For custom cURL options, set variable CURL_OPTIONS" + echo " Example: CURL_OPTIONS=\"--proxy 192.168.1.1:8080\" ./build-libssl.sh" +} + +spinner() +{ + # spinner is incompatible with set -x + old_setting=${-//[^x]/} + set +x + local pid=$! + local delay=0.75 + local spinstr='|/-\' + while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do + local temp=${spinstr#?} + printf " [%c]" "$spinstr" + local spinstr=$temp${spinstr%"$temp"} + sleep $delay + printf "\b\b\b\b\b" + done + if [[ -n "$old_setting" ]]; then set -x; else set +x; fi + wait $pid + return $? +} + +# Prepare target and source dir in build loop +prepare_target_source_dirs() +{ + # Prepare target dir + if [ -z "$TARGETDIR" ]; then + TARGETDIR="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" + fi + + mkdir -p "${TARGETDIR}" + LOG="${TARGETDIR}/build-openssl-${VERSION}.log" + + echo "Building openssl-${VERSION} for ${PLATFORM} ${SDKVERSION} ${ARCH}..." + echo " Logfile: ${LOG}" + + # Prepare source dir + SOURCEDIR="${CURRENTPATH}/src/${PLATFORM}-${ARCH}" + mkdir -p "${SOURCEDIR}" + tar zxf "${CURRENTPATH}/${OPENSSL_ARCHIVE_FILE_NAME}" -C "${SOURCEDIR}" + cd "${SOURCEDIR}/${OPENSSL_ARCHIVE_BASE_NAME}" + chmod u+x ./Configure +} + +# Check for error status +check_status() +{ + local STATUS=$1 + local COMMAND=$2 + + 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 +} + +# Run Configure in build loop +run_configure() +{ + echo " Configure..." + set +e + if [ "${LOG_VERBOSE}" == "verbose" ]; then + ./Configure ${LOCAL_CONFIG_OPTIONS} | tee "${LOG}" + else + (./Configure ${LOCAL_CONFIG_OPTIONS} > "${LOG}" 2>&1) & spinner + fi + + # Check for error status + check_status $? "Configure" +} + +# Run make in build loop +run_make() +{ + echo " Make (using ${BUILD_THREADS} thread(s))..." + if [ "${LOG_VERBOSE}" == "verbose" ]; then + make -j "${BUILD_THREADS}" | tee -a "${LOG}" + else + (make -j "${BUILD_THREADS}" >> "${LOG}" 2>&1) & spinner + fi + + # Check for error status + check_status $? "make" +} + +# Cleanup and bookkeeping at end of build loop +finish_build_loop() +{ + # Return to ${CURRENTPATH} and remove source dir + cd "${CURRENTPATH}" + rm -r "${SOURCEDIR}" + + # Add references to library files to relevant arrays + if [[ "${PLATFORM}" == AppleTV* ]]; then + LIBSSL_TVOS+=("${TARGETDIR}/lib/libssl.a") + LIBCRYPTO_TVOS+=("${TARGETDIR}/lib/libcrypto.a") + OPENSSLCONF_SUFFIX="tvos_${ARCH}" + else + LIBSSL_IOS+=("${TARGETDIR}/lib/libssl.a") + LIBCRYPTO_IOS+=("${TARGETDIR}/lib/libcrypto.a") + if [[ "${PLATFORM}" != MacOSX* ]]; then + OPENSSLCONF_SUFFIX="ios_${ARCH}" + else + OPENSSLCONF_SUFFIX="catalyst_${ARCH}" + fi + fi + + # Copy opensslconf.h to bin directory and add to array + OPENSSLCONF="opensslconf_${OPENSSLCONF_SUFFIX}.h" + cp "${TARGETDIR}/include/openssl/opensslconf.h" "${CURRENTPATH}/bin/${OPENSSLCONF}" + OPENSSLCONF_ALL+=("${OPENSSLCONF}") + + # Keep reference to first build target for include file + if [ -z "${INCLUDE_DIR}" ]; then + INCLUDE_DIR="${TARGETDIR}/include/openssl" + fi +} + +# Init optional command line vars +ARCHS="" +BRANCH="" +CLEANUP="" +CONFIG_ENABLE_EC_NISTP_64_GCC_128="" +CONFIG_DISABLE_BITCODE="" +CONFIG_NO_DEPRECATED="" +IOS_SDKVERSION="" +MACOSX_SDKVERSION="" +LOG_VERBOSE="" +PARALLEL="" +TARGETS="" +TVOS_SDKVERSION="" +VERSION="" + +# Process command line arguments +for i in "$@" +do +case $i in + --archs=*) + ARCHS="${i#*=}" + shift + ;; + --branch=*) + BRANCH="${i#*=}" + shift + ;; + --cleanup) + CLEANUP="true" + ;; + --deprecated) + CONFIG_NO_DEPRECATED="false" + ;; + --ec-nistp-64-gcc-128) + CONFIG_ENABLE_EC_NISTP_64_GCC_128="true" + ;; + --disable-bitcode) + CONFIG_DISABLE_BITCODE="true" + ;; + -h|--help) + echo_help + exit + ;; + --ios-sdk=*) + IOS_SDKVERSION="${i#*=}" + shift + ;; + --prefix=*) + TARGETDIR="${i#*=}" + shift + ;; + --macosx-sdk=*) + MACOSX_SDKVERSION="${i#*=}" + shift + ;; + --noparallel) + PARALLEL="false" + ;; + --targets=*) + TARGETS="${i#*=}" + shift + ;; + --tvos-sdk=*) + TVOS_SDKVERSION="${i#*=}" + shift + ;; + -v|--verbose) + LOG_VERBOSE="verbose" + ;; + --verbose-on-error) + LOG_VERBOSE="verbose-on-error" + ;; + --version=*) + VERSION="${i#*=}" + shift + ;; + *) + echo "Unknown argument: ${i}" + ;; +esac +done + +# Don't mix version and branch +if [[ -n "${VERSION}" && -n "${BRANCH}" ]]; then + echo "Either select a branch (the script will determine and build the latest version) or select a specific version, but not both." + exit 1 + +# Specific version: Verify version number format. Expected: dot notation +elif [[ -n "${VERSION}" && ! "${VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+[a-z]*$ ]]; then + echo "Unknown version number format. Examples: 1.1.0, 1.1.0l" + exit 1 + +# Specific branch +elif [ -n "${BRANCH}" ]; then + # Verify version number format. Expected: dot notation + if [[ ! "${BRANCH}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Unknown branch version number format. Examples: 1.1.0, 1.2.0" + exit 1 + + # Valid version number, determine latest version + else + echo "Checking latest version of ${BRANCH} branch on openssl.org..." + # Get directory content listing of /source/ (only contains latest version per branch), limit list to archives (so one archive per branch), + # filter for the requested branch, sort the list and get the last item (last two steps to ensure there is always 1 result) + VERSION=$(curl ${CURL_OPTIONS} -s https://ftp.openssl.org/source/ | grep -Eo '>openssl-[0-9]\.[0-9]\.[0-9][a-z]*\.tar\.gz<' | grep -Eo "${BRANCH//./\.}[a-z]*" | sort | tail -1) + + # Verify result + if [ -z "${VERSION}" ]; then + echo "Could not determine latest version, please check https://www.openssl.org/source/ and use --version option" + exit 1 + fi + fi + +# Script default +elif [ -z "${VERSION}" ]; then + VERSION="${DEFAULTVERSION}" +fi + +BUILD_TYPE="targets" + +# Set default for TARGETS if not specified +if [ ! -n "${TARGETS}" ]; then + TARGETS="${DEFAULTTARGETS}" +fi + +# Add no-deprecated config option (if not overwritten) +if [ "${CONFIG_NO_DEPRECATED}" != "false" ]; then + CONFIG_OPTIONS="${CONFIG_OPTIONS} no-deprecated" +fi + +# Determine SDK versions +if [ ! -n "${IOS_SDKVERSION}" ]; then + IOS_SDKVERSION=$(xcrun -sdk iphoneos --show-sdk-version) +fi +if [ ! -n "${MACOSX_SDKVERSION}" ]; then + MACOSX_SDKVERSION=$(xcrun -sdk macosx --show-sdk-version) +fi +if [ ! -n "${TVOS_SDKVERSION}" ]; then + TVOS_SDKVERSION=$(xcrun -sdk appletvos --show-sdk-version) +fi + +# Determine number of cores for (parallel) build +BUILD_THREADS=1 +if [ "${PARALLEL}" != "false" ]; then + BUILD_THREADS=$(sysctl hw.ncpu | awk '{print $2}') +fi + +# Determine script directory +SCRIPTDIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) + +# Write files relative to current location and validate directory +CURRENTPATH=$(pwd) +case "${CURRENTPATH}" in + *\ * ) + echo "Your path contains whitespaces, which is not supported by 'make install'." + exit 1 + ;; +esac +cd "${CURRENTPATH}" + +# Validate Xcode Developer path +DEVELOPER=$(xcode-select -print-path) +if [ ! -d "${DEVELOPER}" ]; then + echo "Xcode path is not set correctly ${DEVELOPER} does not exist" + echo "run" + echo "sudo xcode-select -switch " + echo "for default installation:" + echo "sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer" + exit 1 +fi + +case "${DEVELOPER}" in + *\ * ) + echo "Your Xcode path contains whitespaces, which is not supported." + exit 1 + ;; +esac + +# Show build options +echo +echo "Build options" +echo " OpenSSL version: ${VERSION}" +echo " Targets: ${TARGETS}" +echo " iOS SDK: ${IOS_SDKVERSION}" +echo " tvOS SDK: ${TVOS_SDKVERSION}" +if [ "${CONFIG_DISABLE_BITCODE}" == "true" ]; then + echo " Bitcode embedding disabled" +fi +echo " Number of make threads: ${BUILD_THREADS}" +if [ -n "${CONFIG_OPTIONS}" ]; then + echo " Configure options: ${CONFIG_OPTIONS}" +fi +echo " Build location: ${CURRENTPATH}" +echo + +# Download OpenSSL when not present +OPENSSL_ARCHIVE_BASE_NAME="openssl-${VERSION}" +OPENSSL_ARCHIVE_FILE_NAME="${OPENSSL_ARCHIVE_BASE_NAME}.tar.gz" +if [ ! -e ${OPENSSL_ARCHIVE_FILE_NAME} ]; then + echo "Downloading ${OPENSSL_ARCHIVE_FILE_NAME}..." + OPENSSL_ARCHIVE_URL="https://www.openssl.org/source/${OPENSSL_ARCHIVE_FILE_NAME}" + + # Check whether file exists here (this is the location of the latest version for each branch) + # -s be silent, -f return non-zero exit status on failure, -I get header (do not download) + curl ${CURL_OPTIONS} -sfI "${OPENSSL_ARCHIVE_URL}" > /dev/null + + # If unsuccessful, try the archive + if [ $? -ne 0 ]; then + BRANCH=$(echo "${VERSION}" | grep -Eo '^[0-9]\.[0-9]\.[0-9]') + OPENSSL_ARCHIVE_URL="https://www.openssl.org/source/old/${BRANCH}/${OPENSSL_ARCHIVE_FILE_NAME}" + + curl ${CURL_OPTIONS} -sfI "${OPENSSL_ARCHIVE_URL}" > /dev/null + fi + + # Both attempts failed, so report the error + if [ $? -ne 0 ]; then + echo "An error occurred trying to find OpenSSL ${VERSION} on ${OPENSSL_ARCHIVE_URL}" + echo "Please verify that the version you are trying to build exists, check cURL's error message and/or your network connection." + exit 1 + fi + + # Archive was found, so proceed with download. + # -O Use server-specified filename for download + curl ${CURL_OPTIONS} -O "${OPENSSL_ARCHIVE_URL}" + +else + echo "Using ${OPENSSL_ARCHIVE_FILE_NAME}" +fi + +# Set reference to custom configuration (OpenSSL 1.1.0) +# See: https://github.com/openssl/openssl/commit/afce395cba521e395e6eecdaf9589105f61e4411 +export OPENSSL_LOCAL_CONFIG_DIR="${SCRIPTDIR}/config" + +# -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 + +# Clean up target directories if requested and present +if [ "${CLEANUP}" == "true" ]; then + if [ -d "${CURRENTPATH}/bin" ]; then + rm -r "${CURRENTPATH}/bin" + fi + if [ -d "${CURRENTPATH}/include/openssl" ]; then + rm -r "${CURRENTPATH}/include/openssl" + fi + if [ -d "${CURRENTPATH}/lib" ]; then + rm -r "${CURRENTPATH}/lib" + fi + if [ -d "${CURRENTPATH}/src" ]; then + rm -r "${CURRENTPATH}/src" + fi +fi + +# (Re-)create target directories +mkdir -p "${CURRENTPATH}/bin" +mkdir -p "${CURRENTPATH}/lib" +mkdir -p "${CURRENTPATH}/src" + +# Init vars for library references +INCLUDE_DIR="" +OPENSSLCONF_ALL=() +LIBSSL_IOS=() +LIBCRYPTO_IOS=() +LIBSSL_TVOS=() +LIBCRYPTO_TVOS=() + +# Run relevant build loop +source "${SCRIPTDIR}/scripts/build-loop-targets.sh" +set -x + +# Build iOS library if selected for build +if [ ${#LIBSSL_IOS[@]} -gt 0 ]; then + echo "Build library for iOS..." + #lipo -create ${LIBSSL_IOS[@]} -output "${CURRENTPATH}/lib/libssl.a" + #lipo -create ${LIBCRYPTO_IOS[@]} -output "${CURRENTPATH}/lib/libcrypto.a" + + echo "\n=====>iOS SSL and Crypto lib files:" + echo "${CURRENTPATH}/lib/libssl.a" + echo "${CURRENTPATH}/lib/libcrypto.a" +fi + +# Build tvOS library if selected for build +if [ ${#LIBSSL_TVOS[@]} -gt 0 ]; then + echo "Build library for tvOS..." + lipo -create ${LIBSSL_TVOS[@]} -output "${CURRENTPATH}/lib/libssl-tvOS.a" + lipo -create ${LIBCRYPTO_TVOS[@]} -output "${CURRENTPATH}/lib/libcrypto-tvOS.a" + echo "\n=====>tvOS SSL and Crypto lib files:" + echo "${CURRENTPATH}/lib/libssl-tvOS.a" + echo "${CURRENTPATH}/lib/libcrypto-tvOS.a" +fi + +set +x +# Copy include directory +cp -R "${INCLUDE_DIR}" "${CURRENTPATH}/include/" + +echo "\n=====>Include directory:" +echo "${CURRENTPATH}/include/" + +# Only create intermediate file when building for multiple targets +# For a single target, opensslconf.h is still present in $INCLUDE_DIR (and has just been copied to the target include dir) +if [ ${#OPENSSLCONF_ALL[@]} -gt 1 ]; then + + # Prepare intermediate header file + # This overwrites opensslconf.h that was copied from $INCLUDE_DIR + OPENSSLCONF_INTERMEDIATE="${CURRENTPATH}/include/openssl/opensslconf.h" + cp "${CURRENTPATH}/include/opensslconf-template.h" "${OPENSSLCONF_INTERMEDIATE}" + + # Loop all header files + LOOPCOUNT=0 + for OPENSSLCONF_CURRENT in "${OPENSSLCONF_ALL[@]}" ; do + + # Copy specific opensslconf file to include dir + cp "${CURRENTPATH}/bin/${OPENSSLCONF_CURRENT}" "${CURRENTPATH}/include/openssl" + + # Determine define condition + case "${OPENSSLCONF_CURRENT}" in + *_ios_x86_64.h) + DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_SIMULATOR && TARGET_CPU_X86_64" + ;; + *_ios_i386.h) + DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_SIMULATOR && TARGET_CPU_X86" + ;; + *_ios_arm64.h) + DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64" + ;; + *_ios_armv7s.h) + DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM && defined(__ARM_ARCH_7S__)" + ;; + *_ios_armv7.h) + DEFINE_CONDITION="TARGET_OS_IOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM && !defined(__ARM_ARCH_7S__)" + ;; + *_catalyst_x86_64.h) + DEFINE_CONDITION="(TARGET_OS_MACCATALYST || (TARGET_OS_IOS && TARGET_OS_SIMULATOR)) && TARGET_CPU_X86_64" + ;; + *_tvos_x86_64.h) + DEFINE_CONDITION="TARGET_OS_TV && TARGET_OS_SIMULATOR && TARGET_CPU_X86_64" + ;; + *_tvos_arm64.h) + DEFINE_CONDITION="TARGET_OS_TV && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64" + ;; + *) + # Don't run into unexpected cases by setting the default condition to false + DEFINE_CONDITION="0" + ;; + esac + + # Determine loopcount; start with if and continue with elif + LOOPCOUNT=$((LOOPCOUNT + 1)) + if [ ${LOOPCOUNT} -eq 1 ]; then + echo "#if ${DEFINE_CONDITION}" >> "${OPENSSLCONF_INTERMEDIATE}" + else + echo "#elif ${DEFINE_CONDITION}" >> "${OPENSSLCONF_INTERMEDIATE}" + fi + + # Add include + echo "# include " >> "${OPENSSLCONF_INTERMEDIATE}" + done + + # Finish + echo "#else" >> "${OPENSSLCONF_INTERMEDIATE}" + echo '# error Unable to determine target or target not included in OpenSSL build' >> "${OPENSSLCONF_INTERMEDIATE}" + echo "#endif" >> "${OPENSSLCONF_INTERMEDIATE}" +fi + +echo "Done." diff --git a/config/20-ios-tvos-cross.conf b/config/20-ios-tvos-cross.conf new file mode 100644 index 0000000..2ff1be4 --- /dev/null +++ b/config/20-ios-tvos-cross.conf @@ -0,0 +1,99 @@ +## -*- mode: perl; -*- +## iOS configuration targets + +%targets = ( + ## Base settings for iOS-tvOS cross-compile + # Based on 10-main.conf: iphoneos-cross + # Add generic compiler flags + # Add embed-bitcode option if SDK version is 9 or higher + "ios-tvos-cross-base" => { + template => 1, + cflags => combine('-isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common', + sub { ((!defined($ENV{'CONFIG_DISABLE_BITCODE'}) || $ENV{'CONFIG_DISABLE_BITCODE'} ne 'true') && defined($ENV{'SDKVERSION'}) && $ENV{'SDKVERSION'} =~ /^(9|[1-9][0-9]+)\./ && $disabled{shared}) + ? '-fembed-bitcode' : (); }, + ), + }, + + ## Base settings for iOS + "ios-cross-base" => { + inherit_from => [ "ios-tvos-cross-base" ], + template => 1, + cflags => add(sub { defined($ENV{'IOS_MIN_SDK_VERSION'}) ? '-mios-version-min=$(IOS_MIN_SDK_VERSION)' : '-mios-version-min=7.0'; }), + }, + + ## Base settings for tvOS + # Defines to skip functionality that uses unsupported functions + "tvos-cross-base" => { + inherit_from => [ "ios-tvos-cross-base" ], + template => 1, + cflags => add(sub { defined($ENV{'TVOS_MIN_SDK_VERSION'}) ? '-mtvos-version-min=$(TVOS_MIN_SDK_VERSION)' : '-mtvos-version-min=9.0'; }), + defines => [ "HAVE_FORK=0" ], + }, + + ## Base for Catalyst + "mac-catalyst-base" => { + inherit_from => [ "ios-tvos-cross-base" ], + template => 1, + cflags => add(sub { defined($ENV{'MACOSX_MIN_SDK_VERSION'}) ? '-mios-version-min=$(MACOSX_MIN_SDK_VERSION)' : '-mmacosx-version-min=10.15'; }), + }, + + ## Catalyst (armv7s) + # Based on 10-main.conf: ios-cross + "mac-catalyst-x86_64" => { + inherit_from => [ "darwin64-x86_64-cc", "mac-catalyst-base" ], + cflags => add("-target x86_64-apple-ios13.0-macabi"), + sys_id => "MacOSX", + }, + + ## Apple iOS simulator (x86_64) + # Based on 10-main.conf: iphoneos-cross / darwin64-x86_64-cc + "ios-sim-cross-x86_64" => { + inherit_from => [ "darwin64-x86_64-cc", "ios-cross-base" ], + sys_id => "iOS", + }, + + ## Apple iOS (arm64) + # Based on 10-main.conf: ios64-cross + "ios64-cross-arm64" => { + inherit_from => [ "darwin-common", "ios-cross-base", asm("aarch64_asm") ], + cflags => add("-arch arm64"), + bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", + perlasm_scheme => "ios64", + sys_id => "iOS", + }, + + ## Apple iOS (armv7s) + # Based on 10-main.conf: ios-cross + "ios-cross-armv7s" => { + inherit_from => [ "darwin-common", "ios-cross-base", asm("armv4_asm") ], + cflags => add("-arch armv7s"), + perlasm_scheme => "ios32", + sys_id => "iOS", + }, + + ## Apple iOS (armv7) + # Based on 10-main.conf: ios-cross + "ios-cross-armv7" => { + inherit_from => [ "darwin-common", "ios-cross-base", asm("armv4_asm") ], + cflags => add("-arch armv7"), + perlasm_scheme => "ios32", + sys_id => "iOS", + }, + + ## Apple tvOS simulator (x86_64) + # Based on 10-main.conf: iphoneos-cross / darwin64-x86_64-cc + "tvos-sim-cross-x86_64" => { + inherit_from => [ "darwin64-x86_64-cc", "tvos-cross-base" ], + sys_id => "tvOS", + }, + + ## Apple tvOS (arm64) + # Based on 10-main.conf: ios64-cross + "tvos64-cross-arm64" => { + inherit_from => [ "darwin-common", "tvos-cross-base", asm("aarch64_asm") ], + cflags => add("-arch arm64"), + bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", + perlasm_scheme => "ios64", + sys_id => "tvOS", + }, +); diff --git a/hello.c b/hello.c new file mode 100644 index 0000000..53c5fdf --- /dev/null +++ b/hello.c @@ -0,0 +1 @@ +#include diff --git a/libssh2-for-iOS.xcodeproj/project.pbxproj b/libssh2-for-iOS.xcodeproj/project.pbxproj index f280bce..c808aea 100755 --- a/libssh2-for-iOS.xcodeproj/project.pbxproj +++ b/libssh2-for-iOS.xcodeproj/project.pbxproj @@ -260,7 +260,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 1140; TargetAttributes = { 22BCB307202E32330041F00E = { CreatedOnToolsVersion = 9.3; @@ -274,13 +274,14 @@ }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "libssh2-for-iOS" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + ja, + en, + fr, + Base, + de, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; projectDirPath = ""; @@ -365,6 +366,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "libssh2-for-iOS/libssh2_for_iOS_Prefix.pch"; INFOPLIST_FILE = "libssh2-for-iOS/libssh2_for_iOS-Info.plist"; + INSTALL_PATH = "~/Applications"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -374,6 +376,7 @@ PRODUCT_NAME = "libssh2-for-iOS"; SWIFT_OBJC_BRIDGING_HEADER = "libssh2-for-iOS/libssh2-for-iOS-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; @@ -392,6 +395,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "libssh2-for-iOS/libssh2_for_iOS_Prefix.pch"; INFOPLIST_FILE = "libssh2-for-iOS/libssh2_for_iOS-Info.plist"; + INSTALL_PATH = "~/Applications"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -400,6 +404,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "de.x2on.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "libssh2-for-iOS"; SWIFT_OBJC_BRIDGING_HEADER = "libssh2-for-iOS/libssh2-for-iOS-Bridging-Header.h"; + TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -436,7 +441,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; @@ -513,7 +518,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; @@ -585,7 +590,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; @@ -615,7 +620,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; INFOPLIST_FILE = libssh2_Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -628,6 +633,7 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; + SUPPORTS_MACCATALYST = NO; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -666,7 +672,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; @@ -691,7 +697,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; INFOPLIST_FILE = libssh2_Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -703,6 +709,7 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; + SUPPORTS_MACCATALYST = NO; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -713,27 +720,82 @@ C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "include/**"; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + SWIFT_VERSION = 5.0; }; name = Debug; }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "include/**"; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/libssh2-for-iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/libssh2-for-iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/libssh2-for-iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/libssh2-for-iOS.xcodeproj/xcshareddata/xcschemes/libssh2-for-iOS.xcscheme b/libssh2-for-iOS.xcodeproj/xcshareddata/xcschemes/libssh2-for-iOS.xcscheme index bc5ab70..011a092 100644 --- a/libssh2-for-iOS.xcodeproj/xcshareddata/xcschemes/libssh2-for-iOS.xcscheme +++ b/libssh2-for-iOS.xcodeproj/xcshareddata/xcschemes/libssh2-for-iOS.xcscheme @@ -1,6 +1,6 @@ - - - - + + - - > "${LOG}" 2>&1 + fi + + # Remove source dir, add references to library files to relevant arrays + # Keep reference to first build target for include file + finish_build_loop +done diff --git a/with-libgcrypt-prefix.patch b/with-libgcrypt-prefix.patch deleted file mode 100644 index b5a21a4..0000000 --- a/with-libgcrypt-prefix.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- src/libssh2-1.8.0.orig/acinclude.m4 2016-09-27 16:06:35.000000000 +1000 -+++ src/libssh2-1.8.0/acinclude.m4 2017-07-11 15:34:35.000000000 +1000 -@@ -412,9 +412,9 @@ - - old_LDFLAGS=$LDFLAGS - old_CFLAGS=$CFLAGS -- if test -n "$use_libgcrypt" && test "$use_libgcrypt" != "no"; then -- LDFLAGS="$LDFLAGS -L$use_libgcrypt/lib" -- CFLAGS="$CFLAGS -I$use_libgcrypt/include" -+ if test -n "$with_libgcrypt_prefix" && test "$use_libgcrypt" != "no"; then -+ LDFLAGS="$LDFLAGS -L$with_libgcrypt_prefix/lib" -+ CFLAGS="$CFLAGS -I$with_libgcrypt_prefix/include" - fi - AC_LIB_HAVE_LINKFLAGS([gcrypt], [], [ - #include