my @substdefh = ("AES_CC",
"CONFIGARGS",
"DNS_RDATASET_FIXED",
- "HAVE_GEOIP",
- "HAVE_GEOIP_CITY_V6",
- "HAVE_GEOIP_V6",
+ "HAVE_GEOIP2",
"HAVE_LIBXML2",
"HAVE_OPENSSL_ED25519",
"HAVE_OPENSSL_ED448",
my @substdll = ("COMERR_DLL",
"GSSAPI_DLL",
- "GEOIP_DLL",
"ICONV_DLL",
"IDN_DLL",
"KRB5_DLL",
"eddsa",
"extra-tests",
"gssapi",
- "geoip",
+ "geoip2",
"iconv",
"idn",
"openssl",
" with-cc-alg choose the algorithm for cookies aes|sha1|sha256\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-geoip2[=PATH] build with GeoIP2 support yes|no|path\n",
" with-pssuspend[=COMMAND] specify pssuspend command\n",
" with-python[=COMMAND] specify python interpreter python|command\n",
" with-readline[=PATH] build with readline library support yes|no|path\n",
my $use_gssapi = "no";
my $validation_default = "auto";
my $gssapi_path = "C:\\Program\ Files\\MIT\\Kerberos\\";
-my $use_geoip = "no";
-my $geoip_path = "";
+my $use_geoip2 = "no";
+my $geoip2_path = "";
my $use_libxml2 = "auto";
my $libxml2_path = "..\\..\\";
my $with_pssuspend = "no";
$use_libxml2 = "yes";
$libxml2_path = $val;
}
- } elsif ($key =~ /^geoip$/i) {
+ } elsif ($key =~ /^geoip2$/i) {
if ($val !~ /^no$/i) {
- $use_geoip = "yes";
+ $use_geoip2 = "yes";
if ($val !~ /^yes$/i) {
- $geoip_path = $val;
+ $geoip2_path = $val;
+ } else {
+ $geoip2_path = "..\\..\\GeoIP2";
}
}
} elsif ($key =~ /^readline$/i) {
} else {
print "libxml2-path: $libxml2_path\n";
}
- if ($use_geoip eq "no") {
- print "geoip: disabled\n";
+ if ($use_geoip2 eq "no") {
+ print "geoip2: disabled\n";
} else {
- print "geoip-path: $geoip_path\n";
+ print "geoip2-path: $geoip2_path\n";
}
if ($use_readline eq "no") {
print "readline: disabled\n";
$configdefh{"HAVE_DH_GET0_KEY"} = 1;
$configdefh{"HAVE_ECDSA_SIG_GET0"} = 1;
$configdefh{"HAVE_RSA_SET0_KEY"} = 1;
+ $configdefh{"HAVE_CRYPTO_ZALLOC"} = 1;
$configdefh{"HAVE_EVP_CIPHER_CTX_FREE"} = 1;
$configdefh{"HAVE_EVP_CIPHER_CTX_NEW"} = 1;
$configdefh{"HAVE_EVP_MD_CTX_FREE"} = 1;
# disable-auto-validation
$configdefh{"VALIDATION_DEFAULT"} = "\"$validation_default\"";
-# with-geoip
-if ($use_geoip eq "no") {
+# with-geoip2
+if ($use_geoip2 eq "no") {
if ($verbose) {
- print "geoip library is disabled\n";
+ print "geoip2 library is disabled\n";
}
} else {
$configcond{"GEOIP"} = 1;
- $geoip_path = File::Spec->rel2abs($geoip_path);
+ $geoip2_path = File::Spec->rel2abs($geoip2_path);
if ($verbose) {
- print "checking for geoip directory at \"$geoip_path\"\n";
- }
- if (!-f File::Spec->catfile($geoip_path, "GeoIP.h")) {
- die "can't find GeoIP.h include\n";
- }
- if (!-f File::Spec->catfile($geoip_path, "GeoIP.lib")) {
- die "can't find Geoip.lib library\n";
- }
- if (!-f File::Spec->catfile($geoip_path, "GeoIP.dll")) {
- die "can't find Geoip.dll DLL\n";
- }
- $configinc{"GEOIP_INC"} = "$geoip_path";
- my $geoip_lib = File::Spec->catfile($geoip_path, "GeoIP.lib");
- $configlib{"GEOIP_LIB"} = "$geoip_lib";
- my $geoip_dll = File::Spec->catfile($geoip_path, "GeoIP.dll");
- $configdll{"GEOIP_DLL"} = "$geoip_dll";
-
- if ($verbose) {
- print "checking for GeoIP support\n";
- }
- my $ret = `copy "$geoip_dll" .`;
- if ($? != 0) {
- die "Can't copy GeoIP DLL to working directory: $ret\n";
+ print "checking for geoip2 directory at \"$geoip2_path\"\n";
}
- open F, ">testgeoip.c" || die $!;
- print F << 'EOF';
-extern void *GeoIP_open();
-
-int main() {
- return GeoIP_open != 0;
-}
-EOF
- close F;
- $compret = `cl /nologo /MD testgeoip.c "$geoip_lib"`;
- if (grep { -f and -x } ".\\testgeoip.exe") {
- `.\\testgeoip.exe`;
- if ($? == 0) {
- die "GeoIP test failed\n";
- }
- } else {
- die "can't compile GeoIP test: $compret\n";
+ if (!-f File::Spec->catfile($geoip2_path, "maxminddb.h")) {
+ die "can't find maxminddb.h include\n";
}
- $configdefh{"HAVE_GEOIP"} = 1;
-
- if ($verbose) {
- print "checking for GeoIP Country IPv6 support\n";
+ if (!-f File::Spec->catfile($geoip2_path, "maxminddb_config.h")) {
+ die "can't find maxminddb_config.h include\n";
}
- my $geoip_inc = qq(/I "$geoip_path");
- my $geoip_libs = qq("$geoip_lib" ws2_32.lib);
- open F, ">testgeoip1.c" || die $!;
- print F << 'EOF';
-#include <GeoIP.h>
-
-struct in6_addr in6;
-int flag = 1;
-
-int main() {
- if (flag)
- return 1;
- return GeoIP_country_name_by_ipnum_v6(NULL, in6) != NULL;
-}
-EOF
- close F;
- $compret = `cl /nologo $geoip_inc /MD testgeoip1.c $geoip_libs`;
- if (grep { -f and -x } ".\\testgeoip1.exe") {
- `.\\testgeoip1.exe`;
- if ($? == 0) {
- die "GeoIP Country IPv6 test failed\n";
- }
- } else {
- die "can't compile GeoIP Country IPv6 test: $compret\n";
+ if (!-f File::Spec->catfile($geoip2_path, "libmaxminddb.lib")) {
+ die "can't find libmaxminddb.lib library\n";
}
- $configdefh{"HAVE_GEOIP_V6"} = 1;
+ $configinc{"GEOIP_INC"} = "$geoip2_path";
+ my $geoip2_lib = File::Spec->catfile($geoip2_path, "libmaxminddb.lib");
+ $configlib{"GEOIP_LIB"} = "$geoip2_lib";
+ my $geoip_inc = qq(/I "$geoip2_path");
+ my $geoip2_libs = qq("$geoip2_lib" Ws2_32.Lib);
if ($verbose) {
- print "checking for GeoIP City IPv6 support\n";
+ print "checking for GeoIP2 support\n";
}
open F, ">testgeoip2.c" || die $!;
print F << 'EOF';
-#include <GeoIP.h>
-#include <GeoIPCity.h>
-
-struct in6_addr in6;
-int i = GEOIP_CITY_EDITION_REV0_V6;
-int flag = 1;
-
-int main() {
- if (flag)
- return 1;
- return GeoIP_record_by_ipnum_v6(NULL, in6) != NULL;
+#include <maxminddb.h>
+int main(void) {
+ return MMDB_lib_version() != 0;
}
EOF
close F;
- $compret = `cl /nologo $geoip_inc /MD testgeoip2.c $geoip_libs`;
+ $compret = `cl /nologo $geoip_inc /MD testgeoip2.c $geoip2_libs`;
if (grep { -f and -x } ".\\testgeoip2.exe") {
`.\\testgeoip2.exe`;
if ($? == 0) {
- die "GeoIP City IPv6 test failed\n";
+ die "GeoIP2 test failed\n";
}
} else {
- die "can't compile GeoIP City IPv6 test: $compret\n";
+ die "can't compile GeoIP2 test: $compret\n";
}
- $configdefh{"HAVE_GEOIP_CITY_V6"} = 1;
+ $configdefh{"HAVE_GEOIP2"} = 1;
}
# with-readline
print LOUT "krb5_32.dll-BCFT\n";
}
}
- if ($use_geoip eq "yes") {
- print LOUT "libgeoip.dll-BCFT\n";
- }
if ($use_idn eq "yes") {
print LOUT "idnkit.dll-BCFT\n";
print LOUT "iconv.dll-BCFT\n";
# --with-aes supported
# --with-cc-alg supported
# --with-randomdev not supported on WIN32 (makes no sense)
-# --with-geoip supported
+# --with-geoip2 supported
# --with-gssapi supported with MIT (K)erberos (f)or (W)indows
# --with-lmdb no supported on WIN32 (port is not reliable)
# --with-libxml2 supported