[libvirt] [PATCH] Put libraries in $LIBS, not $LDFLAGS, during configure tests.

Nix nix at esperi.org.uk
Mon Nov 23 21:28:24 UTC 2009


If libraries go in $LDFLAGS while AC_CHECK_LIBbing, they'll end up in
front of the object file name, which rarely works well. They belong
in $LIBS.
---
 configure.in |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/configure.in b/configure.in
index f735bba..5308364 100644
--- a/configure.in
+++ b/configure.in
@@ -542,14 +542,14 @@ AC_SUBST([LIBXML_LIBS])
 
 dnl xmlURI structure has query_raw?
 old_cflags="$CFLAGS"
-old_ldflags="$LDFLAGS"
+old_libs="$LIBS"
 CFLAGS="$CFLAGS $LIBXML_CFLAGS"
-LDFLAGS="$LDFLAGS $LIBXML_LIBS"
+LIBS="$LIBS $LIBXML_LIBS"
 AC_CHECK_MEMBER([struct _xmlURI.query_raw],
 		[AC_DEFINE([HAVE_XMLURI_QUERY_RAW], [], [Have query_raw field in libxml2 xmlURI structure])],,
 		[#include <libxml/uri.h>])
 CFLAGS="$old_cflags"
-LDFLAGS="$old_ldflags"
+LIBS="$old_libs"
 
 dnl GnuTLS library
 GNUTLS_CFLAGS=
@@ -579,15 +579,15 @@ dnl Old versions of GnuTLS uses types like 'gnutls_session' instead
 dnl of 'gnutls_session_t'.  Try to detect this type if defined so
 dnl that we can offer backwards compatibility.
 old_cflags="$CFLAGS"
-old_ldflags="$LDFLAGS"
+old_libs="$LIBS"
 CFLAGS="$CFLAGS $GNUTLS_CFLAGS"
-LDFLAGS="$LDFLAGS $GNUTLS_LIBS"
+LIBS="$LIBS $GNUTLS_LIBS"
 AC_CHECK_TYPE([gnutls_session],
 	AC_DEFINE([GNUTLS_1_0_COMPAT],[],
 		[enable GnuTLS 1.0 compatibility macros]),,
 	[#include <gnutls/gnutls.h>])
 CFLAGS="$old_cflags"
-LDFLAGS="$old_ldflags"
+LIBS="$old_libs"
 
 
 dnl Cyrus SASL
@@ -685,12 +685,12 @@ if test "x$with_polkit" = "xyes" -o "x$with_polkit" = "xcheck"; then
         [use PolicyKit for UNIX socket access checks])
 
       old_CFLAGS=$CFLAGS
-      old_LDFLAGS=$LDFLAGS
+      old_LIBS=$LIBS
       CFLAGS="$CFLAGS $POLKIT_CFLAGS"
-      LDFLAGS="$LDFLAGS $POLKIT_LIBS"
+      LIBS="$LIBS $POLKIT_LIBS"
       AC_CHECK_FUNCS([polkit_context_is_caller_authorized])
       CFLAGS="$old_CFLAGS"
-      LDFLAGS="$old_LDFLAGS"
+      LIBS="$old_LIBS"
 
       AC_PATH_PROG([POLKIT_AUTH], [polkit-auth])
       if test "x$POLKIT_AUTH" != "x"; then
@@ -1682,20 +1682,19 @@ if test "x$with_hal" = "xyes" -o "x$with_hal" = "xcheck"; then
       [use HAL for host device enumeration])
 
     old_CFLAGS=$CFLAGS
-    old_LDFLAGS=$LDFLAGS
+    old_LIBS=$LIBS
     CFLAGS="$CFLAGS $HAL_CFLAGS"
-    LDFLAGS="$LDFLAGS $HAL_LIBS"
+    LIBS="$LIBS $HAL_LIBS"
     AC_CHECK_FUNCS([libhal_get_all_devices],,[with_hal=no])
     AC_CHECK_FUNCS([dbus_watch_get_unix_fd])
     CFLAGS="$old_CFLAGS"
-    LDFLAGS="$old_LDFLAGS"
+    LIBS="$old_LIBS"
   fi
 fi
 AM_CONDITIONAL([HAVE_HAL], [test "x$with_hal" = "xyes"])
 AC_SUBST([HAL_CFLAGS])
 AC_SUBST([HAL_LIBS])
 
-
 dnl udev/libpciaccess library check for alternate host device enumeration
 UDEV_CFLAGS=
 UDEV_LIBS=
-- 
1.6.5.3.100.g75959




More information about the libvir-list mailing list