Configure revision 2ae159b376dac23870d8005563c585acf85a4b5a
080575042aba2197b425ebfd52061dea061a9aa1xy# Copyright (C) 2013, 2014 Internet Systems Consortium, Inc. ("ISC")
080575042aba2197b425ebfd52061dea061a9aa1xy# Permission to use, copy, modify, and/or distribute this software for any
080575042aba2197b425ebfd52061dea061a9aa1xy# purpose with or without fee is hereby granted, provided that the above
080575042aba2197b425ebfd52061dea061a9aa1xy# copyright notice and this permission notice appear in all copies.
47b7744cbea59975a6b583125b7ed1ff2ac45313yy# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
080575042aba2197b425ebfd52061dea061a9aa1xy# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
080575042aba2197b425ebfd52061dea061a9aa1xy# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
080575042aba2197b425ebfd52061dea061a9aa1xy# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
080575042aba2197b425ebfd52061dea061a9aa1xy# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
080575042aba2197b425ebfd52061dea061a9aa1xy# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
080575042aba2197b425ebfd52061dea061a9aa1xy# PERFORMANCE OF THIS SOFTWARE.
080575042aba2197b425ebfd52061dea061a9aa1xy# Configure
080575042aba2197b425ebfd52061dea061a9aa1xy# This script builds nmake and visual studio build files
080575042aba2197b425ebfd52061dea061a9aa1xyrequire 5.000;
080575042aba2197b425ebfd52061dea061a9aa1xy# files to configure
080575042aba2197b425ebfd52061dea061a9aa1xymy $platformfile = "..\\lib\\isc\\win32\\include\\isc\\platform.h";
080575042aba2197b425ebfd52061dea061a9aa1xymy @projectlist = ("..\\bin\\check\\win32\\checkconf.vcxproj",
080575042aba2197b425ebfd52061dea061a9aa1xy "..\\bin\\tests\\atomic\\win32\\t_atomic.vcxproj.filters",
080575042aba2197b425ebfd52061dea061a9aa1xy "..\\bin\\tests\\master\\win32\\t_master.vcxproj.filters",
080575042aba2197b425ebfd52061dea061a9aa1xy "..\\bin\\tests\\hashes\\win32\\t_hashes.vcxproj.filters",
080575042aba2197b425ebfd52061dea061a9aa1xy "..\\bin\\tests\\resolver\\win32\\t_resolver.vcxproj.filters",
080575042aba2197b425ebfd52061dea061a9aa1xy "..\\bin\\tests\\sockaddr\\win32\\t_sockaddr.vcxproj.filters",
080575042aba2197b425ebfd52061dea061a9aa1xy "..\\bin\\tests\\timers\\win32\\t_timers.vcxproj.filters",
080575042aba2197b425ebfd52061dea061a9aa1xy "..\\bin\\win32\\BINDInstall\\BINDInstall.vcxproj.filters",
080575042aba2197b425ebfd52061dea061a9aa1xy# libraries
080575042aba2197b425ebfd52061dea061a9aa1xy# variables
080575042aba2197b425ebfd52061dea061a9aa1xy# conditions
080575042aba2197b425ebfd52061dea061a9aa1xy# arguments
5633182f116a16b7c1bbc302492a4780df929221yy# general arguments
5633182f116a16b7c1bbc302492a4780df929221yymy @optionlist = ("help", "verbose", "legacy", "win32", "x64", "clean");
ea6b684a18957883cb91b3d22a9d989f986e5a32yy" legacy (options) process only files for legacy build\n",
4914a7d0d1ee59f8cc21b19bfd7979cb65681eacyy" <none> (command) print a summary of the configuration\n",
4914a7d0d1ee59f8cc21b19bfd7979cb65681eacyy" enable-intrinsics enable instrinsic/atomic functions [default=yes]\n",
4914a7d0d1ee59f8cc21b19bfd7979cb65681eacyy" enable-native-pkcs11 use native PKCS#11 for all crypto [default=no]\n",
4914a7d0d1ee59f8cc21b19bfd7979cb65681eacyy" enable-openssl-hash use OpenSSL for hash functions [default=yes]\n",
4914a7d0d1ee59f8cc21b19bfd7979cb65681eacyy" enable-isc-spnego use SPNEGO from lib/dns [default=yes]\n",
4914a7d0d1ee59f8cc21b19bfd7979cb65681eacyy" enable-filter-aaaa enable filtering of AAAA records [default=no]\n",
4914a7d0d1ee59f8cc21b19bfd7979cb65681eacyy" enable-fixed-rrset enable fixed rrset ordering [default=no]\n",
4914a7d0d1ee59f8cc21b19bfd7979cb65681eacyy" enable-developer enable developer build settings [default=no]\n",
9b6541b318d01d0d83bfb98699a7f09e35f37951gl" enable-rpz-nsdname enable rpz-nsdname rules [default=yes]\n",
9b6541b318d01d0d83bfb98699a7f09e35f37951gl" enable-sit enable source identity token [default=yes]\n",
47b7744cbea59975a6b583125b7ed1ff2ac45313yy" with-pkcs11[=PATH] build with PKCS#11 support yes|no|provider-path\n",
47b7744cbea59975a6b583125b7ed1ff2ac45313yy" with-sit-alg choose the algorithm for SIT aes|sha1|sha256\n",
47b7744cbea59975a6b583125b7ed1ff2ac45313yy" with-gssapi[=PATH] build with MIT KfW GSSAPI yes|no|path\n",
3e4b7153174cf68b882e634beede9790233fe239ml" with-libxml2[=PATH] build with libxml2 library yes|no|path\n",
3e4b7153174cf68b882e634beede9790233fe239ml" with-geoip[=PATH] build with GeoIP support yes|no|path\n",
3e4b7153174cf68b882e634beede9790233fe239ml" with-python[=COMMAND] specify python interpreter python|command\n",
3e4b7153174cf68b882e634beede9790233fe239ml" with-readline[=PATH] build with readline library support yes|no|path\n",
3e4b7153174cf68b882e634beede9790233fe239ml" with-idn[=PATH] build with IDN kit support yes|no|path\n",
3e4b7153174cf68b882e634beede9790233fe239ml" with-iconv[=PATH] path of the iconv DLL [default=same than idn]\n",
6ad5fc39c6f3b123ae5588d60fc8dfe068e07bfcsv" with-vcredist[=PATH] visual C++ redistributable package yes|path\n",
6ad5fc39c6f3b123ae5588d60fc8dfe068e07bfcsv" with-tuning=OPTION tune for plaform size (large|default)\n",
6ad5fc39c6f3b123ae5588d60fc8dfe068e07bfcsv" with-cross-compile 32 / 64 bit build / host plaforms\n");
6ad5fc39c6f3b123ae5588d60fc8dfe068e07bfcsv# Parse arguments
fe62dec3a38f1f79ffe68417df75dbbb58135bb7Chen-Liang Xumy $gssapi_path = "C:\\Program\ Files\\MIT\\Kerberos\\";
$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 ($val =~ /^no$/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) {
} elsif ($key =~ /^sit$/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 =~ /^samples$/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 =~ /^aes$/i) {
if ($val =~ /^no$/i) {
} elsif ($val =~ /^yes$/i) {
} elsif ($key =~ /^sit-alg$/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;
EVP_CIPHER *aes128, *aes192, *aes256;
close F;
AES_KEY k;
const unsigned char bufin[16];
unsigned char bufout[16];
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