aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/target/python27/Python-setup.patch
blob: da1a59052fafd99ce1a922421c90f5ab08dddaae (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
--- setup.py.orig	2015-10-07 16:32:16.219083585 +0200
+++ setup.py	2015-10-07 16:41:48.563085871 +0200
@@ -337,6 +337,9 @@
             self.announce('WARNING: skipping import check for Cygwin-based "%s"'
                 % ext.name)
             return
+        #if os.environ.get('CROSS_COMPILE_TARGET') == 'yes':
+        #    return
+	
         ext_filename = os.path.join(
             self.build_lib,
             self.get_ext_filename(self.get_ext_fullname(ext.name)))
@@ -351,27 +354,30 @@
         try:
             imp.load_dynamic(ext.name, ext_filename)
         except ImportError, why:
-            self.failed.append(ext.name)
-            self.announce('*** WARNING: renaming "%s" since importing it'
-                          ' failed: %s' % (ext.name, why), level=3)
-            assert not self.inplace
-            basename, tail = os.path.splitext(ext_filename)
-            newname = basename + "_failed" + tail
-            if os.path.exists(newname):
-                os.remove(newname)
-            os.rename(ext_filename, newname)
-
-            # XXX -- This relies on a Vile HACK in
-            # distutils.command.build_ext.build_extension().  The
-            # _built_objects attribute is stored there strictly for
-            # use here.
-            # If there is a failure, _built_objects may not be there,
-            # so catch the AttributeError and move on.
-            try:
-                for filename in self._built_objects:
-                    os.remove(filename)
-            except AttributeError:
-                self.announce('unable to remove files (ignored)')
+            if os.environ.get('CROSS_COMPILE_TARGET') != "yes":
+                self.failed.append(ext.name)
+                self.announce('*** WARNING: renaming "%s" since importing it'
+                              ' failed: %s' % (ext.name, why), level=3)
+                assert not self.inplace
+                basename, tail = os.path.splitext(ext_filename)
+                newname = basename + "_failed" + tail
+                if os.path.exists(newname):
+                    os.remove(newname)
+                os.rename(ext_filename, newname)
+
+                # XXX -- This relies on a Vile HACK in
+                # distutils.command.build_ext.build_extension().  The
+                # _built_objects attribute is stored there strictly for
+                # use here.
+                # If there is a failure, _built_objects may not be there,
+                # so catch the AttributeError and move on.
+                try:
+                    for filename in self._built_objects:
+                        os.remove(filename)
+                except AttributeError:
+                    self.announce('unable to remove files (ignored)')
+            else:
+                self.announce('WARNING: "%s" failed importing, ignored because we are cross-compiling' % ext.name)
         except:
             exc_type, why, tb = sys.exc_info()
             self.announce('*** WARNING: importing extension "%s" '

--- Modules/makesetup.orig	2015-10-08 09:53:38.787333151 +0200
+++ Modules/makesetup	2015-10-08 11:28:50.939355966 +0200
@@ -212,6 +212,7 @@
 			objs="$objs $obj"
 			case $src in
 			glmodule.c) ;;
+                       # _*io.c) src='$(srcdir)/'"$srcdir/_io/$(echo $src| tr -d "_")";;
 			/*) ;;
 			\$*) ;;
 			*) src='$(srcdir)/'"$srcdir/$src";;