All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] fix ldap capacities detection
@ 2008-07-02 11:35 Guillaume Rousse
  0 siblings, 0 replies; only message in thread
From: Guillaume Rousse @ 2008-07-02 11:35 UTC (permalink / raw)
  To: autofs

[-- Attachment #1: Type: text/plain, Size: 810 bytes --]

When using -Wl,-a-s-needed linker flags (which is becoming the standard 
in most linux distributions), compilation will fail if -lldap is passed 
before the test file in gcc command:
[guillomovitch@n2 autofs]$ gcc -o conftest -O2 -g -pipe 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -fstack-protector-all -fomit-frame-pointer 
-march=i586 -mtune=generic -fasynchronous-unwind-tables
-Wl,--as-needed -Wl,--no-undefined -lldap conftest.c
/home/guillomovitch/tmp/ccsbs3BH.o: In function `main':
/home/guillomovitch/cooker/autofs/BUILD/autofs-5.0.3/conftest.c:45: 
undefined reference to `ldap_create_page_control'

The proper solution is to pass -lldap trough $LIBS variable instead of 
$LDFLAGS.
-- 
Guillaume Rousse
Moyens Informatiques - INRIA Futurs
Tel: 01 69 35 69 62

[-- Attachment #2: autofs-5.0.3-fix-ldap-detection.patch --]
[-- Type: text/x-patch, Size: 1583 bytes --]

diff -Naur --exclude '*~' autofs-5.0.3/aclocal.m4 autofs-5.0.3-fix-ldap-detection/aclocal.m4
--- autofs-5.0.3/aclocal.m4	2008-07-02 13:26:00.000000000 +0200
+++ autofs-5.0.3-fix-ldap-detection/aclocal.m4	2008-07-02 13:28:04.000000000 +0200
@@ -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"
 ])
 

[-- Attachment #3: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-02 11:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-02 11:35 [patch] fix ldap capacities detection Guillaume Rousse

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.