Join GitHub today
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
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
-lpthread -ldl -lcrypto -lssl -lcrypto
but -ldl should come after -lssl shouldn't it?
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.