This repository was archived by the owner on Feb 24, 2023. It is now read-only.
forked from rave-engine/python3-android
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathmodules-link-libm.patch
More file actions
68 lines (61 loc) · 2.58 KB
/
modules-link-libm.patch
File metadata and controls
68 lines (61 loc) · 2.58 KB
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
diff -r 6a8fbb97c8d8 setup.py
--- a/setup.py Thu Nov 26 02:36:26 2015 +0000
+++ b/setup.py Thu Nov 26 18:59:29 2015 +0800
@@ -568,10 +568,7 @@
if item.startswith('-L'):
lib_dirs.append(item[2:])
- # Check for MacOS X, which doesn't need libm.a at all
- math_libs = ['m']
- if host_platform == 'darwin':
- math_libs = []
+ math_libs = self.detect_math_libs()
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -620,7 +621,8 @@
# time operations and variables
exts.append( Extension('time', ['timemodule.c'],
libraries=time_libs) )
- exts.append( Extension('_datetime', ['_datetimemodule.c']) )
+ exts.append( Extension('_datetime', ['_datetimemodule.c'],
+ libraries=math_libs) )
# random number generator implemented in C
exts.append( Extension("_random", ["_randommodule.c"]) )
# bisect
@@ -675,7 +672,7 @@
# Operations on audio samples
# According to #993173, this one should actually work fine on
# 64-bit platforms.
- exts.append( Extension('audioop', ['audioop.c']) )
+ exts.append( Extension('audioop', ['audioop.c'], libraries=math_libs) )
# readline
do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
@@ -1940,6 +1937,8 @@
elif host_platform.startswith('hp-ux'):
extra_link_args.append('-fPIC')
+ math_libs = self.detect_math_libs()
+
ext = Extension('_ctypes',
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
@@ -1948,7 +1947,8 @@
sources=sources,
depends=depends)
ext_test = Extension('_ctypes_test',
- sources=['_ctypes/_ctypes_test.c'])
+ sources=['_ctypes/_ctypes_test.c'],
+ libraries=math_libs)
self.extensions.extend([ext, ext_test])
if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):
@@ -2116,6 +2116,14 @@
)
return ext
+ def detect_math_libs(self):
+ # Check for MacOS X, which doesn't need libm.a at all
+ math_libs = ['m']
+ if host_platform == 'darwin':
+ math_libs = []
+ return math_libs
+
+
class PyBuildInstall(install):
# Suppress the warning about installation into the lib_dynload
# directory, which is not in sys.path when running Python during