[Python-checkins] cpython (merge 3.4 -> default): Issue #17095: Fix Modules/Setup *shared* support.
ned.deily
python-checkins at python.org
Mon Jun 2 10:16:36 CEST 2014
http://hg.python.org/cpython/rev/227ce85bdbe0
changeset: 90961:227ce85bdbe0
parent: 90959:ca2539818a6a
parent: 90960:6c468df214dc
user: Ned Deily <nad at acm.org>
date: Mon Jun 02 01:15:32 2014 -0700
summary:
Issue #17095: Fix Modules/Setup *shared* support.
Original patch by Thomas Wouters.
files:
Misc/NEWS | 2 ++
Modules/getpath.c | 14 ++++++++++++++
Modules/makesetup | 8 ++------
3 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -498,6 +498,8 @@
- Issue #15968: Incorporated Tcl, Tk, and Tix builds into the Windows build
solution.
+- Issue #17095: Fix Modules/Setup *shared* support.
+
C API
-----
- Issue #20942: PyImport_ImportFrozenModuleObject() no longer sets __file__ to
diff --git a/Modules/getpath.c b/Modules/getpath.c
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -734,6 +734,11 @@
bufsz += wcslen(zip_path) + 1;
bufsz += wcslen(exec_prefix) + 1;
+ /* When running from the build directory, add room for the Modules
+ * subdirectory too.
+ */
+ if (efound == -1)
+ bufsz += wcslen(argv0_path) + wcslen(L"Modules") + 2;
buf = (wchar_t *)PyMem_Malloc(bufsz * sizeof(wchar_t));
if (buf == NULL) {
@@ -781,6 +786,15 @@
/* Finally, on goes the directory for dynamic-load modules */
wcscat(buf, exec_prefix);
+ /* And, if we run from a build directory, the Modules directory (for
+ * modules built with Modules/Setup.)
+ */
+ if (efound == -1) {
+ wcscat(buf, delimiter);
+ wcscat(buf, argv0_path);
+ wcscat(buf, separator);
+ wcscat(buf, L"Modules");
+ }
/* And publish the results */
module_search_path = buf;
diff --git a/Modules/makesetup b/Modules/makesetup
--- a/Modules/makesetup
+++ b/Modules/makesetup
@@ -217,7 +217,7 @@
*) src='$(srcdir)/'"$srcdir/$src";;
esac
case $doconfig in
- no) cc="$cc \$(CCSHARED) \$(CFLAGS) \$(CPPFLAGS)";;
+ no) cc="$cc \$(CCSHARED) \$(PY_CFLAGS) \$(PY_CPPFLAGS)";;
*)
cc="$cc \$(PY_CORE_CFLAGS)";;
esac
@@ -229,11 +229,7 @@
esac
for mod in $mods
do
- case $objs in
- *$mod.o*) base=$mod;;
- *) base=${mod}module;;
- esac
- file="$srcdir/$base\$(SO)"
+ file="$srcdir/$mod\$(EXT_SUFFIX)"
case $doconfig in
no) SHAREDMODS="$SHAREDMODS $file";;
esac
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list