3 # Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 # PERFORMANCE OF THIS SOFTWARE.
19 # This script builds nmake and visual studio build files
29 my $configfilein = "..\\config.h.win32";
30 my $configfileout = ">..\\config.h";
31 my $platformfile = "..\\lib\\isc\\win32\\include\\isc\\platform.h";
33 my @filelist = ("..\\bin\\check\\win32\\checktool.dsp",
34 "..\\bin\\check\\win32\\checkconf.dsp",
35 "..\\bin\\check\\win32\\checkconf.mak",
36 "..\\bin\\check\\win32\\checkzone.dsp",
37 "..\\bin\\check\\win32\\checkzone.mak",
38 "..\\bin\\confgen\\win32\\confgentool.dsp",
39 "..\\bin\\confgen\\win32\\ddnsconfgen.dsp",
40 "..\\bin\\confgen\\win32\\ddnsconfgen.mak",
41 "..\\bin\\confgen\\win32\\rndcconfgen.dsp",
42 "..\\bin\\confgen\\win32\\rndcconfgen.mak",
43 "..\\bin\\delv\\win32\\delv.dsp",
44 "..\\bin\\delv\\win32\\delv.mak",
45 "..\\bin\\dig\\win32\\dig.dsp",
46 "..\\bin\\dig\\win32\\dig.mak",
47 "..\\bin\\dig\\win32\\dighost.dsp",
48 "..\\bin\\dig\\win32\\host.dsp",
49 "..\\bin\\dig\\win32\\host.mak",
50 "..\\bin\\dig\\win32\\nslookup.dsp",
51 "..\\bin\\dig\\win32\\nslookup.mak",
52 "..\\bin\\dnssec\\win32\\dnssectool.dsp",
53 "..\\bin\\dnssec\\win32\\dsfromkey.dsp",
54 "..\\bin\\dnssec\\win32\\dsfromkey.mak",
55 "..\\bin\\dnssec\\win32\\importkey.dsp",
56 "..\\bin\\dnssec\\win32\\importkey.mak",
57 "..\\bin\\dnssec\\win32\\keyfromlabel.dsp",
58 "..\\bin\\dnssec\\win32\\keyfromlabel.mak",
59 "..\\bin\\dnssec\\win32\\keygen.dsp",
60 "..\\bin\\dnssec\\win32\\keygen.mak",
61 "..\\bin\\dnssec\\win32\\revoke.dsp",
62 "..\\bin\\dnssec\\win32\\revoke.mak",
63 "..\\bin\\dnssec\\win32\\settime.dsp",
64 "..\\bin\\dnssec\\win32\\settime.mak",
65 "..\\bin\\dnssec\\win32\\signzone.dsp",
66 "..\\bin\\dnssec\\win32\\signzone.mak",
67 "..\\bin\\dnssec\\win32\\verify.dsp",
68 "..\\bin\\dnssec\\win32\\verify.mak",
69 "..\\bin\\named\\win32\\named.dsp",
70 "..\\bin\\named\\win32\\named.mak",
71 "..\\bin\\nsupdate\\win32\\nsupdate.dsp",
72 "..\\bin\\nsupdate\\win32\\nsupdate.mak",
73 "..\\bin\\pkcs11\\win32\\pk11destroy.dsp",
74 "..\\bin\\pkcs11\\win32\\pk11destroy.mak",
75 "..\\bin\\pkcs11\\win32\\pk11keygen.dsp",
76 "..\\bin\\pkcs11\\win32\\pk11keygen.mak",
77 "..\\bin\\pkcs11\\win32\\pk11list.dsp",
78 "..\\bin\\pkcs11\\win32\\pk11list.mak",
79 "..\\bin\\pkcs11\\win32\\pk11tokens.dsp",
80 "..\\bin\\pkcs11\\win32\\pk11tokens.mak",
81 "..\\bin\\python\\dnssec-checkds.py",
82 "..\\bin\\python\\dnssec-coverage.py",
83 "..\\bin\\rndc\\win32\\rndc.dsp",
84 "..\\bin\\rndc\\win32\\rndc.mak",
85 "..\\bin\\rndc\\win32\\rndcutil.dsp",
86 "..\\bin\\tools\\win32\\arpaname.dsp",
87 "..\\bin\\tools\\win32\\arpaname.mak",
88 "..\\bin\\tools\\win32\\genrandom.dsp",
89 "..\\bin\\tools\\win32\\genrandom.mak",
90 "..\\bin\\tools\\win32\\ischmacfixup.dsp",
91 "..\\bin\\tools\\win32\\ischmacfixup.mak",
92 "..\\bin\\tools\\win32\\journalprint.dsp",
93 "..\\bin\\tools\\win32\\journalprint.mak",
94 "..\\bin\\tools\\win32\\nsec3hash.dsp",
95 "..\\bin\\tools\\win32\\nsec3hash.mak",
96 "..\\bin\\tools\\win32\\rrchecker.dsp",
97 "..\\bin\\tools\\win32\\rrchecker.mak",
98 "..\\bin\\tests\\atomic\\win32\\t_atomic.dsp",
99 "..\\bin\\tests\\atomic\\win32\\t_atomic.mak",
100 "..\\bin\\tests\\db\\win32\\t_db.dsp",
101 "..\\bin\\tests\\db\\win32\\t_db.mak",
102 "..\\bin\\tests\\dst\\win32\\t_dst.dsp",
103 "..\\bin\\tests\\dst\\win32\\t_dst.mak",
104 "..\\bin\\tests\\master\\win32\\t_master.dsp",
105 "..\\bin\\tests\\master\\win32\\t_master.mak",
106 "..\\bin\\tests\\mem\\win32\\t_mem.dsp",
107 "..\\bin\\tests\\mem\\win32\\t_mem.mak",
108 "..\\bin\\tests\\hashes\\win32\\t_hashes.dsp",
109 "..\\bin\\tests\\hashes\\win32\\t_hashes.mak",
110 "..\\bin\\tests\\names\\win32\\t_names.dsp",
111 "..\\bin\\tests\\names\\win32\\t_names.mak",
112 "..\\bin\\tests\\rbt\\win32\\t_rbt.dsp",
113 "..\\bin\\tests\\rbt\\win32\\t_rbt.mak",
114 "..\\bin\\tests\\resolver\\win32\\t_resolver.dsp",
115 "..\\bin\\tests\\resolver\\win32\\t_resolver.mak",
116 "..\\bin\\tests\\sockaddr\\win32\\t_sockaddr.dsp",
117 "..\\bin\\tests\\sockaddr\\win32\\t_sockaddr.mak",
118 "..\\bin\\tests\\tasks\\win32\\t_tasks.dsp",
119 "..\\bin\\tests\\tasks\\win32\\t_tasks.mak",
120 "..\\bin\\tests\\timers\\win32\\t_timers.dsp",
121 "..\\bin\\tests\\timers\\win32\\t_timers.mak",
122 "..\\bin\\tests\\win32\\backtrace_test.dsp",
123 "..\\bin\\tests\\win32\\backtrace_test.mak",
124 "..\\bin\\tests\\win32\\inter_test.dsp",
125 "..\\bin\\tests\\win32\\inter_test.mak",
126 "..\\bin\\tests\\win32\\rwlock_test.dsp",
127 "..\\bin\\tests\\win32\\rwlock_test.mak",
128 "..\\bin\\tests\\win32\\shutdown_test.dsp",
129 "..\\bin\\tests\\win32\\shutdown_test.mak",
130 "..\\bin\\tests\\win32\\sock_test.dsp",
131 "..\\bin\\tests\\win32\\sock_test.mak",
132 "..\\bin\\tests\\win32\\task_test.dsp",
133 "..\\bin\\tests\\win32\\task_test.mak",
134 "..\\bin\\tests\\win32\\timer_test.dsp",
135 "..\\bin\\tests\\win32\\timer_test.mak",
136 "..\\bin\\tests\\win32\\inter_test.dsp",
137 "..\\bin\\tests\\win32\\inter_test.mak",
138 "..\\bin\\tests\\win32\\rwlock_test.dsp",
139 "..\\bin\\tests\\win32\\rwlock_test.mak",
140 "..\\bin\\tests\\win32\\shutdown_test.dsp",
141 "..\\bin\\tests\\win32\\shutdown_test.mak",
142 "..\\bin\\tests\\win32\\sock_test.dsp",
143 "..\\bin\\tests\\win32\\sock_test.mak",
144 "..\\bin\\tests\\win32\\task_test.dsp",
145 "..\\bin\\tests\\win32\\task_test.mak",
146 "..\\bin\\tests\\win32\\timer_test.dsp",
147 "..\\bin\\tests\\win32\\timer_test.mak",
148 "..\\bin\\win32\\BINDInstall\\BINDInstall.dsp",
149 "..\\bin\\win32\\BINDInstall\\BINDInstall.mak",
150 "..\\lib\\bind9\\win32\\libbind9.dsp",
151 "..\\lib\\bind9\\win32\\libbind9.mak",
152 "..\\lib\\dns\\win32\\gen.dsp",
153 "..\\lib\\dns\\win32\\gen.mak",
154 "..\\lib\\dns\\win32\\libdns.def",
155 "..\\lib\\dns\\win32\\libdns.dsp",
156 "..\\lib\\dns\\win32\\libdns.mak",
157 "..\\lib\\irs\\win32\\libirs.dsp",
158 "..\\lib\\irs\\win32\\libirs.mak",
159 "..\\lib\\isc\\win32\\libisc.def",
160 "..\\lib\\isc\\win32\\libisc.dsp",
161 "..\\lib\\isc\\win32\\libisc.mak",
162 "..\\lib\\isccc\\win32\\libisccc.dsp",
163 "..\\lib\\isccc\\win32\\libisccc.mak",
164 "..\\lib\\isccfg\\win32\\libisccfg.dsp",
165 "..\\lib\\isccfg\\win32\\libisccfg.mak",
166 "..\\lib\\lwres\\win32\\liblwres.dsp",
167 "..\\lib\\lwres\\win32\\liblwres.mak",
168 "..\\lib\\samples\\win32\\async.dsp",
169 "..\\lib\\samples\\win32\\async.mak",
170 "..\\lib\\samples\\win32\\gai.dsp",
171 "..\\lib\\samples\\win32\\gai.mak",
172 "..\\lib\\samples\\win32\\nsprobe.dsp",
173 "..\\lib\\samples\\win32\\nsprobe.mak",
174 "..\\lib\\samples\\win32\\request.dsp",
175 "..\\lib\\samples\\win32\\request.mak",
176 "..\\lib\\samples\\win32\\resolve.dsp",
177 "..\\lib\\samples\\win32\\resolve.mak",
178 "..\\lib\\samples\\win32\\update.dsp",
179 "..\\lib\\samples\\win32\\update.mak",
180 "..\\lib\\tests\\win32\\libtests.dsp",
181 "..\\lib\\tests\\win32\\libtests.mak",
182 "..\\lib\\win32\\bindevt\\bindevt.dsp",
183 "..\\lib\\win32\\bindevt\\bindevt.mak",
184 "legacy\\BINDBuild.dsw",
185 "legacy\\BuildAll.bat",
186 "legacy\\BuildPost.bat",
187 "legacy\\BuildSetup.bat");
189 my @projectlist = ("..\\bin\\check\\win32\\checkconf.vcxproj",
190 "..\\bin\\check\\win32\\checkconf.vcxproj.filters",
191 "..\\bin\\check\\win32\\checktool.vcxproj",
192 "..\\bin\\check\\win32\\checktool.vcxproj.filters",
193 "..\\bin\\check\\win32\\checkzone.vcxproj",
194 "..\\bin\\check\\win32\\checkzone.vcxproj.filters",
195 "..\\bin\\confgen\\win32\\confgentool.vcxproj",
196 "..\\bin\\confgen\\win32\\confgentool.vcxproj.filters",
197 "..\\bin\\confgen\\win32\\ddnsconfgen.vcxproj",
198 "..\\bin\\confgen\\win32\\ddnsconfgen.vcxproj.filters",
199 "..\\bin\\confgen\\win32\\rndcconfgen.vcxproj",
200 "..\\bin\\confgen\\win32\\rndcconfgen.vcxproj.filters",
201 "..\\bin\\delv\\win32\\delv.vcxproj",
202 "..\\bin\\delv\\win32\\delv.vcxproj.filters",
203 "..\\bin\\dig\\win32\\dig.vcxproj",
204 "..\\bin\\dig\\win32\\dig.vcxproj.filters",
205 "..\\bin\\dig\\win32\\dighost.vcxproj",
206 "..\\bin\\dig\\win32\\dighost.vcxproj.filters",
207 "..\\bin\\dig\\win32\\host.vcxproj",
208 "..\\bin\\dig\\win32\\host.vcxproj.filters",
209 "..\\bin\\dig\\win32\\nslookup.vcxproj",
210 "..\\bin\\dig\\win32\\nslookup.vcxproj.filters",
211 "..\\bin\\dnssec\\win32\\dnssectool.vcxproj",
212 "..\\bin\\dnssec\\win32\\dnssectool.vcxproj.filters",
213 "..\\bin\\dnssec\\win32\\dsfromkey.vcxproj",
214 "..\\bin\\dnssec\\win32\\dsfromkey.vcxproj.filters",
215 "..\\bin\\dnssec\\win32\\importkey.vcxproj",
216 "..\\bin\\dnssec\\win32\\importkey.vcxproj.filters",
217 "..\\bin\\dnssec\\win32\\keyfromlabel.vcxproj",
218 "..\\bin\\dnssec\\win32\\keyfromlabel.vcxproj.filters",
219 "..\\bin\\dnssec\\win32\\keygen.vcxproj",
220 "..\\bin\\dnssec\\win32\\keygen.vcxproj.filters",
221 "..\\bin\\dnssec\\win32\\revoke.vcxproj",
222 "..\\bin\\dnssec\\win32\\revoke.vcxproj.filters",
223 "..\\bin\\dnssec\\win32\\settime.vcxproj",
224 "..\\bin\\dnssec\\win32\\settime.vcxproj.filters",
225 "..\\bin\\dnssec\\win32\\signzone.vcxproj",
226 "..\\bin\\dnssec\\win32\\signzone.vcxproj.filters",
227 "..\\bin\\dnssec\\win32\\verify.vcxproj",
228 "..\\bin\\dnssec\\win32\\verify.vcxproj.filters",
229 "..\\bin\\named\\win32\\named.vcxproj",
230 "..\\bin\\named\\win32\\named.vcxproj.filters",
231 "..\\bin\\nsupdate\\win32\\nsupdate.vcxproj",
232 "..\\bin\\nsupdate\\win32\\nsupdate.vcxproj.filters",
233 "..\\bin\\pkcs11\\win32\\pk11destroy.vcxproj",
234 "..\\bin\\pkcs11\\win32\\pk11destroy.vcxproj.filters",
235 "..\\bin\\pkcs11\\win32\\pk11keygen.vcxproj",
236 "..\\bin\\pkcs11\\win32\\pk11keygen.vcxproj.filters",
237 "..\\bin\\pkcs11\\win32\\pk11list.vcxproj",
238 "..\\bin\\pkcs11\\win32\\pk11list.vcxproj.filters",
239 "..\\bin\\pkcs11\\win32\\pk11tokens.vcxproj",
240 "..\\bin\\pkcs11\\win32\\pk11tokens.vcxproj.filters",
241 "..\\bin\\rndc\\win32\\rndc.vcxproj",
242 "..\\bin\\rndc\\win32\\rndc.vcxproj.filters",
243 "..\\bin\\rndc\\win32\\rndcutil.vcxproj",
244 "..\\bin\\rndc\\win32\\rndcutil.vcxproj.filters",
245 "..\\bin\\tools\\win32\\arpaname.vcxproj",
246 "..\\bin\\tools\\win32\\arpaname.vcxproj.filters",
247 "..\\bin\\tools\\win32\\genrandom.vcxproj",
248 "..\\bin\\tools\\win32\\genrandom.vcxproj.filters",
249 "..\\bin\\tools\\win32\\ischmacfixup.vcxproj",
250 "..\\bin\\tools\\win32\\ischmacfixup.vcxproj.filters",
251 "..\\bin\\tools\\win32\\journalprint.vcxproj",
252 "..\\bin\\tools\\win32\\journalprint.vcxproj.filters",
253 "..\\bin\\tools\\win32\\nsec3hash.vcxproj",
254 "..\\bin\\tools\\win32\\nsec3hash.vcxproj.filters",
255 "..\\bin\\tools\\win32\\rrchecker.vcxproj",
256 "..\\bin\\tools\\win32\\rrchecker.vcxproj.filters",
257 "..\\bin\\tests\\atomic\\win32\\t_atomic.vcxproj",
258 "..\\bin\\tests\\atomic\\win32\\t_atomic.vcxproj.filters",
259 "..\\bin\\tests\\db\\win32\\t_db.vcxproj",
260 "..\\bin\\tests\\db\\win32\\t_db.vcxproj.filters",
261 "..\\bin\\tests\\dst\\win32\\t_dst.vcxproj",
262 "..\\bin\\tests\\dst\\win32\\t_dst.vcxproj.filters",
263 "..\\bin\\tests\\master\\win32\\t_master.vcxproj",
264 "..\\bin\\tests\\master\\win32\\t_master.vcxproj.filters",
265 "..\\bin\\tests\\mem\\win32\\t_mem.vcxproj",
266 "..\\bin\\tests\\mem\\win32\\t_mem.vcxproj.filters",
267 "..\\bin\\tests\\hashes\\win32\\t_hashes.vcxproj",
268 "..\\bin\\tests\\hashes\\win32\\t_hashes.vcxproj.filters",
269 "..\\bin\\tests\\names\\win32\\t_names.vcxproj",
270 "..\\bin\\tests\\names\\win32\\t_names.vcxproj.filters",
271 "..\\bin\\tests\\rbt\\win32\\t_rbt.vcxproj",
272 "..\\bin\\tests\\rbt\\win32\\t_rbt.vcxproj.filters",
273 "..\\bin\\tests\\resolver\\win32\\t_resolver.vcxproj",
274 "..\\bin\\tests\\resolver\\win32\\t_resolver.vcxproj.filters",
275 "..\\bin\\tests\\sockaddr\\win32\\t_sockaddr.vcxproj",
276 "..\\bin\\tests\\sockaddr\\win32\\t_sockaddr.vcxproj.filters",
277 "..\\bin\\tests\\tasks\\win32\\t_tasks.vcxproj",
278 "..\\bin\\tests\\tasks\\win32\\t_tasks.vcxproj.filters",
279 "..\\bin\\tests\\timers\\win32\\t_timers.vcxproj",
280 "..\\bin\\tests\\timers\\win32\\t_timers.vcxproj.filters",
281 "..\\bin\\tests\\win32\\backtrace_test.vcxproj",
282 "..\\bin\\tests\\win32\\backtrace_test.vcxproj.filters",
283 "..\\bin\\tests\\win32\\inter_test.vcxproj",
284 "..\\bin\\tests\\win32\\inter_test.vcxproj.filters",
285 "..\\bin\\tests\\win32\\rwlock_test.vcxproj",
286 "..\\bin\\tests\\win32\\rwlock_test.vcxproj.filters",
287 "..\\bin\\tests\\win32\\shutdown_test.vcxproj",
288 "..\\bin\\tests\\win32\\shutdown_test.vcxproj.filters",
289 "..\\bin\\tests\\win32\\sock_test.vcxproj",
290 "..\\bin\\tests\\win32\\sock_test.vcxproj.filters",
291 "..\\bin\\tests\\win32\\task_test.vcxproj",
292 "..\\bin\\tests\\win32\\task_test.vcxproj.filters",
293 "..\\bin\\tests\\win32\\timer_test.vcxproj",
294 "..\\bin\\tests\\win32\\timer_test.vcxproj.filters",
295 "..\\bin\\tests\\win32\\inter_test.vcxproj",
296 "..\\bin\\tests\\win32\\inter_test.vcxproj.filters",
297 "..\\bin\\tests\\win32\\rwlock_test.vcxproj",
298 "..\\bin\\tests\\win32\\rwlock_test.vcxproj.filters",
299 "..\\bin\\tests\\win32\\shutdown_test.vcxproj",
300 "..\\bin\\tests\\win32\\shutdown_test.vcxproj.filters",
301 "..\\bin\\tests\\win32\\sock_test.vcxproj",
302 "..\\bin\\tests\\win32\\sock_test.vcxproj.filters",
303 "..\\bin\\tests\\win32\\task_test.vcxproj",
304 "..\\bin\\tests\\win32\\task_test.vcxproj.filters",
305 "..\\bin\\tests\\win32\\timer_test.vcxproj",
306 "..\\bin\\tests\\win32\\timer_test.vcxproj.filters",
307 "..\\bin\\win32\\BINDInstall\\BINDInstall.vcxproj",
308 "..\\bin\\win32\\BINDInstall\\BINDInstall.vcxproj.filters",
309 "..\\lib\\bind9\\win32\\libbind9.vcxproj",
310 "..\\lib\\bind9\\win32\\libbind9.vcxproj.filters",
311 "..\\lib\\dns\\win32\\gen.vcxproj",
312 "..\\lib\\dns\\win32\\gen.vcxproj.filters",
313 "..\\lib\\dns\\win32\\libdns.vcxproj",
314 "..\\lib\\dns\\win32\\libdns.vcxproj.filters",
315 "..\\lib\\irs\\win32\\libirs.vcxproj",
316 "..\\lib\\irs\\win32\\libirs.vcxproj.filters",
317 "..\\lib\\isc\\win32\\libisc.vcxproj",
318 "..\\lib\\isc\\win32\\libisc.vcxproj.filters",
319 "..\\lib\\isccc\\win32\\libisccc.vcxproj",
320 "..\\lib\\isccc\\win32\\libisccc.vcxproj.filters",
321 "..\\lib\\isccfg\\win32\\libisccfg.vcxproj",
322 "..\\lib\\isccfg\\win32\\libisccfg.vcxproj.filters",
323 "..\\lib\\lwres\\win32\\liblwres.vcxproj",
324 "..\\lib\\lwres\\win32\\liblwres.vcxproj.filters",
325 "..\\lib\\samples\\win32\\resolve.vcxproj",
326 "..\\lib\\samples\\win32\\resolve.vcxproj.filters",
327 "..\\lib\\samples\\win32\\async.vcxproj",
328 "..\\lib\\samples\\win32\\async.vcxproj.filters",
329 "..\\lib\\samples\\win32\\gai.vcxproj",
330 "..\\lib\\samples\\win32\\gai.vcxproj.filters",
331 "..\\lib\\samples\\win32\\update.vcxproj",
332 "..\\lib\\samples\\win32\\update.vcxproj.filters",
333 "..\\lib\\samples\\win32\\request.vcxproj",
334 "..\\lib\\samples\\win32\\request.vcxproj.filters",
335 "..\\lib\\samples\\win32\\nsprobe.vcxproj",
336 "..\\lib\\samples\\win32\\nsprobe.vcxproj.filters",
337 "..\\lib\\tests\\win32\\libtests.vcxproj",
338 "..\\lib\\tests\\win32\\libtests.vcxproj.filters",
339 "..\\lib\\win32\\bindevt\\bindevt.vcxproj",
340 "..\\lib\\win32\\bindevt\\bindevt.vcxproj.filters",
347 my @substdefh = ("AES_SIT",
350 "DNS_RDATASET_FIXED",
351 "ENABLE_RPZ_NSDNAME",
357 "HAVE_GEOIP_CITY_V6",
362 "HAVE_OPENSSL_ECDSA",
363 "HAVE_OPENSSL_EVP_AES",
371 "ISC_LIST_CHECKINIT",
380 my @substdefp = ("ISC_PLATFORM_HAVEATOMICSTORE",
381 "ISC_PLATFORM_HAVECMPXCHG",
382 "ISC_PLATFORM_HAVEXADD",
383 "ISC_PLATFORM_HAVEXADDQ",
384 "ISC_PLATFORM_NEEDSTRCASESTR",
385 "ISC_PLATFORM_USEBACKTRACE",
386 "ISC_PLATFORM_USESIT",
387 "ISC_PLATFORM_WANTAES");
393 my @substinc = ("GSSAPI_INC",
404 my @substlib = ("GSSAPI_LIB",
417 my @substdll = ("COMERR_DLL",
432 my @substvar = ("BUILD_MACHINE",
452 my @substdefd = ("CRYPTO",
463 my @substcond = ("AES",
478 # enable-xxx/disable-xxx
480 my @enablelist = ("developer",
491 # with-xxx/without-xxx
493 my @withlist = ("aes",
515 my @optionlist = ("help", "verbose", "legacy", "win32", "x64", "clean");
519 my @usage = ("Usage: perl Configure help\n",
520 " perl Configure options* win32|x64\n",
521 " perl Configure clean\n");
526 "'Configure' configures BIND9 build files.\n\n",
528 "\nGeneral Options and Commands:\n",
529 " verbose (options) print messages\n",
530 " help (command) print this help\n",
531 " legacy (options) process only files for legacy build\n",
532 " win32 (command) configure for Win32 platform\n",
533 " x64 (command) configure for x64 platform\n",
534 " clean (command) clean up generated files\n",
535 " <none> (command) print a summary of the configuration\n",
536 "\nOptional Features:\n",
537 " enable-intrinsics enable instrinsic/atomic functions [default=yes]\n",
538 " enable-native-pkcs11 use native PKCS#11 for all crypto [default=no]\n",
539 " enable-openssl-hash use OpenSSL for hash functions [default=yes]\n",
540 " enable-isc-spnego use SPNEGO from lib/dns [default=yes]\n",
541 " enable-filter-aaaa enable filtering of AAAA records [default=no]\n",
542 " enable-fixed-rrset enable fixed rrset ordering [default=no]\n",
543 " enable-developer enable developer build settings [default=no]\n",
544 " enable-rpz-nsip enable rpz-nsip rules [default=yes]\n",
545 " enable-rpz-nsdname enable rpz-nsdname rules [default=yes]\n",
546 " enable-sit enable source identity token [default=yes]\n",
547 "\nOptional Packages:\n",
548 " with-tests build with test suite\n",
549 " with-extra-tests build with extra test suite\n",
550 " with-samples build with sample programs\n",
551 " with-openssl[=PATH] build with OpenSSL yes|no|path\n",
552 " with-pkcs11[=PATH] build with PKCS#11 support yes|no|provider-path\n",
553 " with-ecdsa crypto ECDSA\n",
554 " with-gost[=ENC] crypto GOST yes|no|raw|ans1\n",
555 " with-aes crypto AES\n",
556 " with-sit-alg choose the algorithm for SIT aes|sha1|sha256\n",
557 " with-gssapi[=PATH] build with MIT KfW GSSAPI yes|no|path\n",
558 " with-libxml2[=PATH] build with libxml2 library yes|no|path\n",
559 " with-geoip[=PATH] build with GeoIP support yes|no|path\n",
560 " with-python[=COMMAND] specify python interpreter python|command\n",
561 " with-readline[=PATH] build with readline library support yes|no|path\n",
562 " with-idn[=PATH] build with IDN kit support yes|no|path\n",
563 " with-iconv[=PATH] path of the iconv DLL [default=same than idn]\n",
564 " with-vcredist[=PATH] visual C++ redistributable package yes|path\n",
565 " with-tuning=OPTION tune for plaform size (large|default)\n",
566 " with-cross-compile 32 / 64 bit build / host plaforms\n");
572 my $want_help = "no";
573 my $want_win32 = "no";
575 my $want_clean = "no";
576 my $want_unknown = "no";
578 my $enable_intrinsics = "yes";
579 my $enable_native_pkcs11 = "no";
580 my $enable_openssl_hash = "auto";
581 my $enable_filter_aaaa = "no";
582 my $enable_isc_spnego = "yes";
583 my $enable_fixed_rrset = "no";
584 my $enable_developer = "no";
585 my $enable_rpz_nsip = "yes";
586 my $enable_rpz_nsdname = "yes";
587 my $enable_sit = "yes";
588 my $use_tests = "no";
589 my $use_xtests = "no";
590 my $use_samples = "no";
591 my $use_openssl = "auto";
592 my $openssl_path = "..\\..\\";
593 my $use_pkcs11 = "no";
594 my $pkcs11_path = "unknown";
595 my $use_ecdsa = "auto";
596 my $use_gost = "auto";
597 my $gost_encoding = "raw";
598 my $use_aes = "auto";
599 my $sit_algorithm = "aes";
600 my $use_gssapi = "no";
601 my $gssapi_path = "C:\\Program\ Files\\MIT\\Kerberos\\";
602 my $use_geoip = "no";
604 my $use_libxml2 = "auto";
605 my $libxml2_path = "..\\..\\";
606 my $use_python = "auto";
607 my $python_command = "python";
608 my $use_readline = "no";
609 my $readline_path = "..\\..\\";
611 my $idn_path = "..\\..\\";
612 my $iconv_path = " --idn-- ";
613 my $use_vcredist = "yes";
614 my $vcredist_path = " --infer-- ";
615 my $cross_compile = "no";
616 my $tuning = "default";
618 # no arguments -> usage
632 } elsif (/^help$/i) {
634 } elsif (/^disable-(.*)$/i) {
637 } elsif (/^enable-(.*)$/i) {
640 } elsif (/^without-(.*)$/i) {
643 } elsif (/^with-(.*)=(.*)$/i) {
646 } elsif (/^with-(.*)$/i) {
649 } elsif (/^legacy$/i) {
651 } elsif (/^win32$/i) {
656 } elsif (/^clean$/i) {
659 $want_unknown = "yes";
664 # legacy default to win32
666 if ($legacy_only && ($want_x64 ne "yes")) {
670 # configure the platform
672 if (($want_win32 eq "yes") && ($want_x64 eq "yes")) {
673 die "can't ask for both Win32 and x64 platforms\n";
674 } elsif ($want_win32 eq "yes") {
675 $configvar{"PLATFORM"} = "Win32";
676 $configvar{"BUILD_PLATFORM"} = "Win32";
677 $configvar{"MACHINE"} = "/machine:X86";
678 $configvar{"BUILD_MACHINE"} = "/machine:X86";
679 } elsif ($want_x64 eq "yes") {
680 $configvar{"PLATFORM"} = "x64";
681 $configvar{"BUILD_PLATFORM"} = "x64";
682 $configvar{"MACHINE"} = "/machine:X64";
683 $configvar{"BUILD_MACHINE"} = "/machine:X64";
686 # append seen args to CONFIGARGS define
690 # escape backslashes, spaces and double quotes
691 $arg =~ s/([\\ "])/\\$1/g;
692 if (defined($configdefh{"CONFIGARGS"})) {
693 $configdefh{"CONFIGARGS"} .= " " . $arg;
695 $configdefh{"CONFIGARGS"} = $arg;
699 if (!$configdefh{"CONFIGARGS"}) {
700 # CONFIGARGS default is "default"
701 $configdefh{"CONFIGARGS"} = "\"default\"";
703 my $val = $configdefh{"CONFIGARGS"};
704 $configdefh{"CONFIGARGS"} = "\"'$val'\"";
707 # parse enable/disable
713 if ($key =~ /^intrinsics$/i) {
714 if ($val =~ /^no$/i) {
715 $enable_intrinsics = "no";
717 } elsif ($key =~ /^native-pkcs11$/i) {
718 if ($val =~ /^yes$/i) {
719 $enable_native_pkcs11 = "yes";
721 } elsif ($key =~ /^openssl-hash$/i) {
722 if ($val =~ /^yes$/i) {
723 $enable_openssl_hash = "yes";
724 } elsif ($val =~ /^no$/i) {
725 $enable_openssl_hash = "no";
727 } elsif ($key =~ /^isc-spnego$/i) {
728 if ($val =~ /^no$/i) {
729 $enable_isc_spnego = "no";
731 } elsif ($key =~ /^filter-aaaa$/i) {
732 if ($val =~ /^yes$/i) {
733 $enable_filter_aaaa = "yes";
735 } elsif ($key =~ /^fixed-rrset$/i) {
736 if ($val =~ /^yes$/i) {
737 $enable_fixed_rrset = "yes";
739 } elsif ($key =~ /^developer$/i) {
740 if ($val =~ /^yes$/i) {
741 $enable_developer = "yes";
743 } elsif ($key =~ /^rpz-nsip$/i) {
744 if ($val =~ /^no$/i) {
745 $enable_rpz_nsip = "no";
747 } elsif ($key =~ /^rpz-nsdname$/i) {
748 if ($val =~ /^no$/i) {
749 $enable_rpz_nsdname = "no";
751 } elsif ($key =~ /^sit$/i) {
752 if ($val =~ /^no$/i) {
756 $want_unknown = "yes";
758 $unknown_value = "disable-" . $key;
760 $unknown_value = "enable-". $key;
765 # enable-developer expansion now
767 if ($enable_developer eq "yes") {
768 $configdefh{"ISC_LIST_CHECKINIT"} = 1;
769 $enable_filter_aaaa = "yes";
771 $enable_fixed_rrset = "yes";
772 # TODO: dlz filesystem
774 $use_samples = "yes";
784 if ($key =~ /^tests$/i) {
785 if ($val =~ /^yes$/i) {
788 } elsif ($key =~ /^extra-tests$/i) {
789 if ($val =~ /^yes$/i) {
793 } elsif ($key =~ /^samples$/i) {
794 if ($val =~ /^yes$/i) {
795 $use_samples = "yes";
797 } elsif ($key =~ /^openssl$/i) {
798 if ($val =~ /^no$/i) {
800 } elsif ($val !~ /^yes$/i) {
801 $use_openssl = "yes";
802 $openssl_path = $val;
804 } elsif ($key =~ /^pkcs11$/i) {
805 if ($val =~ /^yes$/i) {
807 } elsif ($val !~ /^no$/i) {
810 $pkcs11_path =~ s/\.dll$//i;
812 } elsif ($key =~ /^ecdsa$/i) {
813 if ($val =~ /^no$/i) {
815 } elsif ($val =~ /^yes$/i) {
818 } elsif ($key =~ /^gost$/i) {
819 if ($val =~ /^no$/i) {
821 } elsif ($val =~ /^yes$/i) {
823 $gost_encoding = $val;
825 } elsif ($key =~ /^aes$/i) {
826 if ($val =~ /^no$/i) {
828 } elsif ($val =~ /^yes$/i) {
831 } elsif ($key =~ /^sit-alg$/i) {
832 $sit_algorithm = $val;
833 } elsif ($key =~ /^gssapi$/i) {
834 if ($val !~ /^no$/i) {
836 if ($val !~ /^yes$/i) {
840 } elsif ($key =~ /^libxml2$/i) {
841 if ($val =~ /^no$/i) {
843 } elsif ($val !~ /^yes$/i) {
844 $use_libxml2 = "yes";
845 $libxml2_path = $val;
847 } elsif ($key =~ /^geoip$/i) {
848 if ($val !~ /^no$/i) {
850 if ($val !~ /^yes$/i) {
854 } elsif ($key =~ /^readline$/i) {
855 if ($val !~ /^no$/i) {
856 $use_readline = "yes";
857 if ($val !~ /^yes$/i) {
858 $readline_path = $val;
861 } elsif ($key =~ /^idn$/i) {
862 if ($val !~ /^no$/i) {
864 if ($val !~ /^yes$/i) {
868 } elsif ($key =~ /^iconv$/i) {
869 if ($val =~ /^no$/i) {
870 $want_unknown = "yes";
871 $unknown_value = "without-iconv doesn't make sense)";
872 } elsif ($val !~ /^yes$/i) {
875 } elsif ($key =~ /^python$/i) {
876 if ($val =~ /^no$/i) {
880 if ($val !~ /^yes$/i) {
881 $python_command = $val;
884 } elsif ($key =~ /^vcredist$/i) {
885 if ($val =~ /^no$/i) {
886 $want_unknown = "yes";
887 $unknown_value = "without-vcredist (vcredist is required)";
888 } elsif ($val !~ /^yes$/i) {
889 $vcredist_path = $val;
891 } elsif ($key =~ /^cross-compile$/i) {
892 if ($val =~ /^yes$/i) {
893 $cross_compile = "yes";
895 } elsif ($key =~ /^tuning$/i) {
896 if ($val =~ /^large$/i) {
900 $want_unknown = "yes";
902 $unknown_value = "without-" . $key;
904 $unknown_value = "with-" . $key;
909 # resolve enable-openssl-hash
910 if ($enable_openssl_hash eq "auto") {
911 if ($use_openssl ne "no") {
912 if ($enable_native_pkcs11 eq "yes") {
913 $enable_openssl_hash="no";
915 $enable_openssl_hash="yes";
918 $enable_openssl_hash="no";
922 if ($want_help ne "no") {
929 # clean up and exit if requested
930 if ($want_clean eq "yes") {
932 foreach $file (@filelist) {
936 foreach $file (@projectlist) {
943 if ($want_unknown ne "no") {
944 print STDERR
"can't parse $unknown_value\n";
949 if ($want_win32 eq "yes") {
950 print "configure for win32\n";
952 if ($want_x64 eq "yes") {
953 print "configure for x64\n";
955 if ($cross_compile eq "yes") {
956 print "cross compiling";
957 if ($want_x64 eq "yes") {
958 print ": build on win32 for x64 host\n";
959 } elsif ($want_win32 eq "yes") {
960 print ": build on x64 for win32 host\n";
965 if ($enable_intrinsics eq "yes") {
966 print "intrinsics: enabled\n";
968 print "intrinsics: disabled\n";
970 if ($enable_native_pkcs11 eq "yes") {
971 print "native-pkcs11: enabled\n";
973 print "native-pkcs11: disabled\n";
975 if ($enable_openssl_hash eq "yes") {
976 print "openssl-hash: enabled\n";
978 print "openssl-hash: disabled\n";
980 if ($enable_isc_spnego eq "yes") {
981 print "isc-spnego: enabled\n";
983 print "isc-spnego: disabled\n";
985 if ($enable_filter_aaaa eq "yes") {
986 print "filter-aaaa: enabled\n";
988 print "filter-aaaa: disabled\n";
990 if ($enable_fixed_rrset eq "yes") {
991 print "fixed-rrset: enabled\n";
993 print "fixed-rrset: disabled\n";
995 if ($enable_developer eq "yes") {
996 print "developer: enabled\n";
998 print "developer: disabled\n";
1000 if ($enable_rpz_nsip eq "yes") {
1001 print "rpz-nsip: enabled\n";
1003 print "rpz-nsip: disabled\n";
1005 if ($enable_rpz_nsdname eq "yes") {
1006 print "rpz-nsdname: enabled\n";
1008 print "rpz-nsdname: disabled\n";
1010 if ($enable_sit eq "yes") {
1011 print "sit: enabled\n";
1012 print "sit algorithm: $sit_algorithm\n";
1014 print "sit: disabled\n";
1016 if ($use_openssl eq "no") {
1017 print "openssl: disabled\n";
1019 print "openssl-path: $openssl_path\n";
1021 if ($use_tests eq "yes") {
1022 print "tests: enabled\n";
1024 if ($use_xtests eq "yes") {
1025 print "extra tests: enabled\n";
1027 if ($use_samples eq "yes") {
1028 print "sample programs: enabled\n";
1030 if ($use_pkcs11 eq "no") {
1031 print "pkcs11: disabled\n";
1033 print "pkcs11-provider-path: $pkcs11_path\n";
1035 if ($use_ecdsa eq "no") {
1036 print "ecdsa: disabled\n";
1038 print "ecdsa: enabled\n";
1040 if ($use_gost eq "no") {
1041 print "gost: disabled\n";
1043 print "gost: enabled\n";
1044 print "gost private key encoding: $gost_encoding\n";
1046 if ($use_aes eq "no") {
1047 print "aes: disabled\n";
1049 print "aes: enabled\n";
1051 if ($use_gssapi eq "no") {
1052 print "gssapi: disabled\n";
1054 print "gssapi-path: $gssapi_path\n";
1056 if ($use_libxml2 eq "no") {
1057 print "libxml2: disabled\n";
1059 print "libxml2-path: $libxml2_path\n";
1061 if ($use_geoip eq "no") {
1062 print "geoip: disabled\n";
1064 print "geoip-path: $geoip_path\n";
1066 if ($use_readline eq "no") {
1067 print "readline: disabled\n";
1069 print "readline-path: $readline_path\n";
1071 if ($use_idn eq "no") {
1072 print "idn: disabled\n";
1074 print "idn-path: $idn_path\n";
1075 if ($iconv_path ne " --idn-- ") {
1076 print "iconv-path: $iconv_path\n";
1079 if ($use_python eq "no") {
1080 print "python: disabled\n";
1082 print "python-command: $python_command\n";
1084 print "vcredist-path: $vcredist_path\n";
1089 # infer vcredist when not given
1090 if ($vcredist_path eq " --infer-- ") {
1092 print "trying to infer vcredist path from build environment\n";
1096 push(@vcpaths, $ENV{"VCRedistPath"}) if ($ENV{"VCRedistPath"} ne "");
1097 push(@vcpaths, File
::Spec
->catfile( cwd
(), "..", ".." ));
1099 if ($ENV{"FrameworkSDKDir"} ne "" && $want_win32 eq "yes") {
1100 push(@vcpaths, File
::Spec
->catfile($ENV{"FrameworkSDKDir"},
1101 "BootStrapper", "Packages",
1103 } elsif ($ENV{"FrameworkSDKDir"} ne "" && $want_x64 eq "yes") {
1104 push(@vcpaths, File
::Spec
->catfile($ENV{"FrameworkSDKDir"},
1105 "BootStrapper", "Packages",
1109 if ($ENV{"WindowsSDKDir"} ne "" && $want_win32 eq "yes") {
1110 push(@vcpaths, File
::Spec
->catfile($ENV{"WindowsSDKDir"},
1111 "BootStrapper", "Packages",
1113 } elsif ($ENV{"WindowsSDKDir"} ne "" && $want_x64 eq "yes") {
1114 push(@vcpaths, File
::Spec
->catfile($ENV{"WindowsSDKDir"},
1115 "BootStrapper", "Packages",
1119 if ($ENV{"WindowsSDKDir_old"} ne "" && $want_win32 eq "yes") {
1120 push(@vcpaths, File
::Spec
->catfile($ENV{"WindowsSDKDir_old"},
1121 "BootStrapper", "Packages",
1123 } elsif ($ENV{"WindowsSDKDir_old"} ne "" && $want_x64 eq "yes") {
1124 push(@vcpaths, File
::Spec
->catfile($ENV{"WindowsSDKDir_old"},
1125 "BootStrapper", "Packages",
1129 if ($ENV{"VCINSTALLDIR"}) {
1130 push(@vcpaths, File
::Spec
->catfile($ENV{"VCINSTALLDIR"},
1135 if ($want_win32 eq "yes") {
1136 $rfile = "vcredist_x86.exe";
1138 $rfile = "vcredist_x64.exe";
1141 foreach (@vcpaths) {
1142 my $vp = File
::Spec
->catfile($_, $rfile);
1144 $vcredist_path = $vp;
1149 if ($vcredist_path eq " --infer-- ") {
1150 die "with-vcredist is REQUIRED\n";
1154 print "found vcredist at " . $vcredist_path . "\n";
1160 open F
, ">mscver.c" || die $!;
1162 #include <windows.h>
1168 printf("%d\n", _MSC_VER
);
1173 my $compret = `cl /nologo /MD mscver.c`;
1174 if (grep { -f
and -x
} ".\\mscver.exe") {
1175 $msc_ver = `.\\mscver.exe`;
1177 die "can't get _MSC_VER value: $compret\n";
1180 print "_MSV_VER == $msc_ver\n";
1182 if ($msc_ver < 1600) {
1183 print STDERR
"warning: old version of C++ compiler/Visual Studio\n";
1184 print STDERR
"only the legacy (cf legacy\\win32-build.txt) will work\n";
1187 # gen single threaded for < VS 2005
1189 if ($msc_ver < 1400) {
1190 $configvar{"COPTML"} = "/ML";
1191 $configvar{"COPTMLD"} = "/MLD";
1194 # /GX deprecated in VS 2005
1196 if ($msc_ver < 1400) {
1197 $configvar{"COPTX"} = "/GX";
1199 $configvar{"COPTX"} = "/EHsc";
1204 if ($msc_ver < 1400) {
1205 $configvar{"COPTY"} = "/YX";
1208 # backtrace for >= VS 2012
1210 if ($msc_ver >= 1700) {
1211 $configdefp{"ISC_PLATFORM_USEBACKTRACE"} = 1;
1214 # no version of MSVS supports strcasestr() yet
1215 $configdefp{"ISC_PLATFORM_NEEDSTRCASESTR"} = 1;
1217 # warn when cross compiling
1219 if ($cross_compile eq "yes") {
1220 if ($want_x64 eq "yes") {
1221 $configvar{"BUILD_PLATFORM"} = "Win32";
1222 $configvar{"BUILD_MACHINE"} = "/machine:X86";
1224 if ($want_win32 eq "yes") {
1225 $configvar{"BUILD_PLATFORM"} = "x64";
1226 $configvar{"BUILD_MACHINE"} = "/machine:X64";
1228 } elsif ($want_win32 eq "yes") {
1229 open F
, ">cross.c" || die $!;
1231 #include <windows.h>
1238 fprintf
(stderr
, "compiling for x64 when win32 was asked?!\n");
1244 my $compret = `cl /nologo /MD cross.c`;
1245 if (grep { -f
and -x
} ".\\cross.exe") {
1246 my $cross = `.\\cross.exe`;
1248 print STDERR
$cross;
1251 print STDERR
"can't check cross compile: $compret\n";
1254 open F
, ">cross.c" || die $!;
1256 #include <windows.h>
1263 fprintf
(stderr
, "compiling in 32 bits when x64 was asked?!\n");
1269 my $compret = `cl /nologo /MD cross.c`;
1270 if (grep { -f
and -x
} ".\\cross.exe") {
1271 my $cross = `.\\cross.exe`;
1273 print STDERR
$cross;
1276 print STDERR
"can't check cross compile: $compret\n";
1283 if ($enable_intrinsics eq "yes") {
1284 $configcond{"ATOMIC"} = 1;
1285 $configvar{"INTRINSIC"} = "true";
1286 $configvar{"COPTI"} = "/Oi";
1287 $configdefp{"ISC_PLATFORM_HAVEXADD"} = 1;
1288 if ($want_x64 eq "yes") {
1289 $configdefp{"ISC_PLATFORM_HAVEXADDQ"} = 1;
1291 $configdefp{"ISC_PLATFORM_HAVEATOMICSTORE"} = 1;
1292 $configdefp{"ISC_PLATFORM_HAVECMPXCHG"} = 1;
1294 $configvar{"INTRINSIC"} = "false";
1297 # enable-native-pkcs11
1298 if ($enable_native_pkcs11 eq "yes") {
1299 if ($use_openssl eq "auto") {
1300 $use_openssl = "no";
1302 if ($use_openssl ne "no") {
1303 die "can't have both OpenSSL and native PKCS#11\n";
1305 if ($use_pkcs11 ne "yes") {
1307 print "native PKCS#11 support: force with-pkcs11\n";
1309 $use_pkcs11 = "yes";
1311 if ($pkcs11_path eq "unknown") {
1313 print "native PKCS#11 support: no PKCS#11 provider defined?\n";
1316 $configdefd{"CRYPTO"} = "PKCS11CRYPTO";
1317 if ($use_ecdsa eq "no") {
1319 print "no ECDSA support in native PKCS#11\n";
1323 print "enabled ECDSA support in native PKCS#11\n";
1325 $configdefh{"HAVE_PKCS11_ECDSA"} = 1;
1327 if ($use_gost eq "no") {
1329 print "no GOST support in native PKCS#11\n";
1333 print "enabled GOST support in native PKCS#11\n";
1335 $configdefh{"HAVE_PKCS11_GOST"} = 1;
1337 if ($use_aes eq "no") {
1339 print "no AES support in native PKCS#11\n";
1343 print "enabled AES support in native PKCS#11\n";
1345 $use_aes = "pkcs11";
1349 # enable-filter-aaaa
1350 if ($enable_filter_aaaa eq "yes") {
1351 $configdefh{"ALLOW_FILTER_AAAA"} = 1;
1354 # enable-fixed-rrset
1355 if ($enable_fixed_rrset eq "yes") {
1356 $configdefh{"DNS_RDATASET_FIXED"} = 1;
1360 if ($enable_rpz_nsip ne "no") {
1361 $configdefh{"ENABLE_RPZ_NSIP"} = 1;
1364 # enable-rpz-nsdname
1365 if ($enable_rpz_nsdname ne "no") {
1366 $configdefh{"ENABLE_RPZ_NSDNAME"} = 1;
1370 if ($enable_sit ne "no") {
1371 $configdefp{"ISC_PLATFORM_USESIT"} = 1;
1375 if ($use_tests eq "yes") {
1376 $configcond{"TESTS"} = 1;
1380 if ($use_xtests eq "yes") {
1381 $configcond{"XTESTS"} = 1;
1385 if ($use_samples eq "yes") {
1386 $configcond{"SAMPLES"} = 1;
1390 if ($use_openssl eq "no") {
1392 print "OpenSSL library is disabled\n";
1394 } elsif ($use_openssl eq "auto") {
1396 print "checking for an OpenSSL built directory at sibling root\n";
1398 opendir DIR
, $openssl_path || die "No Directory: $!\n";
1399 my @dirlist = grep (/^openssl-[0-9]+\.[0-9]+\.[0-9]+[a-z]{0,1}$/i,
1403 # Make sure we have something
1404 if (scalar(@dirlist) == 0) {
1405 die "can't find an OpenSSL at sibling root\n";
1407 # Now see if we have a directory or just a file.
1408 # Make sure we are case insensitive
1410 foreach $file (sort {uc($b) cmp uc($a)} @dirlist) {
1411 if (-f File
::Spec
->catfile($openssl_path,
1415 $openssl_path = File
::Spec
->catdir($openssl_path, $file);
1416 $use_openssl = "yes";
1421 # If we have one use it otherwise report the error
1422 if ($use_openssl eq "auto") {
1423 die "can't find an OpenSSL built directory at sibling root\n";
1426 # falls into (so no else)
1427 if ($use_openssl eq "yes") {
1428 $openssl_path = File
::Spec
->rel2abs($openssl_path);
1430 print "checking for OpenSSL built directory at \"$openssl_path\"\n";
1432 if (!-f File
::Spec
->catfile($openssl_path,
1435 die "can't find OpenSSL opensslv.h include\n";
1437 if (!-f File
::Spec
->catfile($openssl_path, "out32dll", "libeay32.lib")) {
1438 die "can't find OpenSSL libeay32.lib library\n";
1440 if (!-f File
::Spec
->catfile($openssl_path, "out32dll", "libeay32.dll")) {
1441 die "can't find OpenSSL libeay32.dll DLL\n";
1443 my $openssl_inc = File
::Spec
->catdir($openssl_path, "inc32");
1444 my $openssl_libdir = File
::Spec
->catdir($openssl_path, "out32dll");
1445 my $openssl_lib = File
::Spec
->catfile($openssl_libdir, "libeay32.lib");
1446 my $openssl_dll = File
::Spec
->catfile($openssl_libdir, "libeay32.dll");
1448 $configcond{"OPENSSL"} = 1;
1449 $configdefd{"CRYPTO"} = "OPENSSL";
1450 $configvar{"OPENSSL_PATH"} = "$openssl_path";
1451 $configinc{"OPENSSL_INC"} = "$openssl_inc";
1452 $configlib{"OPENSSL_LIB"} = "$openssl_lib";
1453 $configdll{"OPENSSL_DLL"} = "$openssl_dll";
1454 if (-f File
::Spec
->catfile($openssl_inc, "openssl", "dsa.h")) {
1455 $configdefh{"HAVE_OPENSSL_DSA"} = 1;
1456 } elsif ($verbose) {
1457 print "OpenSSL DSA support is disabled\n";
1462 if ($use_openssl eq "yes") {
1464 print "checking whether linking with OpenSSL works\n";
1466 my $dll = $configdll{"OPENSSL_DLL"};
1467 my $ret = `copy "$dll" .`;
1469 die "Can't copy OpenSSL DLL to working directory: $ret\n";
1471 open F
, ">testossl.c" || die $!;
1473 #include <openssl/err.h>
1483 my $include = $configinc{"OPENSSL_INC"};
1484 my $library = $configlib{"OPENSSL_LIB"};
1485 $compret = `cl /nologo /MD /I "$include" testossl.c "$library"`;
1486 if (grep { -f
and -x
} ".\\testossl.exe") {
1489 die "OpenSSL test failed\n";
1492 die "can't compile OpenSSL test: $compret\n";
1496 # check OpenSSL version
1497 if ($use_openssl eq "yes") {
1499 printf "checking OpenSSL library version\n";
1501 open F
, ">testosslv.c" || die $!;
1504 #include <openssl/opensslv.h>
1507 if ((OPENSSL_VERSION_NUMBER
>= 0x009070cfL
&&
1508 OPENSSL_VERSION_NUMBER
< 0x00908000L
) ||
1509 OPENSSL_VERSION_NUMBER
>= 0x0090804fL
)
1511 printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n",
1512 OPENSSL_VERSION_NUMBER
);
1513 printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n"
1514 "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n");
1519 my $include = $configinc{"OPENSSL_INC"};
1520 my $library = $configlib{"OPENSSL_LIB"};
1521 $compret = `cl /nologo /MD /I "$include" testosslv.c "$library"`;
1522 if (grep { -f
and -x
} ".\\testosslv.exe") {
1525 die "OpenSSL version test failed\n";
1528 die "can't compile OpenSSL version test: $compret\n";
1532 # check EVP_sha256 / EVP_sha384 / EVP_sha512
1534 if ($use_openssl eq "yes") {
1536 printf "checking for EVP_sha256\n";
1538 open F
, ">testsha256.c" || die $!;
1540 extern void
*EVP_sha256
();
1543 return EVP_sha256
() != 0;
1547 my $library = $configlib{"OPENSSL_LIB"};
1548 $compret = `cl /nologo /MD testsha256.c "$library"`;
1549 if (grep { -f
and -x
} ".\\testsha256.exe") {
1550 `.\\testsha256.exe`;
1553 print "EVP_sha256 test failed: disabling EVP_sha256\n";
1556 $enable_openssl_hash = "no";
1558 $configdefh{"HAVE_EVP_SHA256"} = 1;
1562 print "can't compile EVP_sha256 test: $compret\n";
1563 print "disabling EVP_sha256\n";
1566 $enable_openssl_hash = "no";
1570 printf "checking for EVP_sha384\n";
1572 open F
, ">testsha384.c" || die $!;
1574 extern void
*EVP_sha384
();
1577 return EVP_sha384
() != 0;
1581 $compret = `cl /nologo /MD testsha384.c "$library"`;
1582 if (grep { -f
and -x
} ".\\testsha384.exe") {
1583 `.\\testsha384.exe`;
1586 print "EVP_sha384 test failed: disabling EVP_sha384\n";
1589 $enable_openssl_hash = "no";
1591 $configdefh{"HAVE_EVP_SHA384"} = 1;
1595 print "can't compile EVP_sha384 test: $compret\n";
1596 print "disabling EVP_sha384\n";
1599 $enable_openssl_hash = "no";
1603 printf "checking for EVP_sha512\n";
1605 open F
, ">testsha512.c" || die $!;
1607 extern void
*EVP_sha512
();
1610 return EVP_sha512
() != 0;
1614 $compret = `cl /nologo /MD testsha512.c "$library"`;
1615 if (grep { -f
and -x
} ".\\testsha512.exe") {
1616 `.\\testsha512.exe`;
1619 print "EVP_sha512 test failed: disabling EVP_sha512\n";
1622 $configdefh{"HAVE_EVP_SHA512"} = 1;
1626 print "can't compile EVP_sha512 test: $compret\n";
1627 print "disabling EVP_sha512\n";
1633 if ($use_openssl eq "no") {
1636 if ($use_ecdsa eq "auto") {
1638 print "checking for OpenSSL ECDSA support\n";
1640 open F
, ">testecdsa.c" || die $!;
1642 #include <openssl/ecdsa.h>
1643 #include <openssl/objects.h>
1648 EC_KEY
*ec256
, *ec384
;
1650 ec256
= EC_KEY_new_by_curve_name
(NID_X9_62_prime256v1
);
1651 ec384
= EC_KEY_new_by_curve_name
(NID_secp384r1
);
1652 if (ec256
== NULL
|| ec384
== NULL
)
1658 my $include = $configinc{"OPENSSL_INC"};
1659 my $library = $configlib{"OPENSSL_LIB"};
1660 $compret = `cl /nologo /MD /I "$include" testecdsa.c "$library"`;
1661 if (grep { -f
and -x
} ".\\testecdsa.exe") {
1665 print "ECDSA test failed: disabling ECDSA\n";
1671 print "can't compile ECDSA test: $compret\n";
1672 print "disabling ECDSA\n";
1678 if ($use_ecdsa ne "no") {
1680 $configdefh{"HAVE_OPENSSL_ECDSA"} = 1;
1684 if ($use_openssl eq "no") {
1687 if ($use_gost eq "auto") {
1689 print "checking for OpenSSL GOST support\n";
1691 open F
, ">testgost.c" || die $!;
1693 #include <openssl/conf.h>
1694 #include <openssl/engine.h>
1699 #if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
1704 OPENSSL_config
(NULL
);
1706 e
= ENGINE_by_id
("gost");
1709 if (ENGINE_init
(e
) <= 0)
1718 my $include = $configinc{"OPENSSL_INC"};
1719 my $library = $configlib{"OPENSSL_LIB"};
1720 $compret = `cl /nologo /MD /I "$include" testgost.c "$library"`;
1721 if (grep { -f
and -x
} ".\\testgost.exe") {
1725 print "GOST test failed: disabling GOST\n";
1731 print "can't compile GOST test: $compret\n";
1732 print "disabling GOST\n";
1738 if ($use_gost ne "no") {
1740 $configdefh{"HAVE_OPENSSL_GOST"} = 1;
1743 if ($gost_encoding eq "ans1") {
1744 $configdefh{"PREFER_GOSTASN1"} = 1;
1745 } elsif ($gost_encoding ne "raw") {
1746 die "Unrecognized GOST private key encoding: $gost_encoding\n";
1750 if ($use_openssl eq "no") {
1751 if ($use_aes ne "pkcs11") {
1755 if ($use_aes eq "auto") {
1757 print "checking for OpenSSL EVP AES support\n";
1760 open F
, ">testevpaes.c" || die $!;
1762 #include <openssl/evp.h>
1767 EVP_CIPHER
*aes128
, *aes192
, *aes256
;
1769 aes128
= EVP_aes_128_ecb
();
1770 aes192
= EVP_aes_192_ecb
();
1771 aes256
= EVP_aes_256_ecb
();
1772 if (aes128
== NULL
|| aes192
== NULL
|| aes256
== NULL
)
1778 my $include = $configinc{"OPENSSL_INC"};
1779 my $library = $configlib{"OPENSSL_LIB"};
1780 $compret = `cl /nologo /MD /I "$include" testevpaes.c "$library"`;
1781 if (grep { -f
and -x
} ".\\testevpaes.exe") {
1782 `.\\testevpaes.exe`;
1785 print "EVP AES test failed: disabling EVP AES\n";
1791 print "can't compile EVP AES test: $compret\n";
1792 print "disabling EVP AES\n";
1798 if ($use_aes eq "auto") {
1800 print "checking for OpenSSL native AES support\n";
1802 $use_aes = "native";
1803 open F
, ">testaes.c" || die $!;
1805 #include <openssl/aes.h>
1808 const unsigned char bufin
[16];
1809 unsigned char bufout
[16];
1814 AES_encrypt
(bufin
, bufout
, &k
);
1819 my $include = $configinc{"OPENSSL_INC"};
1820 my $library = $configlib{"OPENSSL_LIB"};
1821 $compret = `cl /nologo /MD /I "$include" testaes.c "$library"`;
1822 if (grep { -f
and -x
} ".\\testaes.exe") {
1826 print "native AES test failed: disabling AES\n";
1832 print "can't compile native AES test: $compret\n";
1833 print "disabling AES\n";
1839 if ($use_aes eq "yes") {
1840 $configdefh{"HAVE_OPENSSL_EVP_AES"} = 1;
1841 } elsif ($use_aes eq "evp") {
1842 $configdefh{"HAVE_OPENSSL_EVP_AES"} = 1;
1844 } elsif ($use_aes eq "native") {
1845 $configdefh{"HAVE_OPENSSL_AES"} = 1;
1847 } elsif ($use_aes eq "pkcs11") {
1851 if ($use_aes eq "yes") {
1852 $configdefp{"ISC_PLATFORM_WANTAES"} = 1;
1853 $configcond{"AES"} = 1;
1857 if ($enable_sit ne "no") {
1858 if ($sit_algorithm eq "aes") {
1859 if ($use_aes ne "yes") {
1860 $sit_algorithm = "sha256";
1862 $configdefh{"AES_SIT"} = 1;
1865 if ($sit_algorithm eq "sha1") {
1866 $configdefh{"HMAC_SHA1_SIT"} = 1;
1867 } elsif ($sit_algorithm eq "sha256") {
1868 $configdefh{"HMAC_SHA256_SIT"} = 1;
1869 } elsif ($sit_algorithm ne "aes") {
1870 die "Unrecognized SIT algorithm: $sit_algorithm\n";
1874 # enable-openssl-hash
1875 if ($enable_openssl_hash eq "yes") {
1876 if ($use_openssl eq "no") {
1877 die "No OpenSSL for hash functions\n";
1879 $configdefp{"ISC_PLATFORM_OPENSSLHASH"} = 1;
1881 print "checking HMAC_Init() return type\n";
1883 open F
, ">testhmac.c" || die $!;
1885 #include <openssl/hmac.h>
1891 int n
= HMAC_Init
(&ctx
, NULL
, 0, NULL
);
1892 n
+= HMAC_Update
(&ctx
, NULL
, 0);
1893 n
+= HMAC_Final
(&ctx
, NULL
, NULL
);
1898 my $include = $configinc{"OPENSSL_INC"};
1899 my $library = $configlib{"OPENSSL_LIB"};
1900 $compret = `cl /nologo /MD /I "$include" testhmac.c "$library"`;
1901 if (grep { -f
and -x
} ".\\testhmac.exe") {
1902 $configdefh{"HMAC_RETURN_INT"} = 1;
1907 if ($use_pkcs11 ne "no") {
1908 $configcond{"PKCS11"} = 1;
1909 $configdefd{"USE_PKCS11"} = "USE_PKCS11";
1910 $configvar{"PKCS11_TOOLS"} = "pkcs11";
1911 $configdefd{"PK11_LIB_LOCATION"} = "PK11_LIB_LOCATION=\"$pkcs11_path\"";
1915 if ($use_gssapi eq "no") {
1917 print "gssapi library is disabled\n";
1920 $gssapi_path = File
::Spec
->rel2abs($gssapi_path);
1922 print "checking for gssapi directory at \"$gssapi_path\"\n";
1924 $configcond{"GSSAPI"} = 1;
1925 $configdefd{"USE_GSSAPI"} = "GSSAPI";
1926 if (!-f File
::Spec
->catfile($gssapi_path, "include",
1927 "gssapi", "gssapi.h")) {
1928 die "can't find gssapi.h include\n";
1930 if (!-f File
::Spec
->catfile($gssapi_path, "include",
1931 "gssapi", "gssapi_krb5.h")) {
1932 die "can't find gssapi_krb5.h include\n";
1934 if (!-f File
::Spec
->catfile($gssapi_path, "include",
1935 "krb5", "krb5.h")) {
1936 die "can't find krb5.h include\n";
1938 $configinc{"GSSAPI_INC"} = File
::Spec
->catdir($gssapi_path, "include");
1942 if ($want_win32 eq "yes") {
1944 if (!-f File
::Spec
->catfile($gssapi_path, "lib", "i386",
1945 "gssapi${bits}.lib")) {
1946 die "can't find gssapi${bits}.lib library\n";
1948 $gssapi_lib = File
::Spec
->catfile($gssapi_path, "lib", "i386",
1949 "gssapi${bits}.lib");
1950 if (!-f File
::Spec
->catfile($gssapi_path, "lib", "i386",
1951 "krb5_${bits}.lib")) {
1952 die "can't find krb5_${bits}.lib library\n";
1954 $krb5_lib = File
::Spec
->catfile($gssapi_path, "lib", "i386",
1955 "krb5_${bits}.lib");
1956 } elsif ($want_x64 eq "yes") {
1958 if (!-f File
::Spec
->catfile($gssapi_path, "lib", "amd64",
1959 "gssapi${bits}.lib")) {
1960 die "can't find gssapi${bits}.lib library\n";
1962 $gssapi_lib = File
::Spec
->catfile($gssapi_path, "lib", "amd64",
1963 "gssapi${bits}.lib");
1964 if (!-f File
::Spec
->catfile($gssapi_path, "lib", "amd64",
1965 "krb5_${bits}.lib")) {
1966 die "can't find krb5_${bits}.lib library\n";
1968 $krb5_lib = File
::Spec
->catfile($gssapi_path, "lib", "amd64",
1969 "krb5_${bits}.lib");
1971 die "can't happen: no choice between Win32 and x64\n";
1973 if (!-f File
::Spec
->catfile($gssapi_path, "bin", "gssapi${bits}.dll")) {
1974 die "can't find gssapi${bits}.dll DLL\n";
1976 if (!-f File
::Spec
->catfile($gssapi_path, "bin", "krb5_${bits}.dll")) {
1977 die "can't find krb5_${bits}.dll DLL\n";
1979 if (!-f File
::Spec
->catfile($gssapi_path, "bin", "comerr${bits}.dll")) {
1980 die "can't find comerr${bits}.dll DLL\n";
1982 if (!-f File
::Spec
->catfile($gssapi_path, "bin", "k5sprt${bits}.dll")) {
1983 die "can't find k5sprt${bits}.dll DLL\n";
1985 if (!-f File
::Spec
->catfile($gssapi_path, "bin", "wshelp${bits}.dll")) {
1986 die "can't find wshelp${bits}.dll DLL\n";
1988 $configlib{"GSSAPI_LIB"} = "$gssapi_lib";
1989 $configlib{"KRB5_LIB"} = "$krb5_lib";
1990 my $gssapi_dll = File
::Spec
->catfile($gssapi_path, "bin",
1991 "gssapi${bits}.dll");
1992 $configdll{"GSSAPI_DLL"} = "$gssapi_dll";
1993 my $krb5_dll = File
::Spec
->catfile($gssapi_path, "bin",
1994 "krb5_${bits}.dll");
1995 $configdll{"KRB5_DLL"} = "$krb5_dll";
1996 my $comerr_dll = File
::Spec
->catfile($gssapi_path, "bin",
1997 "comerr${bits}.dll");
1998 $configdll{"COMERR_DLL"} = "$comerr_dll";
1999 my $k5sprt_dll = File
::Spec
->catfile($gssapi_path, "bin",
2000 "k5sprt${bits}.dll");
2001 $configdll{"K5SPRT_DLL"} = "$k5sprt_dll";
2002 my $wshelp_dll = File
::Spec
->catfile($gssapi_path, "bin",
2003 "wshelp${bits}.dll");
2004 $configdll{"WSHELP_DLL"} = "$wshelp_dll";
2008 if ($use_gssapi ne "yes") {
2009 $enable_isc_spnego = "no";
2010 } elsif ($enable_isc_spnego eq "yes") {
2011 if ($use_gssapi eq "no") {
2012 die "No GSSAPI for SPNEGO\n";
2014 $configdefd{"USE_ISC_SPNEGO"} = "USE_ISC_SPNEGO";
2018 if ($use_geoip eq "no") {
2020 print "geoip library is disabled\n";
2023 $configcond{"GEOIP"} = 1;
2024 $geoip_path = File
::Spec
->rel2abs($geoip_path);
2026 print "checking for geoip directory at \"$geoip_path\"\n";
2028 if (!-f File
::Spec
->catfile($geoip_path, "GeoIP.h")) {
2029 die "can't find GeoIP.h include\n";
2031 if (!-f File
::Spec
->catfile($geoip_path, "GeoIP.lib")) {
2032 die "can't find Geoip.lib library\n";
2034 if (!-f File
::Spec
->catfile($geoip_path, "GeoIP.dll")) {
2035 die "can't find Geoip.dll DLL\n";
2037 $configinc{"GEOIP_INC"} = "$geoip_path";
2038 my $geoip_lib = File
::Spec
->catfile($geoip_path, "GeoIP.lib");
2039 $configlib{"GEOIP_LIB"} = "$geoip_lib";
2040 my $geoip_dll = File
::Spec
->catfile($geoip_path, "GeoIP.dll");
2041 $configdll{"GEOIP_DLL"} = "$geoip_dll";
2044 print "checking for GeoIP support\n";
2046 my $ret = `copy "$geoip_dll" .`;
2048 die "Can't copy GeoIP DLL to working directory: $ret\n";
2050 open F
, ">testgeoip.c" || die $!;
2052 extern void
*GeoIP_open
();
2055 return GeoIP_open
!= 0;
2059 $compret = `cl /nologo /MD testgeoip.c "$geoip_lib"`;
2060 if (grep { -f
and -x
} ".\\testgeoip.exe") {
2063 die "GeoIP test failed\n";
2066 die "can't compile GeoIP test: $compret\n";
2068 $configdefh{"HAVE_GEOIP"} = 1;
2071 print "checking for GeoIP Country IPv6 support\n";
2073 my $geoip_inc = qq(/I
"$geoip_path");
2074 my $geoip_libs = qq("$geoip_lib" ws2_32
.lib
);
2075 open F
, ">testgeoip1.c" || die $!;
2079 struct in6_addr in6
;
2085 return GeoIP_country_name_by_ipnum_v6
(NULL
, in6
) != NULL
;
2089 $compret = `cl /nologo $geoip_inc /MD testgeoip1.c $geoip_libs`;
2090 if (grep { -f
and -x
} ".\\testgeoip1.exe") {
2091 `.\\testgeoip1.exe`;
2093 die "GeoIP Country IPv6 test failed\n";
2096 die "can't compile GeoIP Country IPv6 test: $compret\n";
2098 $configdefh{"HAVE_GEOIP_V6"} = 1;
2101 print "checking for GeoIP City IPv6 support\n";
2103 open F
, ">testgeoip2.c" || die $!;
2106 #include <GeoIPCity.h>
2108 struct in6_addr in6
;
2109 int i
= GEOIP_CITY_EDITION_REV0_V6
;
2115 return GeoIP_record_by_ipnum_v6
(NULL
, in6
) != NULL
;
2119 $compret = `cl /nologo $geoip_inc /MD testgeoip2.c $geoip_libs`;
2120 if (grep { -f
and -x
} ".\\testgeoip2.exe") {
2121 `.\\testgeoip2.exe`;
2123 die "GeoIP City IPv6 test failed\n";
2126 die "can't compile GeoIP City IPv6 test: $compret\n";
2128 $configdefh{"HAVE_GEOIP_CITY_V6"} = 1;
2132 if ($use_readline eq "no") {
2134 print "readline library is disabled\n";
2137 $readline_path = File
::Spec
->rel2abs($readline_path);
2139 print "checking for readline directory at \"$readline_path\"\n";
2141 if (!-f File
::Spec
->catfile($readline_path, "readline", "readline.h")) {
2142 die "can't find readline.h include\n";
2144 if (!-f File
::Spec
->catfile($readline_path, "readline", "readline.lib")) {
2145 die "can't find readline.lib library\n";
2147 $configdefh{"HAVE_READLINE"} = 1;
2148 $configinc{"READLINE_INC"} = "$readline_path";
2149 my $readline_lib = File
::Spec
->catfile($readline_path,
2150 "readline", "readline.lib");
2151 $configlib{"READLINE_LIB"} = "$readline_lib";
2152 if (-f File
::Spec
->catfile($readline_path, "readline", "readlineD.lib")) {
2153 my $readline_libd = File
::Spec
->catfile($readline_path,
2154 "readline", "readlineD.lib");
2155 $configlib{"READLINE_LIBD"} = "$readline_libd";
2157 $configlib{"READLINE_LIBD"} = "$readline_lib";
2161 # with-idn (including with-iconv)
2162 if ($use_idn eq "no") {
2164 print "IDN kit is disabled\n";
2167 $idn_path = File
::Spec
->rel2abs($idn_path);
2169 print "checking for IDN kit directory at \"$idn_path\"\n";
2171 if (!-f File
::Spec
->catfile($idn_path, "idn", "api.h")) {
2172 die "can't find idn\\api.h include\n";
2174 if (!-f File
::Spec
->catfile($idn_path, "idn", "idnkit.lib")) {
2175 die "can't find idnkit.lib library\n";
2177 if (!-f File
::Spec
->catfile($idn_path, "idn", "idnkit.dll")) {
2178 die "can't find idnkit.dll DLL\n";
2180 $configcond{"IDNKIT"} = 1;
2181 $configdefh{"WITH_IDN"} = 1;
2182 $configinc{"IDN_INC"} = "$idn_path";
2183 my $idn_lib = File
::Spec
->catfile($idn_path, "idn", "idnkit.lib");
2184 $configlib{"IDN_LIB"} = "$idn_lib";
2185 my $idn_dll = File
::Spec
->catfile($idn_path, "idn", "idnkit.dll");
2186 $configdll{"IDN_DLL"} = "$idn_dll";
2187 if ($iconv_path eq " --idn-- ") {
2188 my $iconv_dll = File
::Spec
->catfile($idn_path, "idn", "iconv.dll");
2189 $configdll{"ICONV_DLL"} = "$iconv_dll";
2191 my $iconv_dll =File
::Spec
->catfile($iconv_path, "iconv.dll");
2192 $configdll{"ICONV_DLL"} = "$iconv_dll";
2197 if ($use_libxml2 eq "no") {
2199 print "libxml2 library is disabled\n";
2201 } elsif ($use_libxml2 eq "auto") {
2203 print "checking for a libxml2 built directory at sibling root\n";
2205 opendir DIR
, $libxml2_path || die "No Directory: $!\n";
2206 my @dirlist = grep (/^libxml2-[0-9]+\.[0-9]+\.[0-9]+[a-z]*/i,
2210 # Make sure we have something
2211 if (scalar(@dirlist) == 0) {
2212 die "can't find a libxml2 at sibling root\n";
2214 # Now see if we have a directory or just a file.
2215 # Make sure we are case insensitive
2217 foreach $file (sort {uc($b) cmp uc($a)} @dirlist) {
2218 if (-f File
::Spec
->catfile($libxml2_path,
2222 $libxml2_path = File
::Spec
->catdir($libxml2_path, $file);
2223 $use_libxml2 = "yes";
2228 # If we have one use it otherwise report the error
2229 if ($use_libxml2 eq "auto") {
2230 die "can't find a libxml2 built directory at sibling root\n";
2233 # falls into (so no else)
2234 if ($use_libxml2 eq "yes") {
2235 $libxml2_path = File
::Spec
->rel2abs($libxml2_path);
2237 print "checking for libxml2 built directory at \"$libxml2_path\"\n";
2239 if (!-f File
::Spec
->catfile($libxml2_path,
2242 die "can't find libxml2 xmlversion.h include\n";
2244 if (!-f File
::Spec
->catfile($libxml2_path,
2247 die "can't find Libxml2 libxml2.lib library\n";
2249 if (!-f File
::Spec
->catfile($libxml2_path,
2252 die "can't find Libxml2 DLL\n";
2254 $configcond{"LIBXML2"} = 1;
2255 $configdefh{"HAVE_LIBXML2"} = 1;
2256 my $libxml2_inc = File
::Spec
->catdir($libxml2_path, "include");
2257 $configinc{"LIBXML2_INC"} = "$libxml2_inc";
2258 my $libxml2_libdir = File
::Spec
->catdir($libxml2_path, "win32\\bin.msvc");
2259 my $libxml2_lib = File
::Spec
->catfile($libxml2_libdir, "libxml2.lib");
2260 $configlib{"LIBXML2_LIB"} = "$libxml2_lib";
2261 my $libxml2_dll = File
::Spec
->catfile($libxml2_libdir, "libxml2.dll");
2262 $configdll{"LIBXML2_DLL"} = "$libxml2_dll";
2266 if ($use_python eq "no") {
2268 print "python is disabled\n";
2270 } elsif ($use_python eq "auto") {
2272 print "checking for python in path\n";
2274 my $pythonret = `python -c "quit()" 2>&1`;
2276 die "can't launch the python interpreter: $pythonret\n";
2278 $use_python = "yes";
2280 if ($use_python ne "no") {
2282 my $pythonret = `"$python_command" -c "quit()" 2>&1`;
2285 "can't lanch the local python interpreter: $pythonret\n";
2288 $configcond{"PYTHON"} = 1;
2289 $configdefd{"USE_PYTHON"} = "USE_PYTHON";
2290 $configvar{"PYTHON"} = "$python_command";
2292 $configvar{"prefix"} = "C:\\Program Files\ISC BIND 9";
2296 $vcredist_path = File
::Spec
->rel2abs($vcredist_path);
2297 if (!grep { -f
and -x
} $vcredist_path) {
2298 die "$vcredist_path is not correct\n";
2300 $configvar{"VCREDIST_PATH"} = "$vcredist_path";
2304 if ($tuning eq "large") {
2305 $configdefh{"TUNE_LARGE"} = 1;
2308 # setup config.h with %configdefh
2314 open F
, $configfilein || die $!;
2318 foreach $line (@Lines) {
2320 if ($line =~ /^@([^@]+)\@$/) {
2321 if (defined($configdefh{$1})) {
2322 $line = "#define $1 $configdefh{$1}";
2324 $line = "/* #undef $1 */";
2329 open F
, $configfileout || die $!;
2331 print "Setting up config.h\n";
2333 foreach $line (@Lines) {
2334 print F
$line . "\n";
2339 # setup platform.h with %configdefp
2341 sub setupplatformh
{
2345 open F
, $platformfile . ".in" || die $!;
2349 foreach $line (@Lines) {
2351 if ($line =~ /^@([^@]+)\@$/) {
2352 if (defined($configdefp{$1})) {
2353 $line = "#define $1 $configdefp{$1}";
2355 $line = "/* #undef $1 */";
2360 open F
, ">" . $platformfile || die $!;
2362 print "Setting up platform.h\n";
2364 foreach $line (@Lines) {
2365 print F
$line . "\n";
2380 # setup a file with %configcond stack and %config{var,defd,inc,lib,dll}
2386 my $filename = $_[0];
2393 open F
, $filename . ".in" || die $!;
2397 foreach $line (@Linesin) {
2399 if ($line =~ /^\@IF (.*)$/) {
2400 if (defined($cond)) {
2401 unshift(@conds, $cond);
2402 unshift(@passes, $pass);
2405 if (defined($configcond{$cond})) {
2411 } elsif ($line =~ /^\@ELSE (.*)$/) {
2413 die "\@ELSE $1 mismatch in $filename\n";
2415 if (defined($configcond{$cond})) {
2418 if (scalar(@conds) > 0) {
2425 } elsif ($line =~ /^\@END (.*)$/) {
2427 die "\@END $1 mismatch in $filename\n";
2429 $cond = shift(@conds);
2430 if (scalar(@passes) > 0) {
2431 $pass = shift(@passes);
2440 while ($line =~ /@([^@ ]*)@/) {
2441 if ($1 ~~ @substvar) {
2442 if (defined($configvar{$1})) {
2443 $val = kw
($configvar{$1});
2448 } elsif ($1 ~~ @substdefd) {
2449 if (defined($configdefd{$1})) {
2450 my $def = $configdefd{$1};
2453 $def =~ s/([\\ "])/\\$1/g;
2454 $line = qq($pre/D
"$def"$post);
2458 } elsif ($1 ~~ @substinc) {
2459 if (defined($configinc{$1})) {
2460 $line = qq($`/I "$configinc{$1}"$');
2464 } elsif ($1 ~~ @substlib) {
2465 if (defined($configlib{$1})) {
2466 $val = kw($configlib{$1});
2471 } elsif ($1 ~~ @substdll) {
2472 if (defined($configdll{$1})) {
2473 $val = kw($configdll{$1});
2479 die "unknown control
$& in $filename\n";
2482 push @Linesout, $line;
2485 open F, ">" . $filename || die $!;
2487 print "Setting up
$filename\n";
2489 foreach $line (@Linesout) {
2490 print F $line . "\n";
2495 # setup a project with %configcond stack and %config{var,defd,inc,lib,dll}
2501 my $projectname = $_[0];
2508 open F, $projectname . ".in" || die $!;
2512 foreach $line (@Linesin) {
2514 if ($line =~ /^\@IF (.*)$/) {
2515 if (defined($cond)) {
2516 unshift(@conds, $cond);
2517 unshift(@passes, $pass);
2520 if (defined($configcond{$cond})) {
2526 } elsif ($line =~ /^\@ELSE (.*)$/) {
2528 die "\
@ELSE $1 mismatch
in $projectname\n";
2530 if (defined($configcond{$cond})) {
2533 if (scalar(@conds) > 0) {
2540 } elsif ($line =~ /^\@END (.*)$/) {
2542 die "\
@END $1 mismatch
in $projectname\n";
2544 $cond = shift(@conds);
2545 if (scalar(@passes) > 0) {
2546 $pass = shift(@passes);
2555 while ($line =~ /@([^@ ]*)@/) {
2556 if ($1 ~~ @substvar) {
2557 if (defined($configvar{$1})) {
2558 $val = kw($configvar{$1});
2563 } elsif ($1 ~~ @substdefd) {
2564 if (defined($configdefd{$1})) {
2565 $val = kw($configdefd{$1});
2566 $line = "$`$val;$'";
2570 } elsif ($1 ~~ @substinc) {
2571 if (defined($configinc{$1})) {
2572 $val = kw($configinc{$1});
2573 $line = "$`$val;$'";
2577 } elsif ($1 ~~ @substlib) {
2578 if (defined($configlib{$1})) {
2579 $val = kw($configlib{$1});
2580 $line = "$`$val;$'";
2584 } elsif ($1 ~~ @substdll) {
2585 if (defined($configdll{$1})) {
2586 $val = kw($configdll{$1});
2592 die "unknown control $& in $projectname\n";
2595 push @Linesout, $line;
2598 open F, ">" . $projectname || die $!;
2600 print "Setting up $projectname\n";
2602 foreach $line (@Linesout) {
2603 print F $line . "\n";
2611 # List of directories with version files
2613 my @dirlist = ("isc", "dns", "isccc", "isccfg", "lwres", "bind9", "irs");
2615 "bind9" => "LIBBIND9_EXPORTS",
2616 "dns" => "LIBDNS_EXPORTS",
2617 "irs" => "LIBIRS_EXPORTS",
2618 "isc" => "LIBISC_EXPORTS",
2619 "isccc" => "LIBISCCC_EXPORTS",
2620 "isccfg" => "LIBISCCFG_EXPORTS",
2621 "lwres" => "LIBLWRES_EXPORTS");
2622 my @VersionNames = ("LIBINTERFACE", "LIBREVISION", "LIBAGE");
2627 my $versionfile = "versions.h";
2628 my $versionpath = "..\\$versionfile";
2634 # First get the version information
2636 open V, "..\\version" || die $!;
2639 ($data) = split(/\#/);
2641 ($name, $value) = split(/=/, $data);
2642 ($name) = split(/\s+/, $name);
2643 if ($name eq 'PRODUCT' || $name eq 'DESCRIPTION') {
2644 ($value) =~ s/^["\s]+//;
2645 ($value) =~ s/["\s]+$//;
2647 ($value) = split(/\s+/, $value);
2649 $Versions{$name} = $value;
2654 # And the mapapi one
2656 open M, "..\\lib\\dns\\mapapi" || die $!;
2659 ($data) = split(/\#/);
2661 ($name, $value) = split(/=/, $data);
2662 ($name) = split(/\s+/, $name);
2663 if ($name eq 'MAPAPI') {
2664 ($value) =~ s/^["\s]+//;
2665 ($value) =~ s/["\s]+$//;
2667 ($value) = split(/\s+/, $value);
2674 # Now set up the output version file
2676 my $ThisDate = scalar localtime();
2677 open O, ">$versionpath" ||
2678 die "Can't open output file $versionpath: $!\n";
2683 * Copyright (C) 2001 Internet Software Consortium.
2685 * Permission to use, copy, modify, and distribute this software for any
2686 * purpose with or without fee is hereby granted, provided that the above
2687 * copyright notice and this permission notice appear in all copies.
2689 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
2690 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
2691 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
2692 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
2693 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
2694 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
2695 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
2696 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2702 print O " * $versionfile.";
2703 print O " Generated automatically by Configure.pl.\n";
2704 print O " * Date generated: $ThisDate\n";
2709 #define VERSIONS_H 1
2713 $Version = "$Versions{'MAJORVER'}.$Versions{'MINORVER'}";
2714 if ($Versions{'PATCHVER'} != "") {
2715 $Version = "$Version.$Versions{'PATCHVER'}";
2717 $Version = "$Version$Versions{'RELEASETYPE'}$Versions{'RELEASEVER'}";
2718 $Version = "$Version$Versions{'EXTENSIONS'}";
2720 print "BIND Version: $Version\n";
2723 print O "#define VERSION \"$Version\"\n";
2724 print O "#define PRODUCT \"$Versions{'PRODUCT'}\"\n\n";
2725 print O "#define DESCRIPTION \"$Versions{'DESCRIPTION'}\"\n\n";
2727 "#define MAJOR \"$Versions{'MAJORVER'}.$Versions{'MINORVER'}\"\n\n";
2728 print O "#define MAPAPI \"$Mapapi\"\n\n";
2732 foreach $dir (@dirlist) {
2733 $apifile = "..\\lib\\$dir\\api";
2734 open A, $apifile || die $!;
2737 ($data) = split(/\#/);
2739 ($name, $value) = split(/=/, $data);
2742 $ApiVersions{$name} = $value;
2747 print O "\n#ifdef $LibMacros{$dir}\n";
2748 foreach $name (@VersionNames) {
2749 print O "#define $name\t$ApiVersions{$name}\n";
2751 print O "#endif\n\n";
2754 print O "#endif /* VERSIONS_H */\n";
2764 my $srcid = "unset";
2766 open SOUT, ">..\\srcid.h" || die "cannot open srcid.h: $!\n";
2767 if (open (SIN, "..\\srcid")) {
2768 LOOP: while (<SIN>) {
2770 ($data) = split(/\#/);
2772 ($name, $value) = split(/=/, $data);
2773 ($name) = split(/\s+/, $name);
2774 ($value) = split(/\s+/, $value);
2775 next LOOP if ($name != "SRCID");
2782 # Now set up the output version file
2784 my $ThisDate = scalar localtime();
2789 * Copyright (C) 2012 Internet Software Consortium.
2791 * Permission to use, copy, modify, and distribute this software for any
2792 * purpose with or without fee is hereby granted, provided that the above
2793 * copyright notice and this permission notice appear in all copies.
2795 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
2796 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
2797 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
2798 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
2799 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
2800 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
2801 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
2802 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2808 print SOUT " * srcid.h";
2809 print SOUT " * Generated automatically by Configure.pl.\n";
2810 print SOUT " * Date generated: $ThisDate\n";
2811 print SOUT " */\n\n";
2819 print "BIND SRCID: $srcid\n";
2822 print SOUT "#define SRCID\t\"$srcid\"\n";
2823 print SOUT "#endif /* SRCID_H */\n";
2832 print "Configuration Status\n";
2834 print "\tconfig.h:\n";
2835 foreach $name (@substdefh) {
2836 if (defined($configdefh{$name})) {
2837 print qq(\t\t$name defined to "$configdefh{$name}"\n);
2839 printf qq(\t\t$name undefined\n);
2843 print "\tplatform.h:\n";
2844 foreach $name (@substdefp) {
2845 if (defined($configdefp{$name})) {
2846 print qq(\t\t$name defined to "$configdefp{$name}"\n);
2848 printf qq(\t\t$name undefined\n);
2852 print "\tconditions:\n";
2853 foreach $name (@substcond) {
2854 if (defined($configcond{$name})) {
2855 print "\t\t$name is true\n";
2857 print "\t\t$name is false\n";
2861 print "\tsubstitutions:\n";
2862 foreach $name (@substvar) {
2863 if (defined($configvar{$name})) {
2864 print qq(\t\t$name -> "$configvar{$name}"\n);
2868 print "\tdefines:\n";
2869 foreach $name (@substdefd) {
2870 if (defined($configdefd{$name})) {
2871 print qq(\t\t/D "$configdefd{$name}"\n);
2875 print "\tincludes:\n";
2876 foreach $name (@substinc) {
2877 if (defined($configinc{$name})) {
2878 print qq(\t\t/I "$configinc{$name}"\n);
2882 print "\tlibraries:\n";
2883 foreach $name (@substlib) {
2884 if (defined($configlib{$name})) {
2885 print "\t\t$configlib{$name}\n";
2890 foreach $name (@substdll) {
2891 if (defined($configdll{$name})) {
2892 print "\t\t$configdll{$name}\n";
2900 if (($want_win32 eq "yes") || ($want_x64 eq "yes")) {
2906 foreach $file (@filelist) {
2910 if (!$legacy_only) {
2911 foreach $file (@projectlist) {
2912 setupproject($file);
2920 print "Configured.\n";
2922 print "add win32 or x64 to commit configuration to build files\n";
2927 # Notes: Unix configure.in options
2928 # --enable-developer partially supported
2929 # --enable-newstats (9.9/9.9sub only)
2930 # --enable-native-pkcs11 supported
2931 # --enable-openssl-version-check included without a way to disable it
2932 # --enable-openssl-hash supported
2933 # --enable-threads included without a way to disable it
2934 # --enable-backtrace backtrace included without a way to disable it
2935 # --enable-symtable incompatible with DLLs (or libtool)
2936 # --enable-exportlib TODO (obsolete)
2937 # --enable-ipv6 included without a way to disable it
2938 # --enable-atomic supported (renamed to intrinsic)
2939 # --enable-spnego support (part of GSSAPI)
2940 # --enable-fixed-rrset supported
2941 # --disable-rpz-nsip supported
2942 # --disable-rpz-nsdname supported
2943 # --enable-filter-aaaa supported
2944 # --enable-sit supported
2945 # --enable-full-report supported by verbose
2946 # --with-python supported
2947 # --with-openssl supported
2948 # --with-pkcs11 supported
2949 # --with-ecdsa supported
2950 # --with-gost supported
2951 # --with-aes supported
2952 # --with-sit-alg supported
2953 # --with-geoip supported
2954 # --with-gssapi supported with MIT (K)erberos (f)or (W)indows
2955 # --with-libxml2 supported
2956 # --with-libjson not supported on WIN32 (package not available on WIN32)
2957 # --with-purify ? (package available on WIN32 but for free?)
2958 # --with-gperftools-profiler (package not available on WIN32)
2959 # --with-libtool not supported on WIN32 (never)
2960 # --with-locktype not supported on WIN32 (not yet available on WIN32)
2961 # --with-readline supported
2962 # --with-idn support
2963 # --with-[lib]iconv (part of IDN)
2964 # --with-atf not supported on WIN32 (package not available on WIN32)
2965 # --with-tuning supported
2966 # --with-dlopen included without a way to disable it
2969 # Notes: MSVC versions
2970 # MSVC 14.0 _MSC_VER == 1900 (VS 14 (2014))
2971 # MSVC 12.0 _MSC_VER == 1800 (VS 2013)
2972 # MSVC 11.0 _MSC_VER == 1700 (VS 2012)
2973 # MSVC 10.0 _MSC_VER == 1600 (VS 2010)
2974 # MSVC 9.0 _MSC_VER == 1500 (VS 2008)
2975 # MSVC 8.0 _MSC_VER == 1400 (VS 2005)
2976 # MSVC 7.1 _MSC_VER == 1310 (VS .NET 2003)
2977 # MSVC 7.0 _MSC_VER == 1300 (VS .NET (2002))
2978 # MSVC 6.0 _MSC_VER == 1200 (VS 6.0 (1998))
2979 # MSVC 5.0 _MSC_VER == 1100 (VS 97)