summaryrefslogtreecommitdiff
path: root/security/py-cryptopp/patches/patch-setup.py
blob: 7f71154a4c9da2c407e24ab9747b201d8978ca7d (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
$NetBSD: patch-setup.py,v 1.1 2012/12/24 21:15:33 joerg Exp $

--- setup.py.orig	2012-12-23 21:32:49.000000000 +0000
+++ setup.py
@@ -77,6 +77,21 @@ if DEBUG:
 else:
     extra_compile_args.append("-w")
 
+# XXX Use distutils
+if "CC" in os.environ:
+    try:
+        sp = subprocess.Popen([os.environ['CC'], '--version'],
+                              stdin=subprocess.PIPE,
+                              stdout=subprocess.PIPE,
+                              stderr=subprocess.PIPE,
+                              universal_newlines=True)
+        sp.stdin.close()
+        sp.wait()
+        if re.search("clang version", sp.stdout.read()):
+            extra_compile_args.append("-no-integrated-as")
+    except:
+        pass
+
 if DISABLE_EMBEDDED_CRYPTOPP:
     define_macros.append(('DISABLE_EMBEDDED_CRYPTOPP', 1))