Give iOS the same openssl build treatment as android and mingw. #11

This commit is contained in:
Cory McWilliams 2024-02-21 20:23:35 -05:00
parent c01e00d77d
commit 4bfd9de100
2 changed files with 18 additions and 10 deletions

View File

@ -838,6 +838,13 @@ $(WINDOWS_DEPS):
$(filter $(BUILD_DIR)/win%,$(APP_OBJS)): | $(WINDOWS_DEPS)
endif
ifeq ($(UNAME_S),Darwin)
IOS_DEPS := deps/openssl/ios/usr/local/lib/libssl.a
$(IOS_DEPS):
+@tools/ssl-ios
$(filter $(BUILD_DIR)/ios%,$(APP_OBJS)): | $(IOS_DEPS)
endif
clean:
rm -rf $(BUILD_DIR)
.PHONY: clean

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
OPENSSL_VERSION=3.2.1
@ -8,17 +8,17 @@ BUILD_DIR=out/openssl_ios_build
BUILD_TARGETS="ios64-xcrun iossimulator-xcrun"
rm -rfv openssl-${OPENSSL_VERSION}
rm -rfv out/openssl-${OPENSSL_VERSION}
if [ ! -d openssl-${OPENSSL_VERSION} ]
if [ ! -d out/openssl-${OPENSSL_VERSION} ]
then
if [ ! -f openssl-${OPENSSL_VERSION}.tar.gz ]
if [ ! -f out/openssl-${OPENSSL_VERSION}.tar.gz ]
then
curl https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz -o openssl-${OPENSSL_VERSION}.tar.gz || exit 128
curl https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz -o out/openssl-${OPENSSL_VERSION}.tar.gz || exit 128
fi
tar xzf openssl-${OPENSSL_VERSION}.tar.gz || exit 128
tar -C out/ -xzf out/openssl-${OPENSSL_VERSION}.tar.gz || exit 128
fi
WORK_DIR=openssl-${OPENSSL_VERSION}
WORK_DIR=out/openssl-${OPENSSL_VERSION}
##### export ndk directory. Required by openssl-build-scripts #####
@ -37,7 +37,8 @@ build_the_thing() {
for build_target in $BUILD_TARGETS
do
echo "Building $build_target"
cd $WORK_DIR || exit 128
pwd
pushd $WORK_DIR || exit 128
case $build_target in
ios64-xcrun)
@ -58,11 +59,11 @@ do
rm -rf $DESTDIR
build_the_thing
cd ..
popd
#### copy libraries and includes to output-directory #####
echo WORK_DIR=$WORK_DIR
rm -rf deps/openssl/ios/$build_target/
mkdir -p deps/openssl/ios/$build_target/usr/local/include
mkdir -p deps/openssl/ios/$build_target/usr/local/include/
mkdir -p deps/openssl/ios/$build_target/usr/local/lib/
cp -R $WORK_DIR/include/* deps/openssl/ios/$build_target/usr/local/include/
cp $WORK_DIR/*.a deps/openssl/ios/$build_target/usr/local/lib/