Skip to content

Commit 327e548

Browse files
committed
Build system update
1 parent b602104 commit 327e548

File tree

4 files changed

+41
-30
lines changed

4 files changed

+41
-30
lines changed

Diff for: script/ios_build_functions.sh

+3-10
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function setup_build_environment ()
3939
CAN_BUILD_64BIT="1"
4040
fi
4141

42-
ARCHS="i386 armv7 armv7s"
42+
ARCHS="armv7 armv7s"
4343
if [ "${CAN_BUILD_64BIT}" -eq "1" ]
4444
then
4545
# For some stupid reason cmake needs simulator
@@ -72,20 +72,13 @@ function build_all_archs ()
7272
do
7373
if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ]
7474
then
75-
PLATFORM="iphonesimulator"
75+
PLATFORM="iPhoneSimulator"
7676
else
77-
PLATFORM="iphoneos"
77+
PLATFORM="iPhoneOS"
7878
fi
7979

8080
SDKVERSION=$(ios_sdk_version)
8181

82-
if [ "${ARCH}" == "arm64" ]
83-
then
84-
HOST="aarch64-apple-darwin"
85-
else
86-
HOST="${ARCH}-apple-darwin"
87-
fi
88-
8982
SDKNAME="${PLATFORM}${SDKVERSION}"
9083
SDKROOT="$(ios_sdk_path ${SDKNAME})"
9184

Diff for: script/update_libgit2_ios

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function build_libgit2 ()
4646
-DCMAKE_INSTALL_PREFIX:PATH="${ARCH_INSTALL_PATH}/" \
4747
-DBUILD_CLAR:BOOL=OFF \
4848
-DTHREADSAFE:BOOL=ON \
49-
-DCURL:BOOL=OFF \
49+
-DREGEX_BACKEND=builtin \
5050
-DCMAKE_C_FLAGS:STRING="-fembed-bitcode" \
5151
"${SYS_ROOT}" \
5252
-DCMAKE_OSX_ARCHITECTURES:STRING="${ARCH}" \

Diff for: script/update_libssh2_ios

+8-1
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,18 @@ function build_ssh2 ()
2121
cp -R "${ROOT_PATH}/External/libssh2" "${ARCH_INSTALL_PATH}/libssh2"
2222
pushd "${ARCH_INSTALL_PATH}/libssh2" > /dev/null
2323

24+
if [ "${ARCH}" == "arm64" ]
25+
then
26+
HOST="aarch64-apple-darwin"
27+
else
28+
HOST="${ARCH}-apple-darwin"
29+
fi
30+
2431
export CFLAGS="-arch ${ARCH} -fembed-bitcode -pipe -no-cpp-precomp -isysroot ${SDKROOT} -miphoneos-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"
2532
export CPPFLAGS="-arch ${ARCH} -fembed-bitcode -pipe -no-cpp-precomp -isysroot ${SDKROOT} -miphoneos-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"
2633

2734
./buildconf >> "${LOG}" 2>&1
28-
./configure --host=${HOST} --prefix="${ARCH_INSTALL_PATH}" --with-openssl --with-libssl-prefix="${INSTALL_PATH}" --disable-shared --enable-static >> "${LOG}" 2>&1
35+
./configure --host=${HOST} --prefix="${ARCH_INSTALL_PATH}" --with-libssl-prefix="${INSTALL_PATH}" --disable-shared --enable-static >> "${LOG}" 2>&1
2936
make >> "${LOG}" 2>&1
3037
make install >> "${LOG}" 2>&1
3138
popd > /dev/null

Diff for: script/update_libssl_ios

+29-18
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,39 @@ function setup ()
2121

2222
function build_ssl ()
2323
{
24-
cp -r "${ROOT_PATH}/External/openssl" "${ARCH_INSTALL_PATH}/openssl"
25-
pushd "${ARCH_INSTALL_PATH}/openssl" > /dev/null
24+
if [ -f "${ARCH_INSTALL_PATH}/lib/libssl.a" -a \
25+
-f "${ARCH_INSTALL_PATH}/lib/libcrypto.a" ]; then
26+
echo "No building needed." 2>&1
27+
else
2628

27-
if [ "${ARCH}" == "arm64" ] || [ "${ARCH}" == "x86_64" ]
28-
then
29-
HOST="BSD-generic64"
30-
CONFIG="no-gost no-asm enable-ec_nistp_64_gcc_128"
31-
else
32-
HOST="BSD-generic32"
33-
CONFIG="no-gost no-asm"
34-
perl -i -pe 's|static volatile sig_atomic_t intr_signal|static volatile int intr_signal|' crypto/ui/ui_openssl.c
35-
fi
29+
cp -r "${ROOT_PATH}/External/openssl" "${ARCH_INSTALL_PATH}/openssl"
30+
pushd "${ARCH_INSTALL_PATH}/openssl" > /dev/null
3631

37-
./Configure ${HOST} ${CONFIG} --openssldir="${ARCH_INSTALL_PATH}" >> "${LOG}" 2>&1
38-
perl -i -pe "s|^CC= gcc|CC= ${CLANG} -miphoneos-version-min=${IPHONEOS_DEPLOYMENT_TARGET} -arch ${ARCH} -fembed-bitcode |g" Makefile >> "${LOG}" 2>&1
39-
perl -i -pe "s|^CFLAG= (.*)|CFLAG= -isysroot ${SDKROOT} \$1|g" Makefile >> "${LOG}" 2>&1
40-
make >> "${LOG}" 2>&1
32+
if [ "${ARCH}" == "x86_64" ]; then
33+
HOST="iossimulator-xcrun"
34+
CONFIG=""
35+
elif [ "${ARCH}" == "arm64" ]; then
36+
HOST="ios64-cross"
37+
CONFIG=""
38+
elif [ "${ARCH}" == "armv7" ] || [ "${ARCH}" == "armv7s" ]; then
39+
HOST="ios-cross"
40+
CONFIG=""
41+
else
42+
echo "Unhandled ARCH: ${ARCH}"
43+
exit -1
44+
fi
4145

42-
make install_sw >> "${LOG}" 2>&1
43-
popd > /dev/null
46+
echo "./Configure ${HOST} ${CONFIG} --prefix=\"${ARCH_INSTALL_PATH}\" --openssldir=\"${ARCH_INSTALL_PATH}\" >> \"${LOG}\" 2>&1"
47+
./Configure ${HOST} ${CONFIG} --prefix=${ARCH_INSTALL_PATH} --openssldir="${ARCH_INSTALL_PATH}" >> "${LOG}" 2>&1
48+
perl -i -pe "s|^CFLAGS=(.*)|CFLAGS= -arch ${ARCH} -miphoneos-version-min=${IPHONEOS_DEPLOYMENT_TARGET} -isysroot ${SDKROOT} -fembed-bitcode \$1|g" Makefile >> "${LOG}" 2>&1
49+
perl -i -pe "s|-arch (\w+)|-arch ${ARCH}|g" Makefile >> "${LOG}" 2>&1
50+
make >> "${LOG}" 2>&1
4451

45-
rm -rf "${ARCH_INSTALL_PATH}/openssl"
52+
make install_sw >> "${LOG}" 2>&1
53+
popd > /dev/null
54+
55+
rm -rf "${ARCH_INSTALL_PATH}/openssl"
56+
fi
4657

4758
BUILT_CRYPTO_PATHS+=("${ARCH_INSTALL_PATH}/lib/libcrypto.a")
4859
BUILT_SSL_PATHS+=("${ARCH_INSTALL_PATH}/lib/libssl.a")

0 commit comments

Comments
 (0)