All the above solutions didn't work for me, so I went on and tried to fix it for my system running Mac OSX 10.15.4.
In my case this is where the above solutions stopped working for me:
no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.4.sdk' [-Wmissing-sysroot]
I read through the build-libssl.sh file noticed that the sdk version was taken by the script using the code:
xcrun -sdk macosx --show-sdk-version
which on my system does return:
10.15.4
Using finder an navigating to the location:
'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
did show me there was indeed no MacOSX10.15.4.sdk. There was however a MacOSX10.14.sdk. I did use this knowledge to come up with the following solution:
OpenSSL version <= 1.0 (1.0.2l)
versions <= 1.0 should only use --arch, not --target !
git clone [email protected]:marcelosalloum/OpenSSL-for-iPhone.git --branch feature/mac-catalyst && \
cd OpenSSL-for-iPhone && \
./build-libssl.sh --arch="MacOSX_x86_64 i386 arm64 armv7s armv7 tv_x86_64 tv_arm64" --macosx-sdk=10.15 --version="1.0.2l"
OpenSSL version >= 1.1 (1.1.0) currently not functional
versions >= 1.1 should only use --target, not --arch !
git clone [email protected]:marcelosalloum/OpenSSL-for-iPhone.git --branch feature/mac-catalyst && \
cd OpenSSL-for-iPhone && \
./build-libssl.sh --targets="mac-catalyst-x86_64 ios-sim-cross-i386 ios64-cross-arm64 ios-cross-armv7s ios-cross-armv7 tvos-sim-cross-x86_64 tvos64-cross-arm64" --macosx-sdk=10.15 --version="1.1.0" -v