diff -urN a/build/autoconf/config.status.m4 b/build/autoconf/config.status.m4 --- a/build/autoconf/config.status.m4 2015-07-13 22:34:59.729176500 +0100 +++ b/build/autoconf/config.status.m4 2015-07-13 22:47:20.516343000 +0100 @@ -87,7 +87,6 @@ case "$host_os" in mingw*) WIN_TOP_SRC=`cd $srcdir; pwd -W` - encoding=mbcs ;; esac AC_SUBST(WIN_TOP_SRC) diff -urN a/build/autoconf/python-virtualenv.m4 b/build/autoconf/python-virtualenv.m4 --- a/build/autoconf/python-virtualenv.m4 2015-07-13 22:34:59.729176500 +0100 +++ b/build/autoconf/python-virtualenv.m4 2015-07-13 22:47:20.520343200 +0100 @@ -56,14 +56,7 @@ $_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv \ $_virtualenv_topsrcdir/build/virtualenv_packages.txt || exit 1 - case "$host_os" in - mingw*) - PYTHON=`cd $MOZ_BUILD_ROOT && pwd -W`/_virtualenv/Scripts/python.exe - ;; - *) - PYTHON=$MOZ_BUILD_ROOT/_virtualenv/bin/python - ;; - esac + PYTHON=$MOZ_BUILD_ROOT/_virtualenv/bin/python fi AC_SUBST(PYTHON) diff -urN a/configure b/configure --- a/configure 2015-07-13 22:37:44.550806000 +0100 +++ b/configure 2015-07-13 22:47:20.534344000 +0100 @@ -1367,7 +1367,7 @@ exit 1 break fi -MOZ_BUILD_ROOT=`pwd -W 2>/dev/null || pwd` +MOZ_BUILD_ROOT=`pwd` @@ -1474,14 +1474,7 @@ $_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv \ $_virtualenv_topsrcdir/build/virtualenv_packages.txt || exit 1 - case "$host_os" in - mingw*) - PYTHON=`cd $MOZ_BUILD_ROOT && pwd -W`/_virtualenv/Scripts/python.exe - ;; - *) - PYTHON=$MOZ_BUILD_ROOT/_virtualenv/bin/python - ;; - esac + PYTHON=$MOZ_BUILD_ROOT/_virtualenv/bin/python fi diff -urN a/configure.in b/configure.in --- a/configure.in 2015-07-13 22:36:56.161466600 +0100 +++ b/configure.in 2015-07-13 22:47:20.772353700 +0100 @@ -133,7 +133,7 @@ exit 1 break fi -MOZ_BUILD_ROOT=`pwd -W 2>/dev/null || pwd` +MOZ_BUILD_ROOT=`pwd` MOZ_PYTHON diff -urN a/js/src/configure b/js/src/configure --- a/js/src/configure 2015-07-13 22:38:51.104908900 +0100 +++ b/js/src/configure 2015-07-13 22:47:20.782353700 +0100 @@ -1061,7 +1061,7 @@ exit 1 break fi -MOZ_BUILD_ROOT=`pwd -W 2>/dev/null || pwd` +MOZ_BUILD_ROOT=`pwd` # Check whether --with-dist-dir or --without-dist-dir was given. @@ -4404,14 +4404,7 @@ $_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv \ $_virtualenv_topsrcdir/build/virtualenv_packages.txt || exit 1 - case "$host_os" in - mingw*) - PYTHON=`cd $MOZ_BUILD_ROOT && pwd -W`/_virtualenv/Scripts/python.exe - ;; - *) - PYTHON=$MOZ_BUILD_ROOT/_virtualenv/bin/python - ;; - esac + PYTHON=$MOZ_BUILD_ROOT/_virtualenv/bin/python fi diff -urN a/python/virtualenv/virtualenv.py b/python/virtualenv/virtualenv.py --- a/python/virtualenv/virtualenv.py 2015-07-13 22:35:33.117337000 +0100 +++ b/python/virtualenv/virtualenv.py 2015-07-13 22:47:20.797353800 +0100 @@ -45,6 +45,7 @@ is_pypy = hasattr(sys, 'pypy_version_info') is_win = (sys.platform == 'win32') is_cygwin = (sys.platform == 'cygwin') +is_msys = (sys.platform == 'msys') is_darwin = (sys.platform == 'darwin') abiflags = getattr(sys, 'abiflags', '') @@ -1276,7 +1277,7 @@ executable = sys.executable shutil.copyfile(executable, py_executable) make_exe(py_executable) - if is_win or is_cygwin: + if is_win or is_cygwin or is_msys: pythonw = os.path.join(os.path.dirname(sys.executable), 'pythonw.exe') if os.path.exists(pythonw): logger.info('Also created pythonw.exe') @@ -1290,11 +1291,19 @@ logger.info('Removed python_d.exe as it is no longer at the source') os.unlink(python_d_dest) # we need to copy the DLL to enforce that windows will load the correct one. - # may not exist if we are cygwin. - py_executable_dll = 'python%s%s.dll' % ( - sys.version_info[0], sys.version_info[1]) - py_executable_dll_d = 'python%s%s_d.dll' % ( - sys.version_info[0], sys.version_info[1]) + try: + # Cygwin, msys2 and MSYS2's mingw-w64-{i686,x86-64}-python all support this. + # .. disabled for now on msys2 as there's a dll address overlap issue: + # 0 [main] python 824 child_info_fork::abort: address space needed by 'msys-python2.7.dll' (0x6F0000) is already occupied + import sysconfig + py_executable_dll = 'unused' if is_msys else sysconfig.get_config_var('DLLLIBRARY') + py_executable_dll_d = 'unused' + except: + # .. but CPython doesn't. + py_executable_dll = 'python%s%s.dll' % ( + sys.version_info[0], sys.version_info[1]) + py_executable_dll_d = 'python%s%s_d.dll' % ( + sys.version_info[0], sys.version_info[1]) pythondll = os.path.join(os.path.dirname(sys.executable), py_executable_dll) pythondll_d = os.path.join(os.path.dirname(sys.executable), py_executable_dll_d) pythondll_d_dest = os.path.join(os.path.dirname(py_executable), py_executable_dll_d)