summaryrefslogtreecommitdiff
path: root/win32utils/win32-build.txt
blob: 25efe86514012f0cee7da270069a0f88146e2b0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
Copyright (C) 2004, 2005, 2008, 2009, 2012, 2013  Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 2001, 2002  Internet Software Consortium.
See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.

$Id$

       BIND 9.9 for Win32 Source Build Instructions.  24-June-2013

Building BIND 9.9 on Windows XP/Vista/7/8 or server 2003/2008/2008R2
has the following prerequisites:

1) You need to install Perl for Windows.  ActivePerl
(http://www.activestate.com/) and Strawberry Perl
(http://www.strawberryperl.com) have both been tested and found
to work.

2) OpenSSL (http://www.openssl.org) needs to be downloaded and built
on the system on which you are building BIND.

3) If you wish to use the statistics channel, LibXML2
(ftp://xmlsoft.org/libxml2) needs to be downloaded and built on
the system on which you are building BIND.  (If you do not wish
to use the statistics channel, remove HAVE_LIBXML2 from config.h.win32.)

4) The BIND Installer (BINDInstall) includes a copy of the
redistributable runtime object vcredist_x86.exe, which is included
with Visual Studio and can be downloaded from Microsoft.  This file
must be in place prior to running the build setup script.

5) If you want to build using Visual C++ 6.0, you'll need some extra
files that are to be found in the Platform SDK (which you will need
to install), namely:

iphlpapi.h
iptypes.h
ipexport.h
iphlpapi.lib

You'll also need an updated Iprtrmib.h - using the VC++6.0 one will
get you some compilation errors. You can just overwrite the old one if
you're not using it for any purposes, and maybe keep a backup of it. 

You can copy the header files under VC98\INCLUDE and the library file
under VC98\LIB. I think you can also put them in a separate directory
and add it to the include search list, but I don't know if that can be
made persistent. 

For building on VC++ 7.0 no extra files are required. 

The instructions assume a Visual C++ 6.0 compiler with Visual Studio and
Visual Studio Service Pack 3 or later. It may build and work with earlier
versions but it has not been tested. The binaries may be built and run on
any of the following platforms: NT 4.0 Workstation (SP3 or later), NT 4.0
Server (SP3 or later), Windows 2000 Professional (SP1 or later),
Windows 2000 Server or any kind (SP1 or later), Windows XP, Windows 2003
Server, Windows Vista, Windows 2008 Server, Windows 7, Windows 2008 R2
Server, Windows 8, and Windows 2012 Server (untested). It will NOT build
or run on Windows 95, Windows 98, etc., or Windows RT platforms.

Step 1: Download and build OpenSSL

Download and untar the OpenSSL sources from http://www.openssl.org/.
Extract them at in the same directory in which you extracted the BIND9
source:  If BIND9 is in \build\bind-9.9.0, for instance, OpenSSL should be
in \build\openssl-1.0.1e (subject to version number changes).

Note: Building OpenSSL requires that you install Perl as it uses
it during its build process. The following commands work as of
openssl-1.0.1e, but you should check the OpenSSL distribution 
to see if the build instructions in the INSTALL.W32 file have changed:

  cd openssl-1.0.1e
  perl Configure VC-WIN32 --prefix=c:/openssl
  ms\do_ms
  nmake /f ms\ntdll.mak

If you wish to use PKCS #11 to control a cryptographic hardware
service module, please see "PKCS #11 (Cryptoki) support" in chapter 4
of the BIND 9 Administrator Reference Guide.  You will need to apply
the patch in bind9\bin\pkcs11\openssl-1.0.1e-patch (this can be done
using the Cygwin 'patch' utility) and add --pk11-libname and
--pk11-flavor to the Configure command above.

Step 2: Download and build libxml2

Download and untar the libxml2 sources from ftp://xmlsoft.org/libxml2.
Extract them at in the same directory in which you extracted the BIND9
source:  If BIND9 is in \build\bind-9.9.0, for instance, libxml2 should
be in \build\libxml2-2.7.7 (subject to version number changes).

Now build libxml2, and copy the resulting files into the include and lib
directories:

 cd libxml2-2.7.7\win32
 cscript configure.js compiler=msvc vcmanifest=yes static=yes debug=no iconv=no
 nmake /f Makefile.msvc libxml

Step 3: Building BIND

You must build openssl and libxml2 first. 

From the command prompt cd to the win32utils directory under
the BIND9 root:

  cd bind-9.9.0\win32utils

Text files used by the Windows build should be in DOS format.
If for some reason they aren't, this can be corrected by running:

  perl todos.pl

If you wish to use PKCS #11 to control a cryptographic hardware service
module, set the path to the PKCS #11 provider library:

  perl setpk11provider.pl <DLL path>

If using VC++ 6.0, run the BuildAll.bat file:

  BuildAll

This will do the following:
1) copy config.h.win32 to config.h in the root.
2) create the versions.h file in the root.
3) Build the gen application in the lib/dns directory.
4) Run the gen application and build the required lib/dns header
   files.
5) Create the Build/Release subdirectory under the root of the BIND
   source tree which will hold the binaries being built.
6) Build the libraries, named, application tools like dig, rndc
   dnssec tools, installer, checkconf and checkzones programs,
   BIND 9 Installer.
7) Copies the release notes and the OpenSSL DLL to the BUILD/Release
   directory.
8) Copies the BIND 9 ARM HTML files and the application HTML files
   to the Build\Release area.

If you wish to use the Visual Studio GUI for building, you can just
run the BuildSetup.bat file:

  BuildSetup
  
This will create or find and copy into place several files which are
necessary for the build to proceed.  It also locates and copies into place
the DLLs for OpenSSL and libxml2.

Use BINDBuild.dsw (also located in the win32utils directory) to open the
workspace for all of the BIND9 libraries and applications.  Select
"Build->Batch Build", click "Select All", then click "Build".

After the build has completed, run the BuildPost.bat file:

  BuildPost

...which does post-build processing.

Installation is accomplished by running the BINDInstall program. All DLL's
are copied to the system32 area and all applications (including BINDInstall
which may be necessary for uninstalling BIND 9) to the dns/bin directory.
If BIND 8 has previously been installed on the system it must be uninstalled
first by running it's own BINDInstall program.  The BIND 9 installer does
not yet do this.

All bugs found, whether in the process of building the application or
running BIND or the tools should be reported to the bind9 bugs email
account at bind9-bugs@isc.org.