Skip to contentSkip to conversation

more robust test for ldap library

PATCH In review Guillaume Rousse 2 participants 2 messages Dec 5, 2008 – Dec 9, 2008 Kernel automounter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 more robust test for ldap library

Hello.

The test for LDAP library wrongly use LDFLAGS to add -lldap to the gcc call. However, when strict linker ordering is in effect, it doesn't work correctly. As described in autoconf documentation, additional libs should be added through LIBS variable instead. The following patch fixes it.

Signature · 3 lines
Guillaume Rousse
Moyens Informatiques - INRIA Futurs
Tel: 01 69 35 69 62
aclocal.m4 +10 -10
diff -Naur --exclude '*~' autofs-5.0.3/aclocal.m4 autofs-5.0.3-fix-ldap-detection/aclocal.m4
@@ -230,9 +230,9 @@
 AC_DEFUN([AF_CHECK_FUNC_LDAP_CREATE_PAGE_CONTROL],
 [AC_MSG_CHECKING(for ldap_create_page_control in -lldap)
 
-# save current ldflags
-af_check_ldap_create_page_control_save_ldflags="$LDFLAGS"
-LDFLAGS="$LDFLAGS -lldap"
+# save current libs
+af_check_ldap_create_page_control_save_libs="$LIBS"
+LIBS="$LIBS -lldap"
 
 AC_TRY_LINK(
   [ #include <ldap.h> ],
@@ -251,8 +251,8 @@
         [Define to 1 if you have the `ldap_create_page_control' function.])
 fi
 
-# restore ldflags
-LDFLAGS="$af_check_ldap_create_page_control_save_ldflags"
+# restore libs
+LIBS="$af_check_ldap_create_page_control_save_libs"
 ])
 
 dnl --------------------------------------------------------------------------
@@ -263,9 +263,9 @@
 AC_DEFUN([AF_CHECK_FUNC_LDAP_PARSE_PAGE_CONTROL],
 [AC_MSG_CHECKING(for ldap_parse_page_control in -lldap)
 
-# save current ldflags
-af_check_ldap_parse_page_control_save_ldflags="$LDFLAGS"
-LDFLAGS="$LDFLAGS -lldap"
+# save current libs
+af_check_ldap_parse_page_control_save_libs="$LIBS"
+LIBS="$LIBS -lldap"
 
 AC_TRY_LINK(
   [ #include <ldap.h> ],
@@ -284,7 +284,7 @@
         [Define to 1 if you have the `ldap_parse_page_control' function.])
 fi
 
-# restore ldflags
-LDFLAGS="$af_check_ldap_parse_page_control_save_ldflags"
+# restore libs
+LIBS="$af_check_ldap_parse_page_control_save_libs"
 ])
 

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

maintainer
#1 lore raw
Quoted 6 lines · Guillaume Rousse

Hello.

The test for LDAP library wrongly use LDFLAGS to add -lldap to the gcc call. However, when strict linker ordering is in effect, it doesn't work correctly. As described in autoconf documentation, additional libs should be added through LIBS variable instead. The following patch fixes it.

Committed to git and posted to kernel.org.

Thanks
Ian