quota-4.03-noldap_linking.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. commit 1d9542df5d2ae5c21a1e96d100f899b3d7b2f27c
  2. Author: Jan Kara <jack@suse.cz>
  3. Date: Tue Jan 19 11:40:15 2016 +0100
  4. Don't link all binaries with ldap library
  5. The default action-if-found of AC_CHECK_LIB() is to append checked
  6. library to LIBS. Thus check for ldap library resulted in unwanted
  7. addition of -lldap to LIBS as [] is an empty string in M4 and the
  8. default action is used.
  9. Fix the problem by providing proper action-if-found which was currently
  10. just hidden behind the check. Also do similar cleanup for
  11. AC_CHECK_HEADER check although there it didn't have any undesired
  12. side-effect.
  13. Reported-by: Petr Písař <petrp@users.sf.net>
  14. Signed-off-by: Jan Kara <jack@suse.cz>
  15. diff --git a/configure.ac b/configure.ac
  16. index 68d5924..d17b18c 100644
  17. --- a/configure.ac
  18. +++ b/configure.ac
  19. @@ -72,18 +72,17 @@ AC_ARG_ENABLE([ldapmail],
  20. [enable_ldapmail=auto]
  21. )
  22. AS_IF([test "x$enable_ldapmail" != "xno"], [
  23. - build_ldap="yes"
  24. - AC_CHECK_LIB([ldap], [ldap_initialize], [], [
  25. + AC_CHECK_LIB([ldap], [ldap_initialize], [
  26. + build_ldap="yes"
  27. + LDAP_LIBS="-lldap -llber"
  28. + AC_DEFINE([USE_LDAP_MAIL_LOOKUP], 1, [Lookup email address using LDAP])
  29. + COMPILE_OPTS="$COMPILE_OPTS USE_LDAP_MAIL_LOOKUP"
  30. + ], [
  31. build_ldap="no"
  32. AS_IF([test "x$enable_ldapmail" = "xyes"], [
  33. AC_MSG_ERROR([LDAP support required but library not found.]);
  34. ])
  35. ])
  36. - AS_IF([test "x$build_ldap" = "xyes"], [
  37. - LDAP_LIBS="-lldap -llber"
  38. - AC_DEFINE([USE_LDAP_MAIL_LOOKUP], 1, [Lookup email address using LDAP])
  39. - COMPILE_OPTS="$COMPILE_OPTS USE_LDAP_MAIL_LOOKUP"
  40. - ])
  41. ], [
  42. build_ldap="no"
  43. ])
  44. @@ -163,8 +162,12 @@ AC_ARG_ENABLE([libwrap],
  45. [enable_libwrap=auto]
  46. )
  47. AS_IF([test "x$enable_libwrap" != "xno"], [
  48. - build_libwrap="yes"
  49. - AC_CHECK_HEADER([tcpd.h],[], [
  50. + AC_CHECK_HEADER([tcpd.h], [
  51. + build_libwrap="yes"
  52. + WRAP_LIBS="-lwrap"
  53. + AC_DEFINE([HOSTS_ACCESS], 1, [Use hosts.allow and hosts.deny for access checking of rpc.rquotad])
  54. + COMPILE_OPTS="$COMPILE_OPTS HOSTS_ACCESS"
  55. + ], [
  56. build_libwrap="no"
  57. AS_IF([test "x$enable_libwrap" = "xyes"] , [
  58. AC_MSG_ERROR([tcpd.h not found and requested])
  59. @@ -172,11 +175,6 @@ AS_IF([test "x$enable_libwrap" != "xno"], [
  60. AC_MSG_WARN([tcpd.h not found])
  61. ])
  62. ])
  63. - AS_IF([test "x$build_libwrap" != "xno"], [
  64. - WRAP_LIBS="-lwrap"
  65. - AC_DEFINE([HOSTS_ACCESS], 1, [Use hosts.allow and hosts.deny for access checking of rpc.rquotad])
  66. - COMPILE_OPTS="$COMPILE_OPTS HOSTS_ACCESS"
  67. - ])
  68. ], [
  69. build_libwrap="no"
  70. ])