Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
configure: fix the -ldl check for openssl, add -lpthread check #1427
The check for if -ldl is needed to build with (a statically built)
Reported-by: Jay Satiro
referenced this pull request
Apr 18, 2017
jay left a comment
I'm not sure I follow this, it looks like you've changed the -ldl check to only occur when HMAC_Init_ex link fails. Also at this point there may already be -lssl -lcrypto from pkg-config which seems like we could skip these crypto checks then, like in other words imagine
Yes. When building with a static openssl that requires -ldl, trying to link the library to use HMAC_Init_ex fails. The previous (current) way to check for -ldl is pointless since it will fail to detect openssl completely before even considering the -ldl issue.
Maybe, but I would prefer to have the -ldl and -lpthread checks only get tried when it fails without those libs and I only want to add those specific libs to try to fix the build and not make conclusions or guesses about the other libs that are used or not used.
Hence the flow with this patch goes like this:
I've tested this with a static openssl from their git master and with this fix, it works without any custom LIBS set, but without this patch it will fail to detect a static only openssl completely.