mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
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.
This commit is contained in:
@@ -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.])
|
||||
|
||||
Reference in New Issue
Block a user