aboutsummaryrefslogtreecommitdiff
path: root/ports/botan/0001-fix-crt-linking.patch
blob: d1fdc2d709b7c26e147ab5b3fe7e02310d538b58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From b41cc93b63c99525e71291424466cdd45d92f770 Mon Sep 17 00:00:00 2001
From: Mikhail Paulyshka <me@mixaill.tk>
Date: Sun, 12 Mar 2017 04:34:10 +0300
Subject: [PATCH] fix CRT linking for static library for MSVC

---
 configure.py               | 15 +++++++++++++++
 src/build-data/cc/msvc.txt |  8 ++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/configure.py b/configure.py
index faf5120c5..9c545cf5f 100755
--- a/configure.py
+++ b/configure.py
@@ -976,6 +976,21 @@ class CompilerInfo(object):
             if flag != None and flag != '' and flag not in abi_link:
                 abi_link.append(flag)
 
+        if options.build_shared_lib:
+            if options.with_debug_info:
+                if 'dynamic-debug' in self.mach_abi_linking:
+                    abi_link.append(self.mach_abi_linking['dynamic-debug'])
+            else:
+                if 'dynamic' in self.mach_abi_linking:
+                    abi_link.append(self.mach_abi_linking['dynamic'])
+        else:
+            if options.with_debug_info:
+                if 'static-debug' in self.mach_abi_linking:
+                    abi_link.append(self.mach_abi_linking['static-debug'])
+            else:
+                if 'static' in self.mach_abi_linking:
+                    abi_link.append(self.mach_abi_linking['static'])
+
         if options.with_coverage_info:
             if self.coverage_flags == '':
                 raise ConfigureError('No coverage handling for %s' % (self.basename))
diff --git a/src/build-data/cc/msvc.txt b/src/build-data/cc/msvc.txt
index c1b820b91..e6182b0fa 100644
--- a/src/build-data/cc/msvc.txt
+++ b/src/build-data/cc/msvc.txt
@@ -53,6 +53,10 @@ default-debug -> "$(LINKER) /DEBUG"
 </binary_link_commands>
 
 <mach_abi_linking>
-all       -> "/MD /bigobj"
-all-debug -> "/MDd /bigobj"
+all           -> "/bigobj"
+all-debug     -> "/bigobj"
+static        -> "/MT"
+static-debug  -> "/MTd"
+dynamic       -> "/MD"
+dynamic-debug -> "/MDd"
 </mach_abi_linking>
-- 
2.11.0.windows.1