diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-07-28 03:50:10 -0700 |
---|---|---|
committer | Arsen Arsenović <arsen@gcc.gnu.org> | 2023-08-07 22:59:41 +0200 |
commit | de9e7e9e4afb956710293ef73f6b53c41e10fcd4 (patch) | |
tree | 122a2f2af3ae4a1f287a4c134072503c80c1c5ba /config | |
parent | 9fc0ae6033f3e41c9b4605531a6a8543414b0d2d (diff) | |
download | gcc-de9e7e9e4afb956710293ef73f6b53c41e10fcd4.zip gcc-de9e7e9e4afb956710293ef73f6b53c41e10fcd4.tar.gz gcc-de9e7e9e4afb956710293ef73f6b53c41e10fcd4.tar.bz2 |
PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works
It is quite normal to have headers without library on multilib OSes.
Add AC_TRY_LINK to PKG_CHECK_MODULES to check if $pkg_cv_[]$1[]_LIBS
works.
config/ChangeLog:
* pkg.m4 (PKG_CHECK_MODULES): Add AC_TRY_LINK to check if
$pkg_cv_[]$1[]_LIBS works.
Diffstat (limited to 'config')
-rw-r--r-- | config/pkg.m4 | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/config/pkg.m4 b/config/pkg.m4 index 13a8890..45587e9 100644 --- a/config/pkg.m4 +++ b/config/pkg.m4 @@ -147,6 +147,12 @@ 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. +pkg_save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS $pkg_cv_[]$1[]_LIBS" +AC_TRY_LINK([],[return 0;], [pkg_failed=no], [pkg_failed=yes]) +LDFLAGS=$pkg_save_LDFLAGS + 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.]) |