Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sanctor opened this issue Oct 20, 2023 · 6 comments

Comments

@sanctor
Copy link

sanctor commented Oct 20, 2023

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

@icing
Copy link
Contributor

icing commented Oct 20, 2023

Please see if #11436 might resolve your issue.

@sanctor
Copy link
Author

sanctor commented Oct 21, 2023

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

@bagder
Copy link
Member

bagder commented Nov 24, 2023

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
Copy link
Member

bagder commented Nov 24, 2023

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 ...

@sanctor
Copy link
Author

sanctor commented Nov 24, 2023

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

@bagder
Copy link
Member

bagder commented Nov 30, 2023

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

@bagder bagder closed this as completed Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants