summaryrefslogtreecommitdiffstats
path: root/package/python-netifaces/python-netifaces-fix-cross-build.patch
blob: 5a11b6195176bb4e7150897bc9979c0b6391b5b2 (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
fix cross-compilation issues:

- don't execute cross-compiled binaries
- pass LDFLAGS to linker

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 setup.py |   19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

Index: b/setup.py
===================================================================
--- a/setup.py
+++ b/setup.py
@@ -67,17 +67,8 @@
                                                   libraries=libraries,
                                                   debug=self.debug)
                     if execute:
-                        abspath = os.path.abspath(os.path.join(self.build_temp,
-                                                               'conftest'))
-                        pipe = os.popen(abspath, 'r')
-                        result = pipe.read().strip()
-                        status = pipe.close()
-                        if status is None:
-                            status = 0
-                        if result == '':
-                            result = True
-                        if status != 0:
-                            result = False
+                        # cross-compiled code can't be executed
+                        result = True
                         
             finally:
                 os.dup2(mystdout, 1)
@@ -89,6 +80,10 @@
         return result
 
     def check_requirements(self):
+        # get library dirs
+	if os.environ.has_key('LDFLAGS'):
+	    lib_dirs = os.environ['LDFLAGS']
+
         # Load the cached config data from a previous run if possible; compiling
         # things to test for features is slow
         cache_file = os.path.join(self.build_temp, 'config.cache')
@@ -356,7 +351,7 @@
                                                    in optional_headers]),
                             'sockaddr': sockaddr }
 
-                    if self.test_build(testrig, execute=False):
+                    if self.test_build(testrig, execute=False, library_dirs = [lib_dirs]):
                         result.append(sockaddr)
                 
             if result: