summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Goutte-Gattat <dgouttegattat@incenp.org>2022-09-20 22:28:34 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2022-09-21 10:05:41 +0900
commit628cb1a786bd5d420be17c2e9ffd407f4fbf517e (patch)
treeb92df867b2a41bb56f3e16bafd135ffc07723071
parentb5043421d2b3ff5999e88808737ff400bf15b0ee (diff)
downloadlibgpg-error-628cb1a786bd5d420be17c2e9ffd407f4fbf517e.tar.gz
m4: Fix detection of gpgrt's libdir.
* src/gpg-error.m4 (GPGRT_CONFIG): Handle the case where none of the system lib directories contain a pkgconfig subdirectory. -- When we look for gpgrt_libdir, there's a corner case if we had been able to obtain system libdirs (using `cc -print-search-dirs`) *but* none of those system libdirs happen to contain a valid pkgconfig subdirectory (which may be unlikely but can and does happen when cross-compiling). We do test for the case where we have not obtained any system libdir at all, in which case we fallback to `${gpgrt_prefix}/lib` (`possible_libdir1`), but we do not test if the list of libdir candidates is reduced to nothing after we have eliminated all the libdirs that do not contain a pkgconfig subdirectory. This patch adds a test for this precise case. Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
-rw-r--r--src/gpg-error.m46
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gpg-error.m4 b/src/gpg-error.m4
index 4b5cd40..a975e53 100644
--- a/src/gpg-error.m4
+++ b/src/gpg-error.m4
@@ -10,7 +10,7 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# Last-changed: 2022-02-15
+# Last-changed: 2022-09-21
dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
@@ -120,6 +120,10 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
fi
if test -n "$gpgrt_libdir"; then break; fi
done
+ if test -z "$libdir_candidates"; then
+ # No valid pkgconfig dir in any of the system directories, fallback
+ gpgrt_libdir=${possible_libdir1}
+ fi
else
# When we cannot determine system libdir-format, use this:
gpgrt_libdir=${possible_libdir1}