From c77cba373a7c23a4398980c229da1c42197b9385 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 30 Mar 2022 11:21:44 -0600 Subject: [PATCH] --enable-openssl: don't add non-existent directories to PKG_CONFIG_LIBDIR --- configure | 14 +++++++++++--- configure.ac | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 3b2a3efd8..e549f1be4 100755 --- a/configure +++ b/configure @@ -23522,8 +23522,16 @@ openssl_missing=no if test "${enable_openssl-no}" != no; then # Use pkg-config to find the openssl cflags and libs if possible. if test "$enable_openssl" != "yes" -a "$enable_openssl" != "maybe"; then - PKG_CONFIG_LIBDIR="${enable_openssl}/lib/pkgconfig:${enable_openssl}/lib64/pkgconfig:${enable_openssl}/share/pkgconfig" - export PKG_CONFIG_LIBDIR + PKG_CONFIG_LIBDIR= + for d in ${enable_openssl}/*/pkgconfig; do + if test -d "$d"; then + PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:$d" + fi + done + if test -n "$PKG_CONFIG_LIBDIR"; then + PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR#:} + export PKG_CONFIG_LIBDIR + fi elif test "$cross_compiling" = "yes" -a -z "$PKG_CONFIG"; then # Cannot use pkg-config when cross-compiling PKG_CONFIG=false @@ -24294,7 +24302,7 @@ fi LDFLAGS="$O_LDFLAGS" fi if test "$enable_openssl" != "yes" -a "$enable_openssl" != "maybe"; then - unset PKG_CONFIG_LIBDIRS + unset PKG_CONFIG_LIBDIR fi fi if test "${enable_openssl-no}" != no; then diff --git a/configure.ac b/configure.ac index c80b8dd9f..7146a0d0a 100644 --- a/configure.ac +++ b/configure.ac @@ -2996,8 +2996,16 @@ openssl_missing=no if test "${enable_openssl-no}" != no; then # Use pkg-config to find the openssl cflags and libs if possible. if test "$enable_openssl" != "yes" -a "$enable_openssl" != "maybe"; then - PKG_CONFIG_LIBDIR="${enable_openssl}/lib/pkgconfig:${enable_openssl}/lib64/pkgconfig:${enable_openssl}/share/pkgconfig" - export PKG_CONFIG_LIBDIR + PKG_CONFIG_LIBDIR= + for d in ${enable_openssl}/*/pkgconfig; do + if test -d "$d"; then + PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:$d" + fi + done + if test -n "$PKG_CONFIG_LIBDIR"; then + PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR#:} + export PKG_CONFIG_LIBDIR + fi elif test "$cross_compiling" = "yes" -a -z "$PKG_CONFIG"; then # Cannot use pkg-config when cross-compiling PKG_CONFIG=false @@ -3111,7 +3119,7 @@ if test "${enable_openssl-no}" != no; then LDFLAGS="$O_LDFLAGS" fi if test "$enable_openssl" != "yes" -a "$enable_openssl" != "maybe"; then - unset PKG_CONFIG_LIBDIRS + unset PKG_CONFIG_LIBDIR fi fi dnl