aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-03-11 00:25:10 +0100
committerThomas Schwinge <tschwinge@baylibre.com>2024-03-11 00:25:10 +0100
commit11150fff5e3f12b0186a29978eef2251f25bf33a (patch)
tree862e74aad2e5a9c8e1ae296fbb26961d4db144d2
parentb1617efc6efb47c98e1b209c8907a389e9ee7f2a (diff)
parent161252a84085daad28bbfccd52b6af0926dd7251 (diff)
downloadgcc-11150fff5e3f12b0186a29978eef2251f25bf33a.zip
gcc-11150fff5e3f12b0186a29978eef2251f25bf33a.tar.gz
gcc-11150fff5e3f12b0186a29978eef2251f25bf33a.tar.bz2
Merge commit 'dc17ceb3055f56aa3a59c6ef3ae32043d58502d1^' into HEAD
-rw-r--r--config/pkg.m48
1 files changed, 8 insertions, 0 deletions
diff --git a/config/pkg.m4 b/config/pkg.m4
index 13a8890..7ebf517 100644
--- a/config/pkg.m4
+++ b/config/pkg.m4
@@ -147,6 +147,14 @@ AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+dnl Check whether $pkg_cv_[]$1[]_LIBS works.
+if test $pkg_failed = no; then
+ pkg_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $pkg_cv_[]$1[]_LIBS"
+ AC_TRY_LINK([],[], [], [pkg_failed=yes])
+ LDFLAGS=$pkg_save_LDFLAGS
+fi
+
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])