95aa8c
diff -up dhcp-4.2.2/client/Makefile.am.rh637017 dhcp-4.2.2/client/Makefile.am
95aa8c
--- dhcp-4.2.2/client/Makefile.am.rh637017	2010-09-15 00:32:36.000000000 +0200
95aa8c
+++ dhcp-4.2.2/client/Makefile.am	2011-08-11 17:28:58.923897561 +0200
95aa8c
@@ -5,7 +5,7 @@ dhclient_SOURCES = clparse.c dhclient.c 
43a67d
 		   scripts/netbsd scripts/nextstep scripts/openbsd \
43a67d
 		   scripts/solaris scripts/openwrt
Adam Tkac 9819e3
 dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
43a67d
-		 ../bind/lib/libdns.a ../bind/lib/libisc.a
43a67d
+		 $(BIND9_LIBDIR) -ldns-export -lisc-export
43a67d
 man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
43a67d
 EXTRA_DIST = $(man_MANS)
Adam Tkac 9819e3
 
95aa8c
diff -up dhcp-4.2.2/common/tests/Makefile.am.rh637017 dhcp-4.2.2/common/tests/Makefile.am
95aa8c
--- dhcp-4.2.2/common/tests/Makefile.am.rh637017	2009-10-28 05:12:30.000000000 +0100
95aa8c
+++ dhcp-4.2.2/common/tests/Makefile.am	2011-08-11 17:33:45.258637236 +0200
95aa8c
@@ -6,6 +6,5 @@ TESTS = test_alloc
95aa8c
 
95aa8c
 test_alloc_SOURCES = test_alloc.c
95aa8c
 test_alloc_LDADD = ../libdhcp.a ../../tests/libt_api.a \
95aa8c
-	../../omapip/libomapi.a ../../bind/lib/libdns.a \
95aa8c
-        ../../bind/lib/libisc.a
95aa8c
-
95aa8c
+	../../omapip/libomapi.a \
95aa8c
+	 $(BIND9_LIBDIR) -ldns-export -lisc-export
95aa8c
diff -up dhcp-4.2.2/configure.ac.rh637017 dhcp-4.2.2/configure.ac
95aa8c
--- dhcp-4.2.2/configure.ac.rh637017	2011-07-20 02:32:18.000000000 +0200
95aa8c
+++ dhcp-4.2.2/configure.ac	2011-08-11 17:28:58.924897535 +0200
95aa8c
@@ -512,20 +512,37 @@ AC_CHECK_MEMBER(struct msghdr.msg_contro
Adam Tkac 9819e3
 libbind=
Adam Tkac 9819e3
 AC_ARG_WITH(libbind,
Adam Tkac 9819e3
 	AC_HELP_STRING([--with-libbind=PATH],
Adam Tkac 9819e3
-		       [bind includes and libraries are in PATH 
Adam Tkac 9819e3
-		        (default is ./bind)]),
Adam Tkac 9819e3
+		       [bind includes are in PATH 
Adam Tkac 9819e3
+		        (default is ./bind/includes)]),
Adam Tkac 9819e3
 	use_libbind="$withval", use_libbind="no")
Adam Tkac 9819e3
 case "$use_libbind" in 
Adam Tkac 9819e3
+yes|no)
Adam Tkac 9819e3
+	libbind="\${top_srcdir}/bind/include"
Adam Tkac 9819e3
+	;;
Adam Tkac 9819e3
+*)
Adam Tkac 9819e3
+	libbind="$use_libbind"
Adam Tkac 9819e3
+	;;
Adam Tkac 9819e3
+esac
Adam Tkac 9819e3
+
Adam Tkac 9819e3
+BIND9_LIBDIR='-L$(top_builddir)/bind/lib'
Adam Tkac 9819e3
+AC_ARG_WITH(libbind-libs,
Adam Tkac 9819e3
+	AC_HELP_STRING([--with-libbind-libs=PATH],
Adam Tkac 9819e3
+		       [bind9 export libraries are in PATH]),
Adam Tkac 9819e3
+		       [libbind_libs="$withval"], [libbind_libs='no'])
Adam Tkac 9819e3
+case "$libbind_libs" in
Adam Tkac 9819e3
 yes)
Adam Tkac 9819e3
-	libbind="\${top_srcdir}/bind"
Adam Tkac 9819e3
+	AC_MSG_ERROR([Specify path to bind9 libraries])
Adam Tkac 9819e3
 	;;
Adam Tkac 9819e3
 no)
Adam Tkac 9819e3
-	libbind="\${top_srcdir}/bind"
Adam Tkac 9819e3
+	BUNDLED_BIND=yes
Adam Tkac 9819e3
 	;;
Adam Tkac 9819e3
 *)
Adam Tkac 9819e3
-	libbind="$use_libbind"
Adam Tkac 9819e3
+	BIND9_LIBDIR="-L$libbind_libs"
Adam Tkac 9819e3
+	BUNDLED_BIND=no
Adam Tkac 9819e3
 	;;
Adam Tkac 9819e3
 esac
Adam Tkac 9819e3
+AM_CONDITIONAL([BUNDLED_BIND], [test "$BUNDLED_BIND" = yes])
Adam Tkac 9819e3
+AC_SUBST([BIND9_LIBDIR])
Adam Tkac 9819e3
 
Adam Tkac 9819e3
 # OpenLDAP support.
Adam Tkac 9819e3
 AC_ARG_WITH(ldap,
95aa8c
@@ -562,7 +579,7 @@ fi
Adam Tkac 9819e3
 CFLAGS="$CFLAGS $STD_CWARNINGS"
Adam Tkac 9819e3
 
Adam Tkac 9819e3
 # Try to add the bind include directory
Adam Tkac 9819e3
-CFLAGS="$CFLAGS -I$libbind/include"
Adam Tkac 9819e3
+CFLAGS="$CFLAGS -I$libbind"
Adam Tkac 9819e3
 
Adam Tkac 9819e3
 AC_C_FLEXIBLE_ARRAY_MEMBER
Adam Tkac 9819e3
 
95aa8c
diff -up dhcp-4.2.2/dhcpctl/Makefile.am.rh637017 dhcp-4.2.2/dhcpctl/Makefile.am
95aa8c
--- dhcp-4.2.2/dhcpctl/Makefile.am.rh637017	2009-10-28 05:12:30.000000000 +0100
95aa8c
+++ dhcp-4.2.2/dhcpctl/Makefile.am	2011-08-11 17:28:58.924897535 +0200
Adam Tkac 9819e3
@@ -6,10 +6,10 @@ EXTRA_DIST = $(man_MANS)
Adam Tkac 9819e3
 
Adam Tkac 9819e3
 omshell_SOURCES = omshell.c
Adam Tkac 9819e3
 omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
Adam Tkac 9819e3
-	        ../bind/lib/libdns.a ../bind/lib/libisc.a
Adam Tkac 9819e3
+	        $(BIND9_LIBDIR) -ldns-export -lisc-export
Adam Tkac 9819e3
 
Adam Tkac 9819e3
 libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c
Adam Tkac 9819e3
 
Adam Tkac 9819e3
 cltest_SOURCES = cltest.c
Adam Tkac 9819e3
 cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
Adam Tkac 9819e3
-	       ../bind/lib/libdns.a ../bind/lib/libisc.a
Adam Tkac 9819e3
\ No newline at end of file
Adam Tkac 9819e3
+	       $(BIND9_LIBDIR) -ldns-export -lisc-export
95aa8c
diff -up dhcp-4.2.2/Makefile.am.rh637017 dhcp-4.2.2/Makefile.am
95aa8c
--- dhcp-4.2.2/Makefile.am.rh637017	2010-03-25 00:30:38.000000000 +0100
95aa8c
+++ dhcp-4.2.2/Makefile.am	2011-08-11 17:28:58.925897509 +0200
Adam Tkac 9819e3
@@ -21,7 +21,13 @@ EXTRA_DIST = RELNOTES LICENSE \
Adam Tkac 9819e3
 	     util/bindvar.sh \
Adam Tkac 9819e3
 	     bind/Makefile bind/bind.tar.gz bind/version.tmp 
Adam Tkac 9819e3
 
Adam Tkac 9819e3
-SUBDIRS = bind includes tests common dst omapip client dhcpctl relay server
Adam Tkac 9819e3
+if BUNDLED_BIND
Adam Tkac 9819e3
+SUBDIRS = bind
Adam Tkac 9819e3
+else
Adam Tkac 9819e3
+SUBDIRS = 
Adam Tkac 9819e3
+endif
Adam Tkac 9819e3
+
Adam Tkac 9819e3
+SUBDIRS += includes tests common dst omapip client dhcpctl relay server
Adam Tkac 9819e3
 
Adam Tkac 9819e3
 nobase_include_HEADERS = dhcpctl/dhcpctl.h
Adam Tkac 9819e3
 
95aa8c
diff -up dhcp-4.2.2/omapip/Makefile.am.rh637017 dhcp-4.2.2/omapip/Makefile.am
95aa8c
--- dhcp-4.2.2/omapip/Makefile.am.rh637017	2010-02-12 01:13:54.000000000 +0100
95aa8c
+++ dhcp-4.2.2/omapip/Makefile.am	2011-08-11 17:28:58.939897149 +0200
43a67d
@@ -10,5 +10,5 @@ man_MANS = omapi.3
43a67d
 EXTRA_DIST = $(man_MANS)
Adam Tkac 9819e3
 
Adam Tkac 9819e3
 svtest_SOURCES = test.c
Adam Tkac 9819e3
-svtest_LDADD = libomapi.a ../bind/lib/libdns.a ../bind/lib/libisc.a
Adam Tkac 9819e3
+svtest_LDADD = libomapi.a $(BIND9_LIBDIR) -ldns-export -lisc-export
Adam Tkac 9819e3
 
95aa8c
diff -up dhcp-4.2.2/relay/Makefile.am.rh637017 dhcp-4.2.2/relay/Makefile.am
95aa8c
--- dhcp-4.2.2/relay/Makefile.am.rh637017	2009-10-28 05:12:30.000000000 +0100
95aa8c
+++ dhcp-4.2.2/relay/Makefile.am	2011-08-11 17:28:58.940897123 +0200
95aa8c
@@ -3,7 +3,7 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localst
43a67d
 sbin_PROGRAMS = dhcrelay
Adam Tkac 9819e3
 dhcrelay_SOURCES = dhcrelay.c
Adam Tkac 9819e3
 dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
Adam Tkac 9819e3
-		 ../bind/lib/libdns.a ../bind/lib/libisc.a
Adam Tkac 9819e3
+		 $(BIND9_LIBDIR) -ldns-export -lisc-export
43a67d
 man_MANS = dhcrelay.8
43a67d
 EXTRA_DIST = $(man_MANS)
Adam Tkac 9819e3
 
95aa8c
diff -up dhcp-4.2.2/server/Makefile.am.rh637017 dhcp-4.2.2/server/Makefile.am
95aa8c
--- dhcp-4.2.2/server/Makefile.am.rh637017	2010-03-24 22:49:47.000000000 +0100
95aa8c
+++ dhcp-4.2.2/server/Makefile.am	2011-08-11 17:28:58.944897021 +0200
Adam Tkac 9819e3
@@ -8,8 +8,7 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c c
Adam Tkac 9819e3
 
43a67d
 dhcpd_CFLAGS = $(LDAP_CFLAGS)
Adam Tkac 9819e3
 dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
Adam Tkac 9819e3
-	      ../dhcpctl/libdhcpctl.a ../bind/lib/libdns.a \
Adam Tkac 9819e3
-	      ../bind/lib/libisc.a
Adam Tkac 9819e3
+	      ../dhcpctl/libdhcpctl.a $(BIND9_LIBDIR) -ldns-export -lisc-export
Adam Tkac 9819e3
 
Adam Tkac 9819e3
 man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
43a67d
 EXTRA_DIST = $(man_MANS)