2 # Copyright (C) 2009-2012, 2015 Internet Systems Consortium, Inc. ("ISC")
4 # Permission to use, copy, modify, and/or distribute this software for any
5 # purpose with or without fee is hereby granted, provided that the above
6 # copyright notice and this permission notice appear in all copies.
8 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 # PERFORMANCE OF THIS SOFTWARE.
16 # Configure and build the bind libraries for use by DHCP
19 version=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}
21 # bindvar.tmp is constructed by configure, it has the paths for bind
22 # if GMAKE is blank the shell script couldn't find a gmake to use.
27 bindsrcdir=bind-${version}
29 bindconfig = --disable-kqueue --disable-epoll --disable-devpoll \
30 --without-openssl --without-libxml2 --enable-exportlib \
31 --with-gssapi=no --enable-threads=no @BINDCONFIG@ \
32 --with-export-includedir=${binddir}/include \
33 --with-export-libdir=${binddir}/lib
35 @BIND_ATF_FALSE@cleandirs = ./lib ./include
36 @BIND_ATF_TRUE@cleandirs = ./lib ./include ./atf
37 cleanfiles = ./configure.log ./build.log ./install.log
39 @BIND_ATF_FALSE@all: bind1 bind2
40 @BIND_ATF_TRUE@all: bind1 atf bind2
43 # Extract the source from the tarball, if it hasn't been already.
44 @if test -d ${bindsrcdir} ; then \
45 echo ${bindsrcdir} already unpacked... ; \
47 gunzip -c bind.tar.gz | tar xf - ; \
50 @if test -z "${GMAKE}"; then \
51 echo "unable to find gmake" 1>&2 ; \
55 # Configure the export libraries
56 # Currently disable the epoll, devpoll and kqueue options as they
57 # don't interact well with the DHCP code.
58 # If the top-level Bind Makefile exists we skip the configuration step
59 # as we assume it's done and won't change. Doing a make clean will
60 # reset things if necessary.
61 @if test -f ${bindsrcdir}/Makefile ; then \
62 echo Bind export libraries already configured ; \
64 echo Configuring BIND Export libraries for DHCP. ; \
65 rm -rf ${cleandirs} ${cleanfiles} ; \
66 (cd ${bindsrcdir} && \
67 ./configure ${bindconfig} > ${binddir}/configure.log); \
71 # Build and copy the ATF support if not yet installed.
72 @if test -d ./atf ; then \
73 echo ATF support already installed ; \
75 echo Building ATF support ; \
76 (cd ${bindsrcdir}/unit; \
77 MAKE=${GMAKE} ${GMAKE} atf > ${binddir}/build.log ; \
78 cp -rp atf ${binddir}) ; \
81 @CROSS_COMPILING_FALSE@bind2: bind2-noguest
82 @CROSS_COMPILING_TRUE@bind2: bind2-hostgen
85 # Build and install the export libraries
86 # No need to do anything if we already have something installed.
87 @if test -d ${binddir}/lib ; then \
88 echo Bind export libraries already installed ; \
90 echo Building BIND Export libraries - this takes some time. ;\
91 (cd ${bindsrcdir}/lib/export ; \
92 echo building in `pwd` ; \
93 MAKE=${GMAKE} ${GMAKE} >> ${binddir}/build.log) ; \
95 echo Installing BIND Export libraries to ${binddir}. ; \
96 (cd ${bindsrcdir}/lib/export ; \
97 MAKE=${GMAKE} ${GMAKE} install > ${binddir}/install.log) ; \
101 # Build and install the export libraries
102 # No need to do anything if we already have something installed.
103 @if test -d ${binddir}/lib ; then \
104 echo Bind export libraries already installed ; \
106 echo Building BIND Export libraries - this takes some time. ;\
107 (cd ${bindsrcdir}/lib/export/dns ; \
108 echo building gen using ${BUILD_CC} in `pwd` ; \
109 MAKE=${GMAKE} ${GMAKE} CC=${BUILD_CC} CFLAGS=${BUILD_CFLAGS} CPPFLAGS=${BUILD_CPPFLAGS} LDFLAGS=${BUILD_LDFLAGS} LIBS=${BUILD_LIBS} gen >> ${binddir}/build.log) ; \
110 (cd ${bindsrcdir}/lib/export ; \
111 echo building in `pwd` ; \
112 MAKE=${GMAKE} ${GMAKE} >> ${binddir}/build.log) ; \
114 echo Installing BIND Export libraries to ${binddir}. ; \
115 (cd ${bindsrcdir}/lib/export ; \
116 MAKE=${GMAKE} ${GMAKE} install > ${binddir}/install.log) ; \
120 @echo Cleaning BIND export library.
121 rm -rf ${bindsrcdir} ${cleandirs} ${cleanfiles}
123 # Include the following so that this Makefile is happy when the parent