autofs-5.0.4 - fix ldap detection From: Guillaume Rousse 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. --- aclocal.m4 | 20 ++++++++++---------- configure | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index bb0ab21..ab11112 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -246,9 +246,9 @@ dnl -------------------------------------------------------------------------- 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 ], @@ -267,8 +267,8 @@ if test "$af_have_ldap_create_page_control" = "yes"; then [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 -------------------------------------------------------------------------- @@ -279,9 +279,9 @@ dnl -------------------------------------------------------------------------- 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 ], @@ -300,7 +300,7 @@ if test "$af_have_ldap_create_page_control" = "yes"; then [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" ]) diff --git a/configure b/configure index ed17660..afa692c 100755 --- a/configure +++ b/configure @@ -4608,9 +4608,9 @@ _ACEOF { echo "$as_me:$LINENO: checking for ldap_create_page_control in -lldap" >&5 echo $ECHO_N "checking for ldap_create_page_control in -lldap... $ECHO_C" >&6; } -# 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" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4672,15 +4672,15 @@ _ACEOF fi -# restore ldflags -LDFLAGS="$af_check_ldap_create_page_control_save_ldflags" +# restore libs +LIBS="$af_check_ldap_create_page_control_save_libs" { echo "$as_me:$LINENO: checking for ldap_parse_page_control in -lldap" >&5 echo $ECHO_N "checking for ldap_parse_page_control in -lldap... $ECHO_C" >&6; } -# 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" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4742,8 +4742,8 @@ _ACEOF fi -# restore ldflags -LDFLAGS="$af_check_ldap_parse_page_control_save_ldflags" +# restore libs +LIBS="$af_check_ldap_parse_page_control_save_libs" fi