summaryrefslogtreecommitdiff
path: root/math/py-rpy/patches/patch-aa
blob: dc17299deb848f56e0642c28e184521789e3b3ff (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
$NetBSD: patch-aa,v 1.7 2011/12/18 21:32:08 dholland Exp $

- configure compiler for pkgsrc
- allow BLAS_LIBS to be empty
- handle extra_link_args correctly
- accept pkgsrc-reported link args

--- setup.py.orig	2010-05-16 12:23:30.000000000 +0000
+++ setup.py
@@ -1,5 +1,12 @@
 
 import os, os.path, sys, shutil, re, itertools
+import distutils.sysconfig
+old_customize_compiler = distutils.sysconfig.customize_compiler
+def customize_compiler(compiler):
+    old_customize_compiler(compiler)
+    compiler.set_executables(linker_so=os.environ['FC'] + ' -shared')
+distutils.sysconfig.customize_compiler = customize_compiler
+
 from distutils.command.build_ext import build_ext as _build_ext
 from distutils.command.build import build as _build
 
@@ -130,10 +137,10 @@ class build_ext(_build_ext):
         extra_link_args = get_rconfig(r_home, '--ldflags') +\
             get_rconfig(r_home, 'LAPACK_LIBS', 
                         allow_empty=True) +\
-                        get_rconfig(r_home, 'BLAS_LIBS')
+                        get_rconfig(r_home, 'BLAS_LIBS', allow_empty=True)
 
         for e in self.extensions:
-            e.extra_compile_args.extend(extra_link_args)
+            e.extra_link_args.extend(extra_link_args)
 
     def run(self):
         _build_ext.run(self)
@@ -180,6 +187,7 @@ def get_rconfig(r_home, about, allow_emp
     #sanity check of what is returned into rconfig
     rconfig_m = None
     possible_patterns = ('^(-L.+) (-l.+)$',
+                         '^(-Wl,-R.+) (-L.+) (-l.+)$',
                          '^(-l.+)$',  # fix for the case -lblas is returned
                          '^(-F.+? -framework .+)$', # fix for MacOS X
                          '^(-framework .+)$',