]> git.ipfire.org Git - thirdparty/dhcp.git/blob - util/Makefile.bind.in
Merged rt38836b (cross compile)
[thirdparty/dhcp.git] / util / Makefile.bind.in
1 #
2 # Copyright (C) 2009-2012, 2015 Internet Systems Consortium, Inc. ("ISC")
3 #
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.
7 #
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.
15
16 # Configure and build the bind libraries for use by DHCP
17
18 include ./version.tmp
19 version=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}
20
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.
23 # binddir=
24 # GMAKE=
25 include ./bindvar.tmp
26
27 bindsrcdir=bind-${version}
28
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
34
35 @BIND_ATF_FALSE@cleandirs = ./lib ./include
36 @BIND_ATF_TRUE@cleandirs = ./lib ./include ./atf
37 cleanfiles = ./configure.log ./build.log ./install.log
38
39 @BIND_ATF_FALSE@all: bind1 bind2
40 @BIND_ATF_TRUE@all: bind1 atf bind2
41
42 bind1:
43 # Extract the source from the tarball, if it hasn't been already.
44 @if test -d ${bindsrcdir} ; then \
45 echo ${bindsrcdir} already unpacked... ; \
46 else \
47 gunzip -c bind.tar.gz | tar xf - ; \
48 fi
49
50 @if test -z "${GMAKE}"; then \
51 echo "unable to find gmake" 1>&2 ; \
52 exit 1; \
53 fi
54
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 ; \
63 else \
64 echo Configuring BIND Export libraries for DHCP. ; \
65 rm -rf ${cleandirs} ${cleanfiles} ; \
66 (cd ${bindsrcdir} && \
67 ./configure ${bindconfig} > ${binddir}/configure.log); \
68 fi
69
70 atf:
71 # Build and copy the ATF support if not yet installed.
72 @if test -d ./atf ; then \
73 echo ATF support already installed ; \
74 else \
75 echo Building ATF support ; \
76 (cd ${bindsrcdir}/unit; \
77 MAKE=${GMAKE} ${GMAKE} atf > ${binddir}/build.log ; \
78 cp -rp atf ${binddir}) ; \
79 fi
80
81 @CROSS_COMPILING_FALSE@bind2: bind2-noguest
82 @CROSS_COMPILING_TRUE@bind2: bind2-hostgen
83
84 bind2-noguest:
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 ; \
89 else \
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) ; \
94 \
95 echo Installing BIND Export libraries to ${binddir}. ; \
96 (cd ${bindsrcdir}/lib/export ; \
97 MAKE=${GMAKE} ${GMAKE} install > ${binddir}/install.log) ; \
98 fi
99
100 bind2-hostgen:
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 ; \
105 else \
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) ; \
113 \
114 echo Installing BIND Export libraries to ${binddir}. ; \
115 (cd ${bindsrcdir}/lib/export ; \
116 MAKE=${GMAKE} ${GMAKE} install > ${binddir}/install.log) ; \
117 fi
118
119 clean:
120 @echo Cleaning BIND export library.
121 rm -rf ${bindsrcdir} ${cleandirs} ${cleanfiles}
122
123 # Include the following so that this Makefile is happy when the parent
124 # tries to use them.
125
126 distdir:
127
128 distclean:
129
130 install:
131
132 check:
133
134 uninstall: