]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix various build failures on Windows (Courtesy of rockerinthelocker)
authorOndřej Surý <ondrej@sury.org>
Wed, 30 May 2018 13:09:55 +0000 (15:09 +0200)
committerOndřej Surý <ondrej@sury.org>
Wed, 30 May 2018 13:09:55 +0000 (15:09 +0200)
config.h.win32
lib/isc/win32/include/isc/platform.h.in
win32utils/Configure

index 4356a1a1998bfc53be6df4c5e5a48ad0b36df20a..87a2dca77839da8f326167cac5def74456284120 100644 (file)
@@ -330,6 +330,18 @@ typedef __int64 off_t;
 /* Define if your OpenSSL version supports GOST. */
 @HAVE_OPENSSL_GOST@
 
+/* Define if your OpenSSL version supports DH functions. */
+@HAVE_DH_GET0_KEY@
+
+/* Define if your OpenSSL version supports DSA functions. */
+@HAVE_DSA_GET0_PQG@
+
+/* Define if your OpenSSL version supports ECDSA functions. */
+@HAVE_ECDSA_SIG_GET0@
+
+/* Define if your OpenSSL version supports RSA functions. */
+@HAVE_RSA_SET0_KEY@
+
 /* Define if native PKCS#11 is used as cryptographic library provider */
 @HAVE_PKCS11@
 
index 3b60b01e11b6349bccae4957142861590fcc9517..0aeebff2497c15af7e61f1ff277b3b2fc66554bb 100644 (file)
@@ -56,9 +56,6 @@
 #define ISC_PLATFORM_NEEDNTOP
 #define ISC_PLATFORM_NEEDPTON
 #define ISC_PLATFORM_HAVESOCKADDRSTORAGE
-#if _MSC_VER >= 1900
-#define ISC_PLATFORM_HAVETFO
-#endif
 
 #define ISC_PLATFORM_QUADFORMAT "I64"
 
index 62e965ff35393f6a25a992b1a8532f55f08b7e71..4f77d26941bc22898d2576056c58cda1b2d89750 100644 (file)
@@ -209,6 +209,10 @@ my @substdefh = ("AES_CC",
                  "HAVE_OPENSSL_ED448",
                  "HAVE_OPENSSL_EVP_AES",
                  "HAVE_OPENSSL_GOST",
+                "HAVE_DH_GET0_KEY",
+                "HAVE_DSA_GET0_PQG",
+                "HAVE_ECDSA_SIG_GET0",
+                "HAVE_RSA_SET0_KEY",
                 "HAVE_PKCS11",
                  "HAVE_PKCS11_ECDSA",
                  "HAVE_PKCS11_ED25519",
@@ -1138,6 +1142,11 @@ if ($vcredist_path eq " --infer-- ") {
                                            "redist", "1033"));
     }
 
+    # 'VCToolsRedistDir' is available since Visual Studio 2017.
+    if ($ENV{"VCToolsRedistDir"}) {
+        push(@vcpaths, $ENV{"VCToolsRedistDir"});
+    }
+
     my $rfile;
     if ($want_win32 eq "yes") {
         $rfile = "vcredist_x86.exe";
@@ -1594,6 +1603,41 @@ EOF
     }
 }
 
+# check OpenSSL built-in support for DH/DSA/ECDSA/RSA functions
+if ($use_openssl eq "yes") {
+    if ($verbose) {
+        printf "checking OpenSSL built-in support for DH/DSA/ECDSA/RSA functions\n";
+    }
+    open F, ">testosslfunc.c" || die $!;
+    print F << 'EOF';
+#include <stdio.h>
+#include <openssl/opensslv.h>
+
+int main() {
+        if (OPENSSL_VERSION_NUMBER >= 0x10100000L) {
+                return (0);
+        }
+        printf("\n\nFound   OPENSSL_VERSION_NUMBER %#010x\n",
+               OPENSSL_VERSION_NUMBER);
+        printf("This version has no built-in support for DH/DSA/ECDSA/RSA functions.\n\n");
+        return (1);
+}
+EOF
+    close F;
+    my $include = $configinc{"OPENSSL_INC"};
+    my $library = $configlib{"OPENSSL_LIB"};
+    $compret = `cl /nologo /MD /I "$include" testosslfunc.c "$library"`;
+    if (grep { -f and -x } ".\\testosslfunc.exe") {
+        `.\\testosslfunc.exe`;
+        if ($? == 0) {
+            $configdefh{"HAVE_DH_GET0_KEY"} = 1;
+            $configdefh{"HAVE_DSA_GET0_PQG"} = 1;
+            $configdefh{"HAVE_ECDSA_SIG_GET0"} = 1;
+            $configdefh{"HAVE_RSA_SET0_KEY"} = 1;
+        }
+    }
+}
+
 # check FIPS_mode
 
 if ($use_openssl eq "yes") {