mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-23 02:44:18 +08:00
PKG_CHECK_MODULES: Properly check if $pkg_cv_[]$1[]_LIBS works
There is no need to check $pkg_cv_[]$1[]_LIBS works if package check failed. config/ChangeLog: * pkg.m4 (PKG_CHECK_MODULES): Use AC_TRY_LINK only if $pkg_failed = no.
This commit is contained in:
parent
de9e7e9e4a
commit
161252a840
@ -148,10 +148,12 @@ _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
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user