diff --git a/Lib/distutils/tests/support.py b/Lib/distutils/tests/support.py index 71ad4f42b2c..7385c6bbf67 100644 --- a/Lib/distutils/tests/support.py +++ b/Lib/distutils/tests/support.py @@ -207,4 +207,4 @@ def fixup_build_ext(cmd): cmd.library_dirs = [] else: name, equals, value = runshared.partition('=') - cmd.library_dirs = value.split(os.pathsep) + cmd.library_dirs = [d for d in value.split(os.pathsep) if d] diff --git a/Misc/NEWS b/Misc/NEWS index d9897f132d7..9e9f2c23f68 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -403,6 +403,8 @@ Documentation Tests ----- +- Issue #17752: Fix distutils tests when run from the installed location. + - Issue #18604: Consolidated checks for GUI availability. All platforms now at least check whether Tk can be instantiated when the GUI resource is requested. diff --git a/configure b/configure index a22e78ff223..c46fc267beb 100755 --- a/configure +++ b/configure @@ -5606,7 +5606,7 @@ $as_echo_n "checking LDLIBRARY... " >&6; } if test "$enable_framework" then LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' - RUNSHARED=DYLD_FRAMEWORK_PATH="`pwd`:$DYLD_FRAMEWORK_PATH" + RUNSHARED=DYLD_FRAMEWORK_PATH=`pwd`${DYLD_FRAMEWORK_PATH:+:${DYLD_FRAMEWORK_PATH}} BLDLIBRARY='' else BLDLIBRARY='$(LDLIBRARY)' @@ -5626,7 +5626,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h SunOS*) LDLIBRARY='libpython$(LDVERSION).so' BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} + RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} INSTSONAME="$LDLIBRARY".$SOVERSION if test "$with_pydebug" != yes then @@ -5636,7 +5636,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) LDLIBRARY='libpython$(LDVERSION).so' BLDLIBRARY='-L. -lpython$(LDVERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} + RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} case $ac_sys_system in FreeBSD*) SOVERSION=`echo $SOVERSION|cut -d "." -f 1` @@ -5658,16 +5658,16 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h ;; esac BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(LDVERSION)' - RUNSHARED=SHLIB_PATH=`pwd`:${SHLIB_PATH} + RUNSHARED=SHLIB_PATH=`pwd`${SHLIB_PATH:+:${SHLIB_PATH}} ;; Darwin*) LDLIBRARY='libpython$(LDVERSION).dylib' BLDLIBRARY='-L. -lpython$(LDVERSION)' - RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + RUNSHARED=DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}} ;; AIX*) LDLIBRARY='libpython$(LDVERSION).so' - RUNSHARED=LIBPATH=`pwd`:${LIBPATH} + RUNSHARED=LIBPATH=`pwd`${LIBPATH:+:${LIBPATH}} ;; esac diff --git a/configure.ac b/configure.ac index b470ce42baa..b2f519f5fa7 100644 --- a/configure.ac +++ b/configure.ac @@ -928,7 +928,7 @@ AC_MSG_CHECKING(LDLIBRARY) if test "$enable_framework" then LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' - RUNSHARED=DYLD_FRAMEWORK_PATH="`pwd`:$DYLD_FRAMEWORK_PATH" + RUNSHARED=DYLD_FRAMEWORK_PATH=`pwd`${DYLD_FRAMEWORK_PATH:+:${DYLD_FRAMEWORK_PATH}} BLDLIBRARY='' else BLDLIBRARY='$(LDLIBRARY)' @@ -946,7 +946,7 @@ if test $enable_shared = "yes"; then SunOS*) LDLIBRARY='libpython$(LDVERSION).so' BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} + RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} INSTSONAME="$LDLIBRARY".$SOVERSION if test "$with_pydebug" != yes then @@ -956,7 +956,7 @@ if test $enable_shared = "yes"; then Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) LDLIBRARY='libpython$(LDVERSION).so' BLDLIBRARY='-L. -lpython$(LDVERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} + RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} case $ac_sys_system in FreeBSD*) SOVERSION=`echo $SOVERSION|cut -d "." -f 1` @@ -978,16 +978,16 @@ if test $enable_shared = "yes"; then ;; esac BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(LDVERSION)' - RUNSHARED=SHLIB_PATH=`pwd`:${SHLIB_PATH} + RUNSHARED=SHLIB_PATH=`pwd`${SHLIB_PATH:+:${SHLIB_PATH}} ;; Darwin*) LDLIBRARY='libpython$(LDVERSION).dylib' BLDLIBRARY='-L. -lpython$(LDVERSION)' - RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}' + RUNSHARED=DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}} ;; AIX*) LDLIBRARY='libpython$(LDVERSION).so' - RUNSHARED=LIBPATH=`pwd`:${LIBPATH} + RUNSHARED=LIBPATH=`pwd`${LIBPATH:+:${LIBPATH}} ;; esac