Configure revision 12bf5d4796505b4c20680531da96a31e6c2c1144
#
# Copyright (C) 2013, 2014 Internet Systems Consortium, Inc. ("ISC")
#
# 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 ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC 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.
# $Id$
# Configure
#
# This script builds nmake and visual studio build files
#
require 5.000;
use strict;
# files to configure
my $configfilein = "..\\config.h.win32";
my $configfileout = ">..\\config.h";
my $platformfile = "..\\lib\\isc\\win32\\include\\isc\\platform.h";
# for config.h
my %configdefh;
"CONFIGARGS",
"DNS_RDATASET_FIXED",
"ENABLE_RPZ_NSDNAME",
"ENABLE_RPZ_NSIP",
"HAVE_EVP_SHA256",
"HAVE_EVP_SHA384",
"HAVE_EVP_SHA512",
"HAVE_GEOIP",
"HAVE_GEOIP_V6",
"HAVE_GEOIP_CITY_V6",
"HAVE_LIBXML2",
"HAVE_OPENSSL_DSA",
"HAVE_OPENSSL_ECDSA",
"HAVE_OPENSSL_GOST",
"HAVE_PKCS11_ECDSA",
"HAVE_PKCS11_GOST",
"HAVE_READLINE",
"ISC_LIST_CHECKINIT",
"PREFER_GOSTASN1",
"WITH_IDN");
# for platform.h
my %configdefp;
"ISC_PLATFORM_HAVECMPXCHG",
"ISC_PLATFORM_HAVEXADD",
"ISC_PLATFORM_HAVEXADDQ",
"ISC_PLATFORM_NEEDSTRCASESTR",
"ISC_PLATFORM_OPENSSLHASH",
"ISC_PLATFORM_USEBACKTRACE");
# includes
my %configinc;
"GEOIP_INC",
"IDN_INC",
"LIBXML2_INC",
"OPENSSL_INC",
"READLINE_INC");
# libraries
my %configlib;
"GEOIP_LIB",
"IDN_LIB",
"KRB5_LIB",
"LIBXML2_LIB",
"OPENSSL_LIB",
"READLINE_LIB",
"READLINE_LIBD");
# DLLs
my %configdll;
"GSSAPI_DLL",
"GEOIP_DLL",
"ICONV_DLL",
"IDN_DLL",
"KRB5_DLL",
"K5SPRT_DLL",
"LIBXML2_DLL",
"OPENSSL_DLL",
"WSHELP_DLL");
# variables
my %configvar;
"BUILD_PLATFORM",
"COPTI",
"COPTML",
"COPTMLD",
"COPTX",
"COPTY",
"INTRINSIC",
"MACHINE",
"OPENSSL_PATH",
"PLATFORM",
"PKCS11_TOOLS",
"prefix",
"PYTHON",
"VCREDIST_PATH"),
# defines
my %configdefd;
"PK11_LIB_LOCATION",
"USE_GSSAPI",
"USE_PKCS11",
"USE_PYTHON",
"USE_ISC_SPNEGO");
# conditions
my %configcond;
"GSSAPI",
"GEOIP",
"IDNKIT",
"LIBXML2",
"OPENSSL",
"PKCS11",
"PYTHON",
"TESTS",
"XTESTS");
# arguments
"fixed-rrset",
"intrinsics",
"isc-spnego",
"native-pkcs11",
"openssl-hash",
"filter-aaaa",
"rpz-nsdname",
"rpz-nsip");
"ecdsa",
"extra-tests",
"gssapi",
"geoip",
"gost",
"iconv",
"idn",
"openssl",
"libxml2",
"pkcs11",
"python",
"readline",
"tests",
"vcredist");
# general arguments
# usage
" perl Configure options* win32|x64\n",
" perl Configure clean\n");
# help
my @help = (
"'Configure' configures BIND9 build files.\n\n",
@usage,
"\nGeneral Options and Commands:\n",
" verbose (options) print messages\n",
" help (command) print this help\n",
" legacy (options) process only files for legacy build\n",
" win32 (command) configure for Win32 platform\n",
" x64 (command) configure for x64 platform\n",
" clean (command) clean up generated files\n",
" <none> (command) print a summary of the configuration\n",
"\nOptional Features:\n",
" enable-intrinsics enable instrinsic/atomic functions [default=yes]\n",
" enable-native-pkcs11 use native PKCS#11 for all crypto [default=no]\n",
" enable-openssl-hash use OpenSSL for hash functions [default=no]\n",
" enable-filter-aaaa enable filtering of AAAA records [default=no]\n",
" enable-fixed-rrset enable fixed rrset ordering [default=no]\n",
" enable-developer enable developer build settings [default=no]\n",
" enable-rpz-nsip enable rpz-nsip rules [default=yes]\n",
" enable-rpz-nsdname enable rpz-nsdname rules [default=yes]\n",
"\nOptional Packages:\n",
" with-tests build with test suite\n",
" with-extra-tests build with extra test suite\n",
" with-openssl[=PATH] build with OpenSSL yes|no|path\n",
" with-pkcs11[=PATH] build with PKCS#11 support yes|no|provider-path\n",
" with-ecdsa crypto ECDSA\n",
" with-gost[=ENC] crypto GOST yes|no|raw|ans1\n",
" with-gssapi[=PATH] build with MIT KfW GSSAPI yes|no|path\n",
" with-libxml2[=PATH] build with libxml2 library yes|no|path\n",
" with-geoip[=PATH] build with GeoIP support yes|no|path\n",
" with-python[=COMMAND] specify python interpreter python|command\n",
" with-readline[=PATH] build with readline library support yes|no|path\n",
" with-idn[=PATH] build with IDN kit support yes|no|path\n",
" with-iconv[=PATH] path of the iconv DLL [default=same than idn]\n",
" with-vcredist[=PATH] visual C++ redistributable package yes|path\n",
" with-cross-compile 32 / 64 bit build / host plaforms\n");
# Parse arguments
my $verbose = 0;
my $legacy_only = 0;
my $want_help = "no";
my $want_win32 = "no";
my $want_x64 = "no";
my $want_clean = "no";
my $want_unknown = "no";
my $unknown_value;
my $enable_intrinsics = "yes";
my $enable_native_pkcs11 = "no";
my $enable_openssl_hash = "no";
my $enable_filter_aaaa = "no";
my $enable_isc_spnego = "yes";
my $enable_fixed_rrset = "no";
my $enable_developer = "no";
my $enable_rpz_nsip = "yes";
my $enable_rpz_nsdname = "yes";
my $use_tests = "no";
my $use_xtests = "no";
my $use_openssl = "auto";
my $openssl_path = "..\\..\\";
my $use_pkcs11 = "no";
my $pkcs11_path = "unknown";
my $use_ecdsa = "auto";
my $use_gost = "auto";
my $gost_encoding = "raw";
my $use_gssapi = "no";
my $gssapi_path = "C:\\Program\ Files\\MIT\\Kerberos\\";
my $use_geoip = "no";
my $geoip_path = "";
my $use_libxml2 = "auto";
my $libxml2_path = "..\\..\\";
my $use_python = "auto";
my $python_command = "python";
my $use_readline = "no";
my $readline_path = "..\\..\\";
my $use_idn = "no";
my $idn_path = "..\\..\\";
my $iconv_path = " --idn-- ";
my $use_vcredist = "yes";
my $vcredist_path = " --infer-- ";
my $cross_compile = "no";
# no arguments -> usage
if ($#ARGV < 0) {
print $_;
}
exit 1;
}
# parse arguments
foreach (@ARGV) {
$verbose = 1;
$legacy_only = 1;
} else {
$unknown_value = $_;
}
}
# legacy default to win32
}
# configure the platform
}
# append seen args to CONFIGARGS define
sub appargs {
my $arg = $_[0];
# escape backslashes, spaces and double quotes
} else {
}
}
} else {
}
sub myenable {
my $key = $_[0];
my $val = $_[1];
if ($key =~ /^intrinsics$/i) {
if ($val =~ /^no$/i) {
}
} elsif ($key =~ /^native-pkcs11$/i) {
if ($val =~ /^yes$/i) {
}
} elsif ($key =~ /^openssl-hash$/i) {
if ($val =~ /^yes$/i) {
}
} elsif ($key =~ /^isc-spnego$/i) {
if ($val =~ /^no$/i) {
}
} elsif ($key =~ /^filter-aaaa$/i) {
if ($val =~ /^yes$/i) {
}
} elsif ($key =~ /^fixed-rrset$/i) {
if ($val =~ /^yes$/i) {
}
} elsif ($key =~ /^developer$/i) {
if ($val =~ /^yes$/i) {
}
} elsif ($key =~ /^rpz-nsip$/i) {
if ($val =~ /^no$/i) {
}
} elsif ($key =~ /^rpz-nsdname$/i) {
if ($val =~ /^no$/i) {
}
} else {
} else {
}
}
}
# enable-developer expansion now
# no atf on WIN32
# TODO: dlz filesystem
}
sub mywith {
my $key = $_[0];
my $val = $_[1];
if ($key =~ /^tests$/i) {
if ($val =~ /^yes$/i) {
}
} elsif ($key =~ /^extra-tests$/i) {
if ($val =~ /^yes$/i) {
}
} elsif ($key =~ /^openssl$/i) {
if ($val =~ /^no$/i) {
} elsif ($val !~ /^yes$/i) {
}
} elsif ($key =~ /^pkcs11$/i) {
if ($val =~ /^yes$/i) {
} elsif ($val !~ /^no$/i) {
$pkcs11_path = $val;
$pkcs11_path =~ s/\.dll$//i;
}
} elsif ($key =~ /^ecdsa$/i) {
if ($val =~ /^no$/i) {
} elsif ($val =~ /^yes$/i) {
}
} elsif ($key =~ /^gost$/i) {
if ($val =~ /^no$/i) {
} elsif ($val =~ /^yes$/i) {
}
} elsif ($key =~ /^gssapi$/i) {
if ($val !~ /^no$/i) {
if ($val !~ /^yes$/i) {
$gssapi_path = $val;
}
}
} elsif ($key =~ /^libxml2$/i) {
if ($val =~ /^no$/i) {
} elsif ($val !~ /^yes$/i) {
}
} elsif ($key =~ /^geoip$/i) {
if ($val !~ /^no$/i) {
if ($val !~ /^yes$/i) {
$geoip_path = $val;
}
}
} elsif ($key =~ /^readline$/i) {
if ($val !~ /^no$/i) {
if ($val !~ /^yes$/i) {
}
}
} elsif ($key =~ /^idn$/i) {
if ($val !~ /^no$/i) {
if ($val !~ /^yes$/i) {
}
}
} elsif ($key =~ /^iconv$/i) {
if ($val =~ /^no$/i) {
} elsif ($val !~ /^yes$/i) {
$iconv_path = $val;
}
} elsif ($key =~ /^python$/i) {
if ($val =~ /^no$/i) {
$use_python = "no";
} else {
$use_python = "yes";
if ($val !~ /^yes$/i) {
$python_command = $val;
}
}
} elsif ($key =~ /^vcredist$/i) {
if ($val =~ /^no$/i) {
$want_unknown = "yes";
$unknown_value = "without-vcredist (vcredist is required)";
} elsif ($val !~ /^yes$/i) {
$vcredist_path = $val;
}
} elsif ($key =~ /^cross-compile$/i) {
if ($val =~ /^yes$/i) {
$cross_compile = "yes";
}
} else {
$want_unknown = "yes";
if ($val eq "no") {
$unknown_value = "without-" . $key;
} else {
$unknown_value = "with-" . $key;
}
}
}
if ($want_help ne "no") {
foreach (@help) {
print $_;
}
exit 1;
}
# clean up and exit if requested
if ($want_clean eq "yes") {
my $file;
foreach $file (@filelist) {
unlink($file);
}
foreach $file (@projectlist) {
unlink($file);
}
exit 0;
}
if ($want_unknown ne "no") {
exit 1;
}
if ($verbose) {
}
}
} else {
print "\n";
}
}
} else {
}
} else {
}
} else {
}
} else {
}
} else {
}
} else {
}
} else {
}
} else {
}
} else {
}
} else {
}
}
}
} else {
}
} else {
}
} else {
}
} else {
}
} else {
}
} else {
}
} else {
}
} else {
}
}
} else {
}
}
# Check environment
# infer vcredist when not given
if ($verbose) {
}
}
}
} else {
}
}
my $msc_ver = 0;
print F << 'EOF';
#include <windows.h>
#include <stdio.h>
int
main(void)
{
printf("%d\n", _MSC_VER);
return(0);
}
EOF
close F;
} else {
}
if ($verbose) {
print "_MSV_VER == $msc_ver\n";
}
if ($msc_ver < 1600) {
print STDERR "only the legacy (cf legacy\\win32-build.txt) will work\n";
}
# gen single threaded for < VS 2005
if ($msc_ver < 1400) {
$configvar{"COPTML"} = "/ML";
$configvar{"COPTMLD"} = "/MLD";
}
# /GX deprecated in VS 2005
if ($msc_ver < 1400) {
$configvar{"COPTX"} = "/GX";
} else {
$configvar{"COPTX"} = "/EHsc";
}
# /YX for < VS 2005
if ($msc_ver < 1400) {
$configvar{"COPTY"} = "/YX";
}
# backtrace for >= VS 2012
if ($msc_ver >= 1700) {
$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") {
open F, ">cross.c" || die $!;
#include <windows.h>
#include <stdio.h>
int
main(void)
{
#ifdef _WIN64
fprintf(stderr, "compiling for x64 when win32 was asked?!\n");
#endif
return(0);
}
EOF
close F;
my $compret = `cl /nologo /MD cross.c`;
if (grep { -f and -x } ".\\cross.exe") {
my $cross = `.\\cross.exe`;
if ($cross) {
print STDERR $cross;
}
} else {
}
} else {
print F << 'EOF';
#include <windows.h>
#include <stdio.h>
int
main(void)
{
#ifndef _WIN64
#endif
return(0);
}
EOF
close F;
if ($cross) {
print STDERR $cross;
}
} else {
}
}
# Process arguments
# enable-intrinsics
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;
} else {
$configvar{"INTRINSIC"} = "false";
}
# enable-native-pkcs11
if ($enable_native_pkcs11 eq "yes") {
if ($use_openssl eq "auto") {
$use_openssl = "no";
}
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";
}
} else {
print "enabled ECDSA support in native PKCS#11\n";
}
}
print "no GOST support in native PKCS#11\n";
}
} else {
print "enabled GOST support in native PKCS#11\n";
}
}
}
# enable-filter-aaaa
}
# enable-fixed-rrset
}
# enable-rpz-nsip
}
# enable-rpz-nsdname
}
# with-tests
}
# with-extra-tests
}
# with-openssl
print "OpenSSL library is disabled\n";
}
print "checking for an OpenSSL built directory at sibling root\n";
}
# Make sure we have something
}
# Now see if we have a directory or just a file.
# Make sure we are case insensitive
my $file;
"inc32\\openssl",
last;
}
}
# If we have one use it otherwise report the error
}
}
# falls into (so no else)
}
"inc32\\openssl",
}
}
}
print "OpenSSL DSA support is disabled\n";
}
}
# check OpenSSL
print "checking whether linking with OpenSSL works\n";
}
if ($? != 0) {
}
print F << 'EOF';
int
main(void)
{
return(0);
}
close F;
if ($? != 0) {
}
} else {
}
}
# check OpenSSL version
}
print F << 'EOF';
#include <stdio.h>
#include <openssl/opensslv.h>
OPENSSL_VERSION_NUMBER < 0x00908000L) ||
OPENSSL_VERSION_NUMBER >= 0x0090804fL)
return (0);
"Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n");
return (1);
}
close F;
if ($? != 0) {
}
} else {
}
}
# check EVP_sha256 / EVP_sha384 / EVP_sha512
}
print F << 'EOF';
}
close F;
if ($? == 0) {
print "EVP_sha256 test failed: disabling EVP_sha256\n";
}
} else {
}
} else {
print "disabling EVP_sha256\n";
}
}
}
print F << 'EOF';
}
close F;
if ($? == 0) {
print "EVP_sha384 test failed: disabling EVP_sha384\n";
}
} else {
}
} else {
print "disabling EVP_sha384\n";
}
}
}
print F << 'EOF';
}
close F;
if ($? == 0) {
print "EVP_sha512 test failed: disabling EVP_sha512\n";
}
} else {
}
} else {
print "disabling EVP_sha512\n";
}
}
}
# with-ecdsa
}
print "checking for OpenSSL ECDSA support\n";
}
print F << 'EOF';
int
main(void)
{
return (2);
return (0);
}
close F;
if ($? != 0) {
print "ECDSA test failed: disabling ECDSA\n";
}
}
} else {
print "disabling ECDSA\n";
}
}
}
}
# with-gost
}
print "checking for OpenSSL GOST support\n";
}
print F << 'EOF';
int
main(void)
{
#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
ENGINE *e;
if (e == NULL)
return (1);
return (1);
return (0);
#else
return (1);
#endif
}
close F;
if ($? != 0) {
print "GOST test failed: disabling GOST\n";
}
}
} else {
print "disabling GOST\n";
}
}
}
}
}
# enable-openssl-hash
}
}
# with-pkcs11
}
# with-gssapi
print "gssapi library is disabled\n";
}
} else {
}
}
}
}
my $gssapi_lib;
my $krb5_lib;
"gssapi${bits}.lib")) {
}
"gssapi${bits}.lib");
"krb5_${bits}.lib")) {
}
"krb5_${bits}.lib");
"gssapi${bits}.lib")) {
}
"gssapi${bits}.lib");
"krb5_${bits}.lib")) {
}
"krb5_${bits}.lib");
} else {
}
}
}
}
}
}
"gssapi${bits}.dll");
"krb5_${bits}.dll");
"comerr${bits}.dll");
"k5sprt${bits}.dll");
"wshelp${bits}.dll");
}
# enable-isc-spnego
}
}
# with-geoip
print "geoip library is disabled\n";
}
} else {
}
}
}
}
print "checking for GeoIP support\n";
}
if ($? != 0) {
}
print F << 'EOF';
return GeoIP_open != 0;
}
close F;
if ($? == 0) {
}
} else {
}
print "checking for GeoIP Country IPv6 support\n";
}
print F << 'EOF';
#include <GeoIP.h>
int flag = 1;
if (flag)
return 1;
}
close F;
if ($? == 0) {
}
} else {
}
print "checking for GeoIP City IPv6 support\n";
}
print F << 'EOF';
#include <GeoIP.h>
#include <GeoIPCity.h>
int i = GEOIP_CITY_EDITION_REV0_V6;
int flag = 1;
if (flag)
return 1;
}
close F;
if ($? == 0) {
}
} else {
}
}
# with-readline
print "readline library is disabled\n";
}
} else {
}
}
}
my $readline_lib = File::Spec->catfile($readline_path,
my $readline_libd = File::Spec->catfile($readline_path,
} else {
}
}
# with-idn (including with-iconv)
print "IDN kit is disabled\n";
}
} else {
}
}
}
}
} else {
}
}
# with-libxml2
print "libxml2 library is disabled\n";
}
print "checking for a libxml2 built directory at sibling root\n";
}
# Make sure we have something
}
# Now see if we have a directory or just a file.
# Make sure we are case insensitive
my $file;
"include\\libxml",
last;
}
}
# If we have one use it otherwise report the error
}
}
# falls into (so no else)
}
"include\\libxml",
}
}
}
}
# with-python
print "python is disabled\n";
}
print "checking for python in path\n";
}
if ($? != 0) {
}
}
if ($? != 0) {
print STDERR
}
}
}
# with-vcredist
} else {
}
# setup config.h with %configdefh
sub setupconfigh {
my $line;
my @Lines;
open F, $configfilein || die $!;
@Lines = <F>;
close F;
} else {
}
}
}
open F, $configfileout || die $!;
}
}
close F;
}
# setup platform.h with %configdefp
sub setupplatformh {
my $line;
my @Lines;
@Lines = <F>;
close F;
} else {
}
}
}
}
}
close F;
}
# escape spaces
sub kw {
if ($_[0] =~ / /) {
return "\"$_[0]\"";
} else {
return "$_[0]";
}
}
# setup a file with %configcond stack and %config{var,defd,inc,lib,dll}
sub setupfile {
my $line;
my @Linesin;
my @Linesout;
my $filename = $_[0];
my $cond;
my @conds;
my $pass = 1;
my @passes;
my $val;
@Linesin = <F>;
close F;
}
$cond = $1;
# do nothing
} else {
$pass = 0;
}
next;
}
$pass = 0;
} else {
} else {
$pass = 1;
}
}
next;
}
} else {
$pass = 1;
}
next;
}
next;
}
} else {
$line = "$`$'";
}
} elsif ($1 ~~ @substdefd) {
if (defined($configdefd{$1})) {
my $def = $configdefd{$1};
$def =~ s/([\\ "])/\\$1/g;
} else {
$line = "$`$'";
}
} elsif ($1 ~~ @substinc) {
if (defined($configinc{$1})) {
} else {
$line = "$`$'";
}
} elsif ($1 ~~ @substlib) {
if (defined($configlib{$1})) {
$val = kw($configlib{$1});
} else {
}
} elsif ($1 ~~ @substdll) {
if (defined($configdll{$1})) {
$val = kw($configdll{$1});
$line = "$`$val$'";
} else {
}
} else {
}
}
}
}
}
close F;
}
# setup a project with %configcond stack and %config{var,defd,inc,lib,dll}
sub setupproject {
my $line;
my @Linesin;
my @Linesout;
my $projectname = $_[0];
my $cond;
my @conds;
my $pass = 1;
my @passes;
my $val;
@Linesin = <F>;
close F;
}
$cond = $1;
# do nothing
} else {
$pass = 0;
}
next;
}
$pass = 0;
} else {
} else {
$pass = 1;
}
}
next;
}
} else {
$pass = 1;
}
next;
}
next;
}
} else {
$line = "$`$'";
}
} elsif ($1 ~~ @substdefd) {
if (defined($configdefd{$1})) {
$val = kw($configdefd{$1});
} else {
}
} elsif ($1 ~~ @substinc) {
if (defined($configinc{$1})) {
$val = kw($configinc{$1});
$line = "$`$val;$'";
} else {
}
} else {
$line = "$`$'";
}
} elsif ($1 ~~ @substdll) {
if (defined($configdll{$1})) {
$val = kw($configdll{$1});
} else {
}
} else {
die "unknown control $& in $projectname\n";
}
}
push @Linesout, $line;
}
open F, ">" . $projectname || die $!;
if ($verbose) {
print "Setting up $projectname\n";
}
foreach $line (@Linesout) {
print F $line . "\n";
}
close F;
}
# make versions.h
sub makeversion {
# List of directories with version files
my @dirlist = ("iscpk11", "isc", "dns", "isccc",
"isccfg", "lwres", "bind9");
my %LibMacros = (
"bind9" => "LIBBIND9_EXPORTS",
"dns" => "LIBDNS_EXPORTS",
"isc" => "LIBISC_EXPORTS",
"isccc" => "LIBISCCC_EXPORTS",
"isccfg" => "LIBISCCFG_EXPORTS",
"iscpk11" => "LIBISCPK11_EXPORTS",
"lwres" => "LIBLWRES_EXPORTS");
my @VersionNames = ("LIBINTERFACE", "LIBREVISION", "LIBAGE");
my %Versions;
my $Version;
my %ApiVersions;
my $Mapapi;
my $versionfile = "versions.h";
my $versionpath = "..\\$versionfile";
my $data;
my $name;
my $value;
# First get the version information
open V, "..\\version" || die $!;
while (<V>) {
chomp;
($data) = split(/\#/);
if ($data) {
($name, $value) = split(/=/, $data);
($name) = split(/\s+/, $name);
($value) =~ s/^["\s]+//;
($value) =~ s/["\s]+$//;
} else {
($value) = split(/\s+/, $value);
}
$Versions{$name} = $value;
}
}
close V;
# And the mapapi one
open M, "..\\lib\\dns\\mapapi" || die $!;
while (<M>) {
chomp;
($data) = split(/\#/);
if ($data) {
($name, $value) = split(/=/, $data);
($name) = split(/\s+/, $name);
($value) =~ s/^["\s]+//;
($value) =~ s/["\s]+$//;
} else {
($value) = split(/\s+/, $value);
}
$Mapapi = $value;
}
}
close M;
# Now set up the output version file
my $ThisDate = scalar localtime();
open O, ">$versionpath" ||
# Standard Header
print O '/*
* 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.
*
* 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 "/*\n";
print O " */\n\n";
print O '
#ifndef VERSIONS_H
#define VERSIONS_H 1
';
if ($Versions{'PATCHVER'} != "") {
}
if ($verbose) {
}
print O "#define VERSION \"$Version\"\n";
print O
my $dir;
my $apifile;
while (<A>) {
$name =~ s/\s+//;
$value =~ s/\s+//;
$ApiVersions{$name} = $value;
}
}
close A;
}
print O "#endif\n\n";
}
print O "#endif /* VERSIONS_H */\n";
close O;
}
# make srcid.h
sub makesrcid {
my $data;
my $name;
my $value;
}
}
}
# Now set up the output version file
# Standard Header
print SOUT '/*
* 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 '
#ifndef SRCID_H
#define SRCID_H 1
';
}
}
# Status
my $name;
print "Configuration Status\n";
} else {
}
}
} else {
}
}
print "\tconditions:\n";
} else {
}
}
print "\tsubstitutions:\n";
}
}
print "\tdefines:\n";
}
}
print "\tincludes:\n";
}
}
print "\tlibraries:\n";
}
}
print "\tDLLs:\n";
}
}
print "\n";
}
# Setup
my $file;
}
}
}
print "Configured.\n";
} else {
print "add win32 or x64 to commit configuration to build files\n";
}
exit 0;
# Notes: Unix configure.in options
# --enable-developer partially supported
# --enable-newstats (9.9/9.9sub only)
# --enable-openssl-version-check included without a way to disable it
# --enable-openssl-hash supported
# --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 intrinsic)
# --enable-spnego support (part of GSSAPI)
# --enable-fixed-rrset supported
# --disable-rpz-nsip supported
# --disable-rpz-nsdname supported
# --enable-filter-aaaa supported
# --with-python supported
# --with-openssl supported
# --with-ecdsa supported
# --with-gost supported
# --with-pkcs11 supported
# --with-geoip supported
# --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-idn support
# --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
# --with-dlz-* ?
#
# Notes: MSVC versions
# 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)