summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2015-11-17 15:13:29 +0100
committerFrancis Dupont <fdupont@isc.org>2015-11-17 15:13:29 +0100
commite2f36ff16f7de5fb6e028354a2cc04a181e887b4 (patch)
tree492142cf58092c699e771983504c4cafdaecd14c
parenta555d1ab9ff099e4bf278ba416188b7491f51f7f (diff)
parentb4a10c76f139f8070780b71366fcc083cbb1f126 (diff)
downloadisc-dhcp-e2f36ff16f7de5fb6e028354a2cc04a181e887b4.tar.gz
Merged rt38836b (cross compile)
-rw-r--r--README4
-rwxr-xr-xconfigure17
-rw-r--r--configure.ac4
-rw-r--r--util/Makefile.bind.in24
4 files changed, 48 insertions, 1 deletions
diff --git a/README b/README
index 58711eea..2d30fd57 100644
--- a/README
+++ b/README
@@ -199,6 +199,10 @@ If you get errors on a system not mentioned above, you will need
to do some programming or debugging on your own to get the DHCP
Distribution working.
+If you cross compile you have to follow the instructions from
+the BIND README, in particular you must set the BUILD_CC
+environment variable.
+
INSTALLING THE DHCP DISTRIBUTION
Once you have successfully gotten the DHCP Distribution to build, you
diff --git a/configure b/configure
index 661a3c72..08dfc51b 100755
--- a/configure
+++ b/configure
@@ -641,6 +641,8 @@ RANLIB
EGREP
GREP
CPP
+CROSS_COMPILING_FALSE
+CROSS_COMPILING_TRUE
BINDCONFIG
am__fastdepCC_FALSE
am__fastdepCC_TRUE
@@ -4461,6 +4463,17 @@ fi
# We can have some flags to pass to bind configure
BINDCONFIG=
+if test "$cross_compiling" = "yes"; then
+ BINDCONFIG="--host=$host"
+fi
+
+ if test "$cross_compiling" = "yes"; then
+ CROSS_COMPILING_TRUE=
+ CROSS_COMPILING_FALSE='#'
+else
+ CROSS_COMPILING_TRUE='#'
+ CROSS_COMPILING_FALSE=
+fi
# POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
@@ -7174,6 +7187,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then
+ as_fn_error $? "conditional \"CROSS_COMPILING\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${BIND_ATF_TRUE}" && test -z "${BIND_ATF_FALSE}"; then
as_fn_error $? "conditional \"BIND_ATF\" was never defined.
diff --git a/configure.ac b/configure.ac
index 39c0a28a..b6bf9c87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,7 +34,11 @@ fi
# We can have some flags to pass to bind configure
BINDCONFIG=
+if test "$cross_compiling" = "yes"; then
+ BINDCONFIG="--host=$host"
+fi
AC_SUBST(BINDCONFIG)
+AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes")
# POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
# parts of the IPv6 Advanced Socket API as a result. This is stupid
diff --git a/util/Makefile.bind.in b/util/Makefile.bind.in
index bd784c60..109a7987 100644
--- a/util/Makefile.bind.in
+++ b/util/Makefile.bind.in
@@ -78,13 +78,35 @@ atf:
cp -rp atf ${binddir}) ; \
fi
-bind2:
+@CROSS_COMPILING_FALSE@bind2: bind2-noguest
+@CROSS_COMPILING_TRUE@bind2: bind2-hostgen
+
+bind2-noguest:
+# Build and install the export libraries
+# No need to do anything if we already have something installed.
+ @if test -d ${binddir}/lib ; then \
+ echo Bind export libraries already installed ; \
+ else \
+ echo Building BIND Export libraries - this takes some time. ;\
+ (cd ${bindsrcdir}/lib/export ; \
+ echo building in `pwd` ; \
+ MAKE=${GMAKE} ${GMAKE} >> ${binddir}/build.log) ; \
+ \
+ echo Installing BIND Export libraries to ${binddir}. ; \
+ (cd ${bindsrcdir}/lib/export ; \
+ MAKE=${GMAKE} ${GMAKE} install > ${binddir}/install.log) ; \
+ fi
+
+bind2-hostgen:
# Build and install the export libraries
# No need to do anything if we already have something installed.
@if test -d ${binddir}/lib ; then \
echo Bind export libraries already installed ; \
else \
echo Building BIND Export libraries - this takes some time. ;\
+ (cd ${bindsrcdir}/lib/export/dns ; \
+ echo building gen using ${BUILD_CC} in `pwd` ; \
+ MAKE=${GMAKE} ${GMAKE} CC=${BUILD_CC} CFLAGS=${BUILD_CFLAGS} CPPFLAGS=${BUILD_CPPFLAGS} LDFLAGS=${BUILD_LDFLAGS} LIBS=${BUILD_LIBS} gen >> ${binddir}/build.log) ; \
(cd ${bindsrcdir}/lib/export ; \
echo building in `pwd` ; \
MAKE=${GMAKE} ${GMAKE} >> ${binddir}/build.log) ; \