0012-dhcp-correct-the-intention-for-xml2-lib-search.patch 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. From 501543b3ef715488a142e3d301ff2733aa33eec7 Mon Sep 17 00:00:00 2001
  2. From: Awais Belal <awais_belal@mentor.com>
  3. Date: Wed, 25 Oct 2017 21:00:05 +0500
  4. Subject: [PATCH] dhcp: correct the intention for xml2 lib search
  5. A missing case breaks the build when libxml2 is
  6. required and found appropriately. The third argument
  7. to the function AC_SEARCH_LIB is action-if-found which
  8. was mistakenly been used for the case where the library
  9. is not found and hence breaks the configure phase
  10. where it shoud actually pass.
  11. We now pass on silently when action-if-found is
  12. executed.
  13. Upstream-Status: Pending
  14. Signed-off-by: Awais Belal <awais_belal@mentor.com>
  15. ---
  16. configure.ac | 2 +-
  17. 1 file changed, 1 insertion(+), 1 deletion(-)
  18. Index: dhcp-4.4.3/configure.ac
  19. ===================================================================
  20. --- dhcp-4.4.3.orig/configure.ac
  21. +++ dhcp-4.4.3/configure.ac
  22. @@ -1,5 +1,7 @@
  23. AC_INIT([DHCP],[4.4.3],[dhcp-users@isc.org])
  24. +# for libtool
  25. +AC_CONFIG_MACRO_DIR([m4])
  26. # we specify "foreign" to avoid having to have the GNU mandated files,
  27. # like AUTHORS, COPYING, and such
  28. @@ -60,7 +62,6 @@ AC_SUBST(BINDCONFIG)
  29. # Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
  30. AC_USE_SYSTEM_EXTENSIONS
  31. -AC_PROG_RANLIB
  32. AC_PATH_PROG(AR, ar)
  33. AC_SUBST(AR)
  34. @@ -603,10 +604,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
  35. # Look for optional headers.
  36. AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
  37. -# find an MD5 library
  38. -AC_SEARCH_LIBS(MD5_Init, [crypto])
  39. -AC_SEARCH_LIBS(MD5Init, [crypto])
  40. -
  41. # Solaris needs some libraries for functions
  42. AC_SEARCH_LIBS(socket, [socket])
  43. AC_SEARCH_LIBS(inet_ntoa, [nsl])
  44. @@ -633,17 +630,6 @@ if test "$have_nanosleep" = "rt"; then
  45. LIBS="-lrt $LIBS"
  46. fi
  47. -AC_ARG_WITH(libxml2,
  48. - AS_HELP_STRING([--with-libxml2], [link against libxml2. this is needed if bind was built with xml2 support enabled]),
  49. - with_libxml2="$withval", with_libxml2="no")
  50. -
  51. -if test x$with_libxml2 != xno; then
  52. - AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],
  53. - [if test x$with_libxml2 != xauto; then
  54. - AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
  55. - fi])
  56. -fi
  57. -
  58. # check for /dev/random (declares ISC_PATH_RANDOMDEV)
  59. AC_MSG_CHECKING(for random device)
  60. AC_ARG_WITH(randomdev,
  61. @@ -806,22 +792,22 @@ no)
  62. if test ! -d "$use_libbind"; then
  63. AC_MSG_ERROR([Cannot find bind directory at $use_libbind])
  64. fi
  65. - if test ! -d "$use_libbind/include" -o \
  66. - ! -f "$use_libbind/include/isc/buffer.h"
  67. + if test ! -d "$use_libbind/$includedir" -o \
  68. + ! -f "$use_libbind/$includedir/isc/buffer.h"
  69. then
  70. - AC_MSG_ERROR([Cannot find bind includes at $use_libbind/include])
  71. + AC_MSG_ERROR([Cannot find bind includes at $use_libbind/$includedir])
  72. fi
  73. - if test ! -d "$use_libbind/lib" -o \
  74. - \( ! -f "$use_libbind/lib/libisc.a" -a \
  75. - ! -f "$use_libbind/lib/libisc.la" \)
  76. + if test ! -d "$use_libbind/$libdir" -o \
  77. + \( ! -f "$use_libbind/$libdir/libisc.a" -a \
  78. + ! -f "$use_libbind/$libdir/libisc.la" \)
  79. then
  80. - AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/lib])
  81. + AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/$libdir])
  82. fi
  83. BINDDIR="$use_libbind"
  84. - BINDLIBIRSDIR="$BINDDIR/lib"
  85. - BINDLIBDNSDIR="$BINDDIR/lib"
  86. - BINDLIBISCCFGDIR="$BINDDIR/lib"
  87. - BINDLIBISCDIR="$BINDDIR/lib"
  88. + BINDLIBIRSDIR="$BINDDIR/$libdir"
  89. + BINDLIBDNSDIR="$BINDDIR/$libdir"
  90. + BINDLIBISCCFGDIR="$BINDDIR/$libdir"
  91. + BINDLIBISCDIR="$BINDDIR/$libdir"
  92. DISTCHECK_LIBBIND_CONFIGURE_FLAG="--with-libbind=$use_libbind"
  93. ;;
  94. esac
  95. @@ -849,39 +835,38 @@ case "$build_os" in
  96. esac
  97. want_libtool="no"
  98. +LT_INIT
  99. +want_libtool="yes"
  100. BINDLT=
  101. DISTCHECK_LIBTOOL_CONFIGURE_FLAG=
  102. AC_ARG_ENABLE(libtool,
  103. AS_HELP_STRING([--enable-libtool],
  104. -[use GNU libtool for dynamic shared libraries (default is no).]),
  105. +[use GNU libtool for dynamic shared libraries (default is yes).]),
  106. want_libtool="$enableval")
  107. if test "$use_libbind" != "no"; then
  108. if test "$want_libtool" = "yes" -a \
  109. - ! -f "$use_libbind/lib/libisc.la"
  110. + ! -f "$use_libbind/$libdir/libisc.la"
  111. then
  112. - AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/lib])
  113. + AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/$libdir])
  114. fi
  115. if test "$want_libtool" = "no" -a \
  116. - ! -f "$use_libbind/lib/libisc.a"
  117. + ! -f "$use_libbind/$libdir/libisc.a"
  118. then
  119. - AC_MSG_ERROR([Cannot find static libraries at $use_libbind/lib])
  120. + AC_MSG_ERROR([Cannot find static libraries at $use_libbind/$libdir])
  121. fi
  122. fi
  123. -
  124. -if test "$want_libtool" = "yes"; then
  125. - AC_MSG_WARN([legacy configure is used but libtool is enabled. Trying to recover...])
  126. - # expand $ac_configure_args
  127. - eval "set my_configure_args $ac_configure_args"
  128. - shift
  129. - cd $srcdir; exec ./config+lt "$@"
  130. - AC_MSG_ERROR([Recovering failed])
  131. +if test "$want_libtool" = "no"; then
  132. + AC_MSG_ERROR([libtool configure is used but libtool is disabled?])
  133. fi
  134. -DHLIBS=LIBRARIES
  135. -A=a
  136. +DHLIBS=LTLIBRARIES
  137. +A=la
  138. +BINDLT="--with-libtool --disable-symtable"
  139. +DISTCHECK_LIBTOOL_CONFIGURE_FLAG="--enable-libtool"
  140. +
  141. AC_SUBST(DHLIBS)
  142. AC_SUBST(A)
  143. @@ -895,6 +880,7 @@ AC_SUBST(Q)
  144. # install bind includes and libraries
  145. want_install_bind="no"
  146. +want_install_bind="yes"
  147. if test "$want_libtool" = "yes"; then
  148. want_install_bind="yes"
  149. fi
  150. @@ -903,7 +889,7 @@ if test "$use_libbind" != "no"; then
  151. fi
  152. AC_ARG_ENABLE(bind_install,
  153. AS_HELP_STRING([--enable-bind-install],
  154. -[install bind includes and libraries (default is no).]),
  155. +[install bind includes and libraries.]),
  156. want_install_bind="$enableval")
  157. if test "$want_install_bind" = "yes"; then
  158. if test "$use_libbind" != "no"; then
  159. @@ -914,6 +900,18 @@ elif test "$want_libtool" = "yes" -a "$u
  160. fi
  161. AM_CONDITIONAL(INSTALL_BIND, test "$want_install_bind" = "yes")
  162. +AC_ARG_WITH(libxml2,
  163. + AS_HELP_STRING([--with-libxml2], [link against libxml2. this is needed if bind was built with xml2 support enabled]),
  164. + with_libxml2="$withval", with_libxml2="no")
  165. +
  166. +if test x$with_libxml2 != xno; then
  167. + AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],,
  168. + [if test x$with_libxml2 != xauto; then
  169. + AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
  170. + fi])
  171. +fi
  172. +
  173. +
  174. # OpenLDAP support.
  175. AC_ARG_WITH(ldap,
  176. AS_HELP_STRING([--with-ldap],[enable OpenLDAP support in dhcpd (default is no)]),
  177. @@ -985,6 +983,17 @@ if test x$ldap = xyes || test x$ldapcryp
  178. AC_SUBST(LDAP_CFLAGS, [$LDAP_CFLAGS])
  179. fi
  180. +AC_ARG_WITH(systemd,
  181. + AC_HELP_STRING([--with-systemd],
  182. + [enable sending status notifications to systemd daemon (default is no)]),
  183. + [systemd=$withval],
  184. + [systemd=no])
  185. +
  186. +if test x$systemd = xyes ; then
  187. + AC_CHECK_LIB(systemd, sd_notifyf, ,
  188. + AC_MSG_FAILURE([*** systemd library not present - do you need to install systemd-libs package?]))
  189. +fi
  190. +
  191. # Append selected warning levels to CFLAGS before substitution (but after
  192. # AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) & etc).
  193. CFLAGS="$CFLAGS $STD_CWARNINGS"
  194. @@ -1029,6 +1038,10 @@ AC_CONFIG_FILES([
  195. ])
  196. AC_OUTPUT
  197. +AC_MSG_NOTICE([postconfig: run automake in $srcdir])
  198. +(cd $srcdir; automake)
  199. +AC_MSG_NOTICE([postconfig: rerun config.status])
  200. +sh ./config.status
  201. if test "$enable_dhcpv4o6" = "yes"; then
  202. DHCP_VERSIONS="DHCPv4, DHCPv6 and DHCPv4-over-DHCPv6"