Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-05-02 03:52:56 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-06-27 12:08:27 +0400
commit72ac596e19ddb37636e107635b52ee78888460e7 (patch)
tree5b94775ba0528366a07114c8d47859f485c725e0 /build_files/scons/Modules/FindPython.py
parent0a0e4e0e698eb496c4fb18c79b532104581ce0af (diff)
Update Ceres to latest upstream version
Brings new bounds limiting and also prepares build system for the changes in the upstream. Namely shared_ptr header and namespace is now being detected by a build system rather than by hacks in the code. This commit includes some changes to auto-detection flags in SCons, presumably adding more consistency there. This is main changes which are suppoed to be reviewed here. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D581
Diffstat (limited to 'build_files/scons/Modules/FindPython.py')
-rw-r--r--build_files/scons/Modules/FindPython.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/build_files/scons/Modules/FindPython.py b/build_files/scons/Modules/FindPython.py
new file mode 100644
index 00000000000..a0ead88ebb4
--- /dev/null
+++ b/build_files/scons/Modules/FindPython.py
@@ -0,0 +1,50 @@
+import os
+import platform
+
+def FindPython():
+ all_abi_flags = ['m', 'mu', '']
+
+ python = "/usr"
+ abi_flags = "m" # Most common for linux distros
+ version = "3.4"
+
+ _arch = platform.uname()[4] + "-linux-gnu"
+
+ # Determine ABI flags used on this system
+ include = os.path.join(python, "include")
+ for cur_flags in all_abi_flags:
+ inc = os.path.join(include, "python" + version + cur_flags, "Python.h")
+ if os.path.exists(inc):
+ abi_flags = cur_flags
+ break
+
+ # Find config.h. In some distros, such as ubuntu 12.10 they are not in standard include dir.
+ incconf = os.path.join(include, _arch, "python" + version + cur_flags)
+ if not os.path.exists(os.path.join(incconf, "pyconfig.h")):
+ incconf = ''
+
+ # Determine whether python is in /usr/lib or /usr/lib64
+ lib32 = os.path.join(python, "lib", "python" + version, "sysconfig.py")
+ lib64 = os.path.join(python, "lib64", "python" + version, "sysconfig.py")
+ if os.path.exists(lib32):
+ libpath = "${BF_PYTHON}/lib"
+ elif os.path.exists(lib64):
+ libpath = "${BF_PYTHON}/lib64"
+ else:
+ # roll back to default value
+ libpath = "${BF_PYTHON}/lib"
+
+ libpath_arch = libpath
+ _libpath_arch = os.path.join(python, "lib", _arch) # No lib64 stuff with recent deb-like distro afaik...
+ _libs = ["libpython" + version + abi_flags + ext for ext in (".so", ".a")]
+ for l in _libs:
+ if not os.path.exists(os.path.join(libpath, l)) and os.path.exists(os.path.join(_libpath_arch, l)):
+ libpath_arch = os.path.join(libpath, _arch)
+ break
+
+ return {"PYTHON": python,
+ "VERSION": version,
+ "LIBPATH": libpath,
+ "LIBPATH_ARCH": libpath_arch,
+ "ABI_FLAGS": abi_flags,
+ "CONFIG": incconf}