From 605c5933a08b645594a67df7aa9794ed3c163078 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Jun 24 2015 18:32:12 +0000 Subject: Save and restore LDFLAGS while performing tests Save and restore LDFLAGS around tests that involve linking in configure, alongside CFLAGS and LIBS, which we were already doing. --- diff --git a/configure.ac b/configure.ac index 3f7ca8f..9364007 100644 --- a/configure.ac +++ b/configure.ac @@ -45,11 +45,14 @@ AC_SUBST(DBUS_INTROSPECTION_METHOD) pam=yes AC_CHECK_HEADERS(security/pam_modules.h) +savedLDFLAGS="$LDFLAGS" +LDFLAGS= savedLIBS="$LIBS" LIBS= AC_CHECK_FUNCS([pam_get_user pam_get_item],,[AC_CHECK_LIB(pam,pam_get_user,,pam=no)]) PAM_LIBS="$LIBS" LIBS="$savedLIBS" +LDFLAGS="$savedLDFLAGS" AC_SUBST(PAM_LIBS) AM_CONDITIONAL(BUILD_PAM,test x$pam = xyes) @@ -146,8 +149,10 @@ SELINUX_LIBS= if test x$selinux_labels != xno ; then CFLAGsave="$CFLAGS" LIBsave="$LIBS" + LDFLAGSsave="$LDFLAGS" CFLAGS= LIBS= + LDFLAGS= if test -d $withval ; then CFLAGS="-I$withval/include" LIBS="-L$withval/`basename $libdir`" @@ -186,6 +191,7 @@ if test x$selinux_labels != xno ; then SELINUX_LIBS="$LIBS" CFLAGS="$CFLAGsave" LIBS="$LIBsave" + LDFLAGS="$LDFLAGSsave" fi # # Even if we have libselinux, D-BUS itself might not be able to give us the