# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# 
# T2 SDE: package/.../dhcp/bind.patch.cross
# Copyright (C) 2010 The T2 SDE Project
# 
# More information can be found in the files COPYING and README.
# 
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- T2-COPYRIGHT-NOTE-END ---
diff -ruN dhcp-4.2.0/bind/bind.patch dhcp-4.2.0_new/bind/bind.patch
--- dhcp-4.2.0/bind/bind.patch	1970-01-01 03:00:00.000000000 +0300
+++ dhcp-4.2.0_new/bind/bind.patch	2010-08-11 20:13:55.000000000 +0400
@@ -0,0 +1,12 @@
+diff -ruN bind-9.7.1/lib/export/dns/Makefile.in bind-9.7.1_new/lib/export/dns/Makefile.in
+--- bind-9.7.1/lib/export/dns/Makefile.in	2009-12-06 02:31:40.000000000 +0300
++++ bind-9.7.1_new/lib/export/dns/Makefile.in	2010-08-11 20:10:57.223160921 +0400
+@@ -160,7 +160,7 @@
+ 	./gen -s ${srcdir} > code.h
+ 
+ gen: ${srcdir}/gen.c
+-	${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS}
++	${BUILD_CC} ${ALL_CFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c ${BUILD_LIBS}
+ 
+ #We don't need rbtdb64 for this library
+ #rbtdb64.@O@: rbtdb.c
diff -ruN dhcp-4.2.0/bind/Makefile dhcp-4.2.0_new/bind/Makefile
--- dhcp-4.2.0/bind/Makefile	2010-07-10 07:26:52.000000000 +0400
+++ dhcp-4.2.0_new/bind/Makefile	2010-08-11 19:56:00.712159218 +0400
@@ -40,12 +40,13 @@
 		echo "unable to find gmake" 1>&2 ;          \
 		exit 1;                                     \
 	fi
+	patch -p0 < bind.patch
 
 # Configure the export libraries
 # Currently disable the epoll and devpoll options as they don't interact
 # well with the DHCP code.
 	@echo Configuring BIND Export libraries for DHCP.
-	@(cd ${bindsrcdir} && ./configure --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=${binddir}/include --with-export-libdir=${binddir}/lib > ${binddir}/configure.log)
+	@(cd ${bindsrcdir} && ./configure --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=${binddir}/include --with-export-libdir=${binddir}/lib --build=${build_alias} --host=${host_alias} --with-randomdev=/dev/random > ${binddir}/configure.log)
 
 # Build the export libraries
 	@echo Building BIND Export libraries - this takes some time.
diff -ruN dhcp-4.2.0/configure dhcp-4.2.0_new/configure
--- dhcp-4.2.0/configure	2010-07-10 07:26:25.000000000 +0400
+++ dhcp-4.2.0_new/configure	2010-08-11 19:29:23.000000000 +0400
@@ -9712,4 +9712,4 @@
 fi
 
 
-sh util/bindvar.sh
+sh util/bindvar.sh $host_alias $build_alias
diff -ruN dhcp-4.2.0/util/bindvar.sh dhcp-4.2.0_new/util/bindvar.sh
--- dhcp-4.2.0/util/bindvar.sh	2009-12-03 01:35:03.000000000 +0300
+++ dhcp-4.2.0_new/util/bindvar.sh	2010-08-11 19:29:41.000000000 +0400
@@ -32,4 +32,6 @@
 cat <<EOF > bind/bindvar.tmp
 binddir=$binddir/bind
 GMAKE=$gmake
+host_alias=$1
+build_alias=$2
 EOF
