summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@sudo.ws>2022-04-04 10:13:28 -0600
committerTodd C. Miller <Todd.Miller@sudo.ws>2022-04-04 10:13:28 -0600
commit9aecc74eac3bc3102a18be894f27491d49107c3a (patch)
treea5c656ef02b4d0e8047ec84989b32127191ef875 /configure.ac
parent742b8f544a6d69e23f70b1d5b53862e30432bea9 (diff)
downloadsudo-9aecc74eac3bc3102a18be894f27491d49107c3a.tar.gz
Fix check for EVP_MD_CTX_new() when -pthread is in Libs.private.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 17 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index c2a69d28e..268cdb033 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3020,6 +3020,7 @@ if test "${enable_openssl-no}" != no; then
fi
# Check whether --static is needed (don't assume name of ssl lib)
+ # There may be dependent libraries or -pthread.
O_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs-only-L $pkg_openssl`"
libssl="`$PKG_CONFIG --libs-only-l $pkg_openssl | sed 's/^ *-l//'`"
@@ -3043,10 +3044,22 @@ if test "${enable_openssl-no}" != no; then
if $PKG_CONFIG --exists $pkg_libcrypto >/dev/null 2>&1; then
# Use OpenSSL's sha2 functions if possible (don't assume name of crypto)
O_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS `$PKG_CONFIG $STATIC --libs-only-L $pkg_openssl`"
- libcrypto="`$PKG_CONFIG $STATIC --libs-only-l $pkg_libcrypto | sed 's/^ *-l//'`"
- libcrypto_extra="`echo $libcrypto | sed 's/^[[^ ]]* *//'`"
- libcrypto="`echo $libcrypto | sed 's/ .*//'`"
+ libcrypto=
+ libcrypto_extra=
+ for f in `$PKG_CONFIG $STATIC --libs $pkg_libcrypto`; do
+ case "$f" in
+ -l*)
+ if test -z "$libcrypto"; then
+ libcrypto="${f#-l}"
+ else
+ libcrypto_extra="$libcrypto_extra $f"
+ fi
+ ;;
+ *)
+ AX_APPEND_FLAG([$f], [LDFLAGS])
+ ;;
+ esac
+ done
AC_CHECK_LIB($libcrypto, EVP_MD_CTX_new, [DIGEST=digest_openssl.lo], [], [$libcrypto_extra])
LDFLAGS="$O_LDFLAGS"