Configure revision dbb012765c735ee0d82dedb116cdc7cf18957814
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington# Copyright (C) 2013, 2014 Internet Systems Consortium, Inc. ("ISC")
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington# Permission to use, copy, modify, and/or distribute this software for any
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington# purpose with or without fee is hereby granted, provided that the above
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington# copyright notice and this permission notice appear in all copies.
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington# PERFORMANCE OF THIS SOFTWARE.
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington# This script builds nmake and visual studio build files
71f5ad0517325eb32ecbee112206277c6277af87Brian Wellingtonrequire 5.000;
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington# files to configure
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellingtonmy $platformfile = "..\\lib\\isc\\win32\\include\\isc\\platform.h";
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellingtonmy @filelist = ("..\\bin\\check\\win32\\checktool.dsp",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\confgen\\win32\\confgentool.dsp",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\confgen\\win32\\ddnsconfgen.dsp",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\confgen\\win32\\ddnsconfgen.mak",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\confgen\\win32\\rndcconfgen.dsp",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\confgen\\win32\\rndcconfgen.mak",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\dnssec\\win32\\keyfromlabel.dsp",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\dnssec\\win32\\keyfromlabel.mak",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\tests\\atomic\\win32\\t_atomic.dsp",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\tests\\atomic\\win32\\t_atomic.mak",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\master\\win32\\t_master.dsp",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\master\\win32\\t_master.mak",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\hashes\\win32\\t_hashes.dsp",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\hashes\\win32\\t_hashes.mak",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\names\\win32\\t_names.dsp",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\names\\win32\\t_names.mak",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\resolver\\win32\\t_resolver.dsp",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\resolver\\win32\\t_resolver.mak",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\tests\\sockaddr\\win32\\t_sockaddr.dsp",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\tests\\sockaddr\\win32\\t_sockaddr.mak",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\tests\\tasks\\win32\\t_tasks.dsp",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\tests\\tasks\\win32\\t_tasks.mak",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\timers\\win32\\t_timers.dsp",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\tests\\timers\\win32\\t_timers.mak",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\tests\\win32\\backtrace_test.dsp",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\tests\\win32\\backtrace_test.mak",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\tests\\win32\\shutdown_test.dsp",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\tests\\win32\\shutdown_test.mak",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\win32\\shutdown_test.dsp",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\win32\\shutdown_test.mak",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\win32\\BINDInstall\\BINDInstall.dsp",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\win32\\BINDInstall\\BINDInstall.mak",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellingtonmy @projectlist = ("..\\bin\\check\\win32\\checkconf.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\check\\win32\\checkconf.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\check\\win32\\checktool.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\check\\win32\\checktool.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\check\\win32\\checkzone.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\check\\win32\\checkzone.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\confgen\\win32\\confgentool.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\confgen\\win32\\confgentool.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\confgen\\win32\\ddnsconfgen.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\confgen\\win32\\ddnsconfgen.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\confgen\\win32\\rndcconfgen.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\confgen\\win32\\rndcconfgen.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\dig\\win32\\dig.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\dig\\win32\\dighost.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\dig\\win32\\host.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\dig\\win32\\nslookup.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\dnssec\\win32\\dnssectool.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\dnssec\\win32\\dnssectool.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\dnssec\\win32\\dsfromkey.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\dnssec\\win32\\dsfromkey.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\dnssec\\win32\\importkey.vcxproj",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\dnssec\\win32\\importkey.vcxproj.filters",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\dnssec\\win32\\keyfromlabel.vcxproj",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\dnssec\\win32\\keyfromlabel.vcxproj.filters",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\dnssec\\win32\\keygen.vcxproj.filters",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\dnssec\\win32\\revoke.vcxproj.filters",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\dnssec\\win32\\settime.vcxproj.filters",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\dnssec\\win32\\signzone.vcxproj",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\dnssec\\win32\\signzone.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\dnssec\\win32\\verify.vcxproj.filters",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\named\\win32\\named.vcxproj.filters",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\nsupdate\\win32\\nsupdate.vcxproj",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\nsupdate\\win32\\nsupdate.vcxproj.filters",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\pkcs11\\win32\\pk11destroy.vcxproj",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\pkcs11\\win32\\pk11destroy.vcxproj.filters",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\pkcs11\\win32\\pk11keygen.vcxproj",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\pkcs11\\win32\\pk11keygen.vcxproj.filters",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\pkcs11\\win32\\pk11list.vcxproj",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\pkcs11\\win32\\pk11list.vcxproj.filters",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\pkcs11\\win32\\pk11tokens.vcxproj",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\pkcs11\\win32\\pk11tokens.vcxproj.filters",
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington "..\\bin\\rndc\\win32\\rndc.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\rndc\\win32\\rndcutil.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tools\\win32\\arpaname.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tools\\win32\\genrandom.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tools\\win32\\genrandom.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tools\\win32\\ischmacfixup.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tools\\win32\\ischmacfixup.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tools\\win32\\journalprint.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tools\\win32\\journalprint.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tools\\win32\\nsec3hash.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tools\\win32\\nsec3hash.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tools\\win32\\rrchecker.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tools\\win32\\rrchecker.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\atomic\\win32\\t_atomic.vcxproj",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\atomic\\win32\\t_atomic.vcxproj.filters",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "..\\bin\\tests\\db\\win32\\t_db.vcxproj.filters",
# for config.h
my %configdefh;
# for platform.h
my %configdefp;
my %configinc;
my %configlib;
my %configdll;
my %configvar;
my %configdefd;
my %configcond;
@usage,
my $unknown_value;
$verbose = 1;
$legacy_only = 1;
$unknown_value = $_;
my $arg = $_[0];
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) {
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) {
if ($verbose) {
if ($verbose) {
my $rfile;
if (-f $vp) {
if ($verbose) {
my $msc_ver = 0;
#include <windows.h>
#include <stdio.h>
print STDERR "only the legacy (cf legacy\\win32-build.txt) will work\n";
open F, ">cross.c" || die $!;
#include <windows.h>
#include <stdio.h>
my $compret = `cl /nologo /MD cross.c`;
if (grep { -f and -x } ".\\cross.exe") {
my $cross = `.\\cross.exe`;
#include <windows.h>
#include <stdio.h>
if ($cross) {
print STDERR $cross;
my $file;
last;
close F;
#include <stdio.h>
#include <openssl/opensslv.h>
OPENSSL_VERSION_NUMBER >= 0x0090804fL)
close F;
close F;
close F;
close F;
close F;
ENGINE *e;
close F;
my $gssapi_lib;
my $krb5_lib;
return GeoIP_open != 0;
close F;
#include <GeoIP.h>
int flag = 1;
close F;
#include <GeoIP.h>
#include <GeoIPCity.h>
int i = GEOIP_CITY_EDITION_REV0_V6;
int flag = 1;
close F;
my $file;
last;
print STDERR
# setup config.h with %configdefh
my $line;
my @Lines;
open F, $configfilein || die $!;
@Lines = <F>;
close F;
open F, $configfileout || die $!;
close F;
# setup platform.h with %configdefp
my $line;
my @Lines;
@Lines = <F>;
close F;
close F;
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;
$pass = 0;
$pass = 0;
$pass = 1;
$pass = 1;
if (defined($configdefd{$1})) {
my $def = $configdefd{$1};
push @Linesout, $line;
if ($verbose) {
foreach $line (@Linesout) {
my $line;
my $projectname = $_[0];
my $cond;
my $pass = 1;
my $val;
foreach $line (@Linesin) {
chomp $line;
if ($line =~ /^\@IF (.*)$/) {
if (defined($cond)) {
unshift(@conds, $cond);
unshift(@passes, $pass);
$cond = $1;
if (defined($configcond{$cond})) {
$pass = 0;
} elsif ($line =~ /^\@ELSE (.*)$/) {
if ($cond ne $1) {
if (defined($configcond{$cond})) {
$pass = 0;
$pass = 1;
} elsif ($line =~ /^\@END (.*)$/) {
if ($cond ne $1) {
$cond = shift(@conds);
$pass = shift(@passes);
$pass = 1;
if ($pass == 0) {
while ($line =~ /@([^@ ]*)@/) {
if (defined($configvar{$1})) {
$val = kw($configvar{$1});
if (defined($configlib{$1})) {
$val = kw($configlib{$1});
close F;
# make versions.h
my %Versions;
my $Version;
my %ApiVersions;
my $Mapapi;
my $data;
my $name;
my $value;
close V;
close M;
my $dir;
my $apifile;
$name =~ s/\s+//;
$value =~ s/\s+//;
$ApiVersions{$name} = $value;
close A;
close O;
# make srcid.h
my $data;
my $name;
my $value;
my $name;
my $file;
# Notes: Unix configure.in options