]> granicus.if.org Git - python/commitdiff
Issue #17095: Fix Modules/Setup *shared* support.
authorNed Deily <nad@acm.org>
Mon, 2 Jun 2014 08:05:29 +0000 (01:05 -0700)
committerNed Deily <nad@acm.org>
Mon, 2 Jun 2014 08:05:29 +0000 (01:05 -0700)
Original patch by Thomas Wouters.

Misc/NEWS
Modules/getpath.c
Modules/makesetup

index 902d72e12c56a7e6c305fbba05d3f997bb7c3231..c03534b212227051fd00d3f1d8ccccfb8304cd6a 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -58,6 +58,11 @@ Library
 - Issue #21538: The plistlib module now supports loading of binary plist files
   when reference or offset size is not a power of two.
 
+Build
+-----
+
+- Issue #17095: Fix Modules/Setup *shared* support.
+
 Tests
 -----
 
index c057737ec2bbd1d96ef53548211fee15197da2ea..f26b8e9b2b711bb2bfeb2bae8c38686db22bce12 100644 (file)
@@ -734,6 +734,11 @@ calculate_path(void)
 
     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 @@ calculate_path(void)
 
     /* 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;
index 40dfa9db488afea186768a25210c7abfb1c6af38..8b5cc28bba1d2dfadfd3e448c410b018168ef254 100755 (executable)
@@ -217,7 +217,7 @@ sed -e 's/[         ]*#.*//' -e '/^[        ]*$/d' |
                        *) 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 @@ sed -e 's/[        ]*#.*//' -e '/^[        ]*$/d' |
                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