curl icon indicating copy to clipboard operation
curl copied to clipboard

iOS build on macOS 14 configure: error: --with-openssl was given but OpenSSL could not be detected

Open sanctor opened this issue 2 years ago • 6 comments
trafficstars

I did this

HOST="arm-apple-darwin"
ARCH="arm64"
GCC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
SDK="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
MOREFLAGS=""
OUT_DIR="$(pwd)/build"
export IPHONEOS_DEPLOYMENT_TARGET="13.0"
export CC=${GCC}
export CFLAGS="-arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot ${SDK} ${CFLAGS}"
export CPPFLAGS="${MOREFLAGS} ${CPPFLAGS}"
export LDFLAGS="-arch ${ARCH} -isysroot ${SDK} ${LDFLAGS}"
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl/lib/pkgconfig"
./configure --disable-shared --enable-static --with-openssl --host=${HOST} --prefix="${OUT_DIR}" --enable-threaded-resolver
make -j 10 
make install

Result:

checking for arm-apple-darwin-pkg-config... /opt/homebrew/bin/pkg-config checking for openssl options with pkg-config... found configure: pkg-config: SSL_LIBS: "-lssl -lcrypto" configure: pkg-config: SSL_LDFLAGS: "-L/opt/homebrew/Cellar/openssl@3/3.1.3/lib" configure: pkg-config: SSL_CPPFLAGS: "-I/opt/homebrew/Cellar/openssl@3/3.1.3/include" checking for HMAC_Update in -lcrypto... no checking for HMAC_Init_ex in -lcrypto... no checking OpenSSL linking with -ldl... no checking OpenSSL linking with -ldl and -lpthread... no configure: OPT_OPENSSL: yes configure: OPENSSL_ENABLED: configure: error: --with-openssl was given but OpenSSL could not be detected

For some reason function HMAC_Init_ex is not detected 🫤

I expected the following

successful build

curl/libcurl version

libcurl 8.4.0

operating system

macOS 14 Sonoma

sanctor avatar Oct 20 '23 17:10 sanctor

Please see if https://github.com/curl/curl/pull/11436 might resolve your issue.

icing avatar Oct 20 '23 17:10 icing

Unfortunately, same "configure: error: --with-openssl was given but OpenSSL could not be detected" is appear :( I have Apple Silicone, so my openssl is in /opt/homebrew/opt/openssl

sanctor avatar Oct 21 '23 14:10 sanctor

When configure fails to do what you expected it to, for example to find the libraries you wanted it to find, then the standard next step is to open config.log in a text editor, search for the library/test that didn't go the way you expected and see what you can figure out based on that.

We've learned that this is a very effective way and reading this file often reveals details that can take you further in debugging your build/configure issue.

bagder avatar Nov 24 '23 07:11 bagder

I have Apple Silicone, so my openssl is in /opt/homebrew/opt/openssl

Your pkg-config file says it is in /opt/homebrew/Cellar/openssl@3/3.1.3 ...

bagder avatar Nov 24 '23 07:11 bagder

I have Apple Silicone, so my openssl is in /opt/homebrew/opt/openssl

Your pkg-config file says it is in /opt/homebrew/Cellar/openssl@3/3.1.3 ...

pkg-config --libs openssl         
-L/opt/homebrew/Cellar/openssl@3/3.1.4/lib -lssl -lcrypto

sanctor avatar Nov 24 '23 09:11 sanctor

There have been no signs provided in this report of this actually being a curl problem.

bagder avatar Nov 30 '23 16:11 bagder