Configure revision b1acd6c4248caca345a68ed6674ae7c265d9f4fe
2N/A# Copyright (C) 2013, 2014 Internet Systems Consortium, Inc. ("ISC") 2N/A# Permission to use, copy, modify, and/or distribute this software for any 2N/A# purpose with or without fee is hereby granted, provided that the above 2N/A# copyright notice and this permission notice appear in all copies. 2N/A# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 2N/A# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 2N/A# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 2N/A# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 2N/A# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 2N/A# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 2N/A# PERFORMANCE OF THIS SOFTWARE. 2N/A# This script builds nmake and visual studio build files 2N/A "DNS_RDATASET_FIXED", 2N/A "ENABLE_RPZ_NSDNAME", 2N/A "HAVE_GEOIP_CITY_V6", 2N/A "HAVE_OPENSSL_ECDSA", 2N/A "HAVE_OPENSSL_GOST", 2N/A "HAVE_PKCS11_ECDSA", 2N/A "ISC_LIST_CHECKINIT", 2N/A "ISC_PLATFORM_HAVECMPXCHG", 2N/A "ISC_PLATFORM_HAVEXADD", 2N/A "ISC_PLATFORM_HAVEXADDQ", 2N/A "ISC_PLATFORM_NEEDSTRCASESTR", 2N/A "ISC_PLATFORM_OPENSSLHASH", 2N/A "ISC_PLATFORM_USEBACKTRACE");
2N/A "PK11_LIB_LOCATION", 2N/Amy @
optionlist =
("help", "verbose", "legacy", "win32", "x64", "clean");
2N/Amy @
usage =
("Usage: perl Configure help\n", 2N/A " perl Configure options* win32|x64\n", 2N/A " perl Configure clean\n");
2N/A"'Configure' configures BIND9 build files.\n\n", 2N/A"\nGeneral Options and Commands:\n", 2N/A" verbose (options) print messages\n", 2N/A" help (command) print this help\n", 2N/A" legacy (options) process only files for legacy build\n", 2N/A" win32 (command) configure for Win32 platform\n", 2N/A" x64 (command) configure for x64 platform\n", 2N/A" clean (command) clean up generated files\n", 2N/A" <none> (command) print a summary of the configuration\n", 2N/A"\nOptional Features:\n", 2N/A" enable-native-pkcs11 use native PKCS#11 for all crypto [default=no]\n", 2N/A" enable-openssl-hash use OpenSSL for hash functions [default=no]\n", 2N/A" enable-isc-spnego use SPNEGO from lib/dns [default=yes]\n", 2N/A" enable-filter-aaaa enable filtering of AAAA records [default=no]\n", 2N/A" enable-fixed-rrset enable fixed rrset ordering [default=no]\n", 2N/A" enable-developer enable developer build settings [default=no]\n", 2N/A" enable-rpz-nsip enable rpz-nsip rules [default=yes]\n", 2N/A" enable-rpz-nsdname enable rpz-nsdname rules [default=yes]\n", 2N/A"\nOptional Packages:\n", 2N/A" with-tests build with test suite\n", 2N/A" with-extra-tests build with extra test suite\n", 2N/A" with-openssl[=PATH] build with OpenSSL yes|no|path\n", 2N/A" with-pkcs11[=PATH] build with PKCS#11 support yes|no|provider-path\n", 2N/A" with-ecdsa crypto ECDSA\n", 2N/A" with-gost[=ENC] crypto GOST yes|no|raw|ans1\n", 2N/A" with-gssapi[=PATH] build with MIT KfW GSSAPI yes|no|path\n", 2N/A" with-libxml2[=PATH] build with libxml2 library yes|no|path\n", 2N/A" with-geoip[=PATH] build with GeoIP support yes|no|path\n", 2N/A" with-python[=COMMAND] specify python interpreter python|command\n", 2N/A" with-readline[=PATH] build with readline library support yes|no|path\n", 2N/A" with-idn[=PATH] build with IDN kit support yes|no|path\n", 2N/A" with-iconv[=PATH] path of the iconv DLL [default=same than idn]\n", 2N/A" with-vcredist[=PATH] visual C++ redistributable package yes|path\n", 2N/A" with-tuning=OPTION tune for plaform size (large|default)\n", 2N/A" with-cross-compile 32 / 64 bit build / host plaforms\n");
2N/A# no arguments -> usage 2N/A# legacy default to win32 2N/A# configure the platform 2N/A die "can't ask for both Win32 and x64 platforms\n"; 2N/A# append seen args to CONFIGARGS define 2N/A # escape backslashes, spaces and double quotes 2N/A } elsif ($key =~ /^native-pkcs11$/i) { 2N/A } elsif ($key =~ /^openssl-hash$/i) { 2N/A } elsif ($key =~ /^isc-spnego$/i) { 2N/A } elsif ($key =~ /^filter-aaaa$/i) { 2N/A } elsif ($key =~ /^fixed-rrset$/i) { 2N/A } elsif ($key =~ /^rpz-nsdname$/i) { # enable-developer expansion now if ($key =~ /^tests$/i) { } elsif ($key =~ /^extra-tests$/i) { } elsif ($key =~ /^openssl$/i) { } elsif ($val !~ /^yes$/i) { } elsif ($key =~ /^pkcs11$/i) { } elsif ($val !~ /^no$/i) { } elsif ($key =~ /^ecdsa$/i) { } elsif ($val =~ /^yes$/i) { } elsif ($key =~ /^gost$/i) { } elsif ($val =~ /^yes$/i) { } elsif ($key =~ /^gssapi$/i) { } elsif ($key =~ /^libxml2$/i) { } elsif ($val !~ /^yes$/i) { } elsif ($key =~ /^geoip$/i) { } elsif ($key =~ /^readline$/i) { } elsif ($key =~ /^idn$/i) { } elsif ($key =~ /^iconv$/i) { } elsif ($val !~ /^yes$/i) { } elsif ($key =~ /^python$/i) { } elsif ($key =~ /^vcredist$/i) { $unknown_value = "without-vcredist (vcredist is required)"; } elsif ($val !~ /^yes$/i) { } elsif ($key =~ /^cross-compile$/i) { } elsif ($key =~ /^tuning$/i) { if ($val =~ /^large$/i) { $unknown_value = "without-" . $key; $unknown_value = "with-" . $key; if ($want_help ne "no") { # clean up and exit if requested if ($want_clean eq "yes") { foreach $file (@filelist) { foreach $file (@projectlist) { if ($want_unknown ne "no") { # infer vcredist when not given push(@vcpaths, File::Spec->catfile( cwd(), "..", ".." )); printf("%d\n", _MSC_VER); die "can't get _MSC_VER value: $compret\n"; print "_MSV_VER == $msc_ver\n"; # gen single threaded for < VS 2005 $configvar{"COPTML"} = "/ML"; $configvar{"COPTMLD"} = "/MLD"; # /GX deprecated in VS 2005 $configvar{"COPTX"} = "/GX"; $configvar{"COPTX"} = "/EHsc"; $configvar{"COPTY"} = "/YX"; # backtrace for >= VS 2012 $configdefp{"ISC_PLATFORM_USEBACKTRACE"} = 1; # no version of MSVS supports strcasestr() yet $configdefp{"ISC_PLATFORM_NEEDSTRCASESTR"} = 1; # warn when cross compiling if ($cross_compile eq "yes") { if ($want_x64 eq "yes") { $configvar{"BUILD_PLATFORM"} = "Win32"; $configvar{"BUILD_MACHINE"} = "/machine:X86"; if ($want_win32 eq "yes") { $configvar{"BUILD_PLATFORM"} = "x64"; $configvar{"BUILD_MACHINE"} = "/machine:X64"; } elsif ($want_win32 eq "yes") { fprintf(stderr, "compiling for x64 when win32 was asked?!\n"); my $compret = `cl /nologo /MD cross.c`; print STDERR "can't check cross compile: $compret\n"; if ($enable_intrinsics eq "yes") { $configcond{"ATOMIC"} = 1; $configvar{"INTRINSIC"} = "true"; $configvar{"COPTI"} = "/Oi"; $configdefp{"ISC_PLATFORM_HAVEXADD"} = 1; if ($want_x64 eq "yes") { $configdefp{"ISC_PLATFORM_HAVEXADDQ"} = 1; $configdefp{"ISC_PLATFORM_HAVEATOMICSTORE"} = 1; $configdefp{"ISC_PLATFORM_HAVECMPXCHG"} = 1; $configvar{"INTRINSIC"} = "false"; if ($enable_native_pkcs11 eq "yes") { if ($use_openssl eq "auto") { if ($use_openssl ne "no") { print "native PKCS#11 support: force with-pkcs11\n"; print "native PKCS#11 support: no PKCS#11 provider defined?\n"; print "no ECDSA support in native PKCS#11\n"; print "enabled ECDSA support in native PKCS#11\n"; print "no GOST support in native PKCS#11\n"; print "enabled GOST support in native PKCS#11\n"; print "OpenSSL library is disabled\n"; print "checking for an OpenSSL built directory at sibling root\n"; # Make sure we have something die "can't find an OpenSSL at sibling root\n"; # Now see if we have a directory or just a file. # Make sure we are case insensitive # If we have one use it otherwise report the error die "can't find an OpenSSL built directory at sibling root\n"; # falls into (so no else) print "checking for OpenSSL built directory at \"$openssl_path\"\n"; print "OpenSSL DSA support is disabled\n"; print "checking whether linking with OpenSSL works\n"; die "Can't copy OpenSSL DLL to working directory: $ret\n"; die "OpenSSL test failed\n"; printf "checking OpenSSL library version\n"; printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n", printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n" "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n"); die "OpenSSL version test failed\n"; # check EVP_sha256 / EVP_sha384 / EVP_sha512 printf "checking for EVP_sha256\n"; print "EVP_sha256 test failed: disabling EVP_sha256\n"; print "can't compile EVP_sha256 test: $compret\n"; print "disabling EVP_sha256\n"; printf "checking for EVP_sha384\n"; print "EVP_sha384 test failed: disabling EVP_sha384\n"; print "can't compile EVP_sha384 test: $compret\n"; print "disabling EVP_sha384\n"; printf "checking for EVP_sha512\n"; print "EVP_sha512 test failed: disabling EVP_sha512\n"; print "can't compile EVP_sha512 test: $compret\n"; print "disabling EVP_sha512\n"; print "checking for OpenSSL ECDSA support\n"; print "ECDSA test failed: disabling ECDSA\n"; print "can't compile ECDSA test: $compret\n"; print "disabling ECDSA\n"; print "checking for OpenSSL GOST support\n"; #if (OPENSSL_VERSION_NUMBER >= 0x10000000L) print "GOST test failed: disabling GOST\n"; print "can't compile GOST test: $compret\n"; print "disabling GOST\n"; die "No OpenSSL for hash functions\n"; print "gssapi library is disabled\n"; print "checking for gssapi directory at \"$gssapi_path\"\n"; die "can't find gssapi${bits}.lib library\n"; die "can't find krb5_${bits}.lib library\n"; die "can't find gssapi${bits}.lib library\n"; die "can't find krb5_${bits}.lib library\n"; die "can't happen: no choice between Win32 and x64\n"; die "can't find gssapi${bits}.dll DLL\n"; die "can't find krb5_${bits}.dll DLL\n"; die "can't find comerr${bits}.dll DLL\n"; die "can't find k5sprt${bits}.dll DLL\n"; die "can't find wshelp${bits}.dll DLL\n"; die "No GSSAPI for SPNEGO\n"; print "geoip library is disabled\n"; print "checking for geoip directory at \"$geoip_path\"\n"; print "checking for GeoIP support\n"; die "Can't copy GeoIP DLL to working directory: $ret\n"; die "GeoIP test failed\n"; print "checking for GeoIP Country IPv6 support\n"; die "GeoIP Country IPv6 test failed\n"; die "can't compile GeoIP Country IPv6 test: $compret\n"; print "checking for GeoIP City IPv6 support\n"; die "GeoIP City IPv6 test failed\n"; print "readline library is disabled\n"; # with-idn (including with-iconv) print "IDN kit is disabled\n"; print "checking for IDN kit directory at \"$idn_path\"\n"; print "libxml2 library is disabled\n"; print "checking for a libxml2 built directory at sibling root\n"; # Make sure we have something die "can't find a libxml2 at sibling root\n"; # Now see if we have a directory or just a file. # Make sure we are case insensitive # If we have one use it otherwise report the error die "can't find a libxml2 built directory at sibling root\n"; # falls into (so no else) print "checking for libxml2 built directory at \"$libxml2_path\"\n"; die "can't find Libxml2 DLL\n"; print "python is disabled\n"; print "checking for python in path\n"; "can't lanch the local python interpreter: $pythonret\n"; $configvar{"prefix"} = "C:\\Windows\\system32\\dns"; if ($line =~ /^@([^@]+)\@$/) { $line = "/* #undef $1 */"; if ($line =~ /^@([^@]+)\@$/) { $line = "/* #undef $1 */"; # setup a file with %configcond stack and %config{var,defd,inc,lib,dll} while ($line =~ /@([^@ ]*)@/) { } elsif ($1 ~~ @substdefd) { $def =~ s/([\\ "])/\\$1/g; } elsif ($1 ~~ @substinc) { if (defined($configinc{$1})) { $line = qq($`/I "$configinc{$1}"$'); } elsif ($1 ~~ @substlib) { if (defined($configlib{$1})) { $val = kw($configlib{$1}); foreach $line (@Linesout) { # setup a project with %configcond stack and %config{var,defd,inc,lib,dll} foreach $line (@Linesin) { if ($line =~ /^\@IF (.*)$/) { } elsif ($line =~ /^\@ELSE (.*)$/) { if (scalar(@conds) > 0) { } elsif ($line =~ /^\@END (.*)$/) { if (scalar(@passes) > 0) { while ($line =~ /@([^@ ]*)@/) { } elsif ($1 ~~ @substdefd) { if (defined($configdefd{$1})) { $val = kw($configdefd{$1}); } elsif ($1 ~~ @substlib) { } elsif ($1 ~~ @substdll) { if (defined($configdll{$1})) { $val = kw($configdll{$1}); # List of directories with version files my @dirlist = ("isc", "dns", "isccc", "isccfg", "lwres", "bind9"); "bind9" => "LIBBIND9_EXPORTS", "dns" => "LIBDNS_EXPORTS", "isc" => "LIBISC_EXPORTS", "isccc" => "LIBISCCC_EXPORTS", "isccfg" => "LIBISCCFG_EXPORTS", "lwres" => "LIBLWRES_EXPORTS"); my @VersionNames = ("LIBINTERFACE", "LIBREVISION", "LIBAGE"); # First get the version information open M, "..\\lib\\dns\\mapapi" || die $!; # Now set up the output version file * Copyright (C) 2001 Internet Software Consortium. * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. print O "#define VERSION \"$Version\"\n"; print O "#define PRODUCT \"$Versions{'PRODUCT'}\"\n\n"; print O "#define DESCRIPTION \"$Versions{'DESCRIPTION'}\"\n\n"; print O "#define MAPAPI \"$Mapapi\"\n\n"; print O "#endif /* VERSIONS_H */\n"; # Now set up the output version file * Copyright (C) 2012 Internet Software Consortium. * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. print SOUT "#endif /* SRCID_H */\n"; print "Configuration Status\n"; print "\t\t$name is true\n"; print "\t\t$name is false\n"; print "\tsubstitutions:\n"; print "add win32 or x64 to commit configuration to build files\n"; # --enable-developer partially supported # --enable-newstats (9.9/9.9sub only) # --enable-native-pkcs11 supported # --enable-openssl-version-check included without a way to disable it # --enable-openssl-hash supported # --enable-openssl-aes TODO # --enable-threads included without a way to disable it # --enable-backtrace backtrace included without a way to disable it # --enable-symtable incompatible with DLLs (or libtool) # --enable-exportlib TODO (obsolete) # --enable-ipv6 included without a way to disable it # --enable-atomic supported (renamed to intrinsic) # --enable-spnego support (part of GSSAPI) # --enable-fixed-rrset supported # --disable-rpz-nsip supported # --disable-rpz-nsdname supported # --enable-filter-aaaa supported # --enable-sit included without a way to disable it (TO BE FIXED) # --enable-full-report supported by verbose # --with-python supported # --with-openssl supported # --with-pkcs11 supported # --with-sit-alg TODO (aes wired down) # --with-gssapi supported with MIT (K)erberos (f)or (W)indows # --with-libxml2 supported # --with-libjson not supported on WIN32 (package not available on WIN32) # --with-purify ? (package available on WIN32 but for free?) # --with-libtool not supported on WIN32 (never) # --with-readline supported # --with-[lib]iconv (part of IDN) # --with-atf not supported on WIN32 (package not available on WIN32) # --with-dlopen included without a way to disable it # MSVC 12.0 _MSC_VER == 1800 (VS 2013) # MSVC 11.0 _MSC_VER == 1700 (VS 2012) # MSVC 10.0 _MSC_VER == 1600 (VS 2010) # MSVC 9.0 _MSC_VER == 1500 (VS 2008) # MSVC 8.0 _MSC_VER == 1400 (VS 2005) # MSVC 7.1 _MSC_VER == 1310 (VS .NET 2003) # MSVC 7.0 _MSC_VER == 1300 (VS .NET (2002)) # MSVC 6.0 _MSC_VER == 1200 (VS 6.0 (1998)) # MSVC 5.0 _MSC_VER == 1100 (VS 97)