121 lines
5.5 KiB
Diff
121 lines
5.5 KiB
Diff
--- configure-ng.py.orig 2014-07-03 15:03:00.000000000 +0200
|
|
+++ configure-ng.py 2014-07-29 13:36:14.339000000 +0200
|
|
@@ -30,6 +30,7 @@
|
|
import shutil
|
|
import stat
|
|
import sys
|
|
+from sysconfig import _POSIX_BUILD
|
|
|
|
try:
|
|
import sysconfig
|
|
@@ -369,7 +370,7 @@
|
|
self.inc_dir = sysconfig.get_python_inc(plat_specific=1)
|
|
self.module_dir = sysconfig.get_python_lib(plat_specific=1)
|
|
|
|
- if sys.platform == 'win32':
|
|
+ if sys.platform == 'win32' and not _POSIX_BUILD:
|
|
self.bin_dir = sys.exec_prefix
|
|
self.data_dir = sys.prefix
|
|
self.lib_dir = sys.prefix + '\\libs'
|
|
@@ -378,6 +379,13 @@
|
|
self.data_dir = sys.prefix + '/share'
|
|
self.lib_dir = sys.prefix + '/lib'
|
|
|
|
+ if _POSIX_BUILD and "MSYSTEM" in os.environ:
|
|
+ self.inc_dir = os.popen(' '.join(['cygpath', '--unix', self.inc_dir])).readline().strip()
|
|
+ self.module_dir = os.popen(' '.join(['cygpath', '--unix', self.module_dir])).readline().strip()
|
|
+ self.bin_dir = os.popen(' '.join(['cygpath', '--unix', self.bin_dir])).readline().strip()
|
|
+ self.data_dir = os.popen(' '.join(['cygpath', '--unix', self.data_dir])).readline().strip()
|
|
+ self.lib_dir = os.popen(' '.join(['cygpath', '--unix', self.lib_dir])).readline().strip()
|
|
+
|
|
# The name of the interpreter used by the pyuic4 wrapper.
|
|
if sys.platform == 'darwin':
|
|
# The installation of MacOS's python is a mess that changes from
|
|
@@ -448,7 +456,9 @@
|
|
|
|
# The qmake spec we want to use.
|
|
if self.py_platform == 'win32':
|
|
- if self.py_version >= 0x030300:
|
|
+ if _POSIX_BUILD:
|
|
+ self.qmake_spec = "win32-g++"
|
|
+ elif self.py_version >= 0x030300:
|
|
self.qmake_spec = 'win32-msvc2010'
|
|
elif self.py_version >= 0x020600:
|
|
self.qmake_spec = 'win32-msvc2008'
|
|
@@ -672,7 +682,10 @@
|
|
|
|
# Create the output file, first making sure it doesn't exist.
|
|
remove_file(out_file)
|
|
- run_command(cmd, verbose)
|
|
+ if "MSYSTEM" in os.environ:
|
|
+ run_command("sh -c "+cmd, verbose)
|
|
+ else:
|
|
+ run_command(cmd, verbose)
|
|
|
|
if not os.access(out_file, os.F_OK):
|
|
error("%s failed to create %s. Make sure your Qt installation is correct." % (cmd, out_file))
|
|
@@ -690,7 +703,7 @@
|
|
py_major = self.py_version >> 16
|
|
py_minor = (self.py_version >> 8) & 0x0ff
|
|
|
|
- if sys.platform == 'win32':
|
|
+ if sys.platform == 'win32' and not _POSIX_BUILD:
|
|
debug_suffix = get_win32_debug_suffix(debug)
|
|
pylib_lib = 'python%d%d%s' % (py_major, py_minor, debug_suffix)
|
|
|
|
@@ -783,6 +796,8 @@
|
|
"correct version of qmake." % qt_version_str)
|
|
|
|
self.designer_plugin_dir = qt_config.QT_INSTALL_PLUGINS + '/designer'
|
|
+ if "MSYSTEM" in os.environ:
|
|
+ self.designer_plugin_dir = os.popen(' '.join(['cygpath', '--unix', self.designer_plugin_dir])).readline().strip()
|
|
|
|
if self.sysroot == '':
|
|
self.sysroot = getattr(qt_config, 'QT_SYSROOT', '')
|
|
@@ -791,6 +806,8 @@
|
|
# in the default location.
|
|
self.qsci_api_dir = os.path.join(qt_config.QT_INSTALL_DATA, 'qsci')
|
|
self.qsci_api = os.path.isdir(self.qsci_api_dir)
|
|
+ if "MSYSTEM" in os.environ:
|
|
+ self.qsci_api_dir = os.popen(' '.join(['cygpath', '--unix', self.qsci_api_dir])).readline().strip()
|
|
|
|
# Save the default qmake spec. and finalise the value we want to use.
|
|
self.default_qmake_spec = getattr(qt_config, 'QMAKE_SPEC', '')
|
|
@@ -950,6 +967,15 @@
|
|
if opts.vendlibdir is not None:
|
|
self.vend_lib_dir = opts.vendlibdir
|
|
|
|
+ if _POSIX_BUILD and "MSYSTEM" in os.environ:
|
|
+ self.pyqt_bin_dir = os.popen(' '.join(['cygpath', '--unix', self.pyqt_bin_dir])).readline().strip()
|
|
+ self.designer_plugin_dir = os.popen(' '.join(['cygpath', '--unix', self.designer_plugin_dir])).readline().strip()
|
|
+ self.pyqt_module_dir = os.popen(' '.join(['cygpath', '--unix', self.pyqt_module_dir])).readline().strip()
|
|
+ self.qsci_api_dir = os.popen(' '.join(['cygpath', '--unix', self.qsci_api_dir])).readline().strip()
|
|
+ self.pyqt_sip_dir = os.popen(' '.join(['cygpath', '--unix', self.pyqt_sip_dir])).readline().strip()
|
|
+ self.vend_inc_dir = os.popen(' '.join(['cygpath', '--unix', self.vend_inc_dir])).readline().strip()
|
|
+ self.vend_lib_dir = os.popen(' '.join(['cygpath', '--unix', self.vend_lib_dir])).readline().strip()
|
|
+
|
|
# Handle any conflicts.
|
|
if self.qt_shared:
|
|
if len(self.static_plugins) != 0:
|
|
@@ -1116,7 +1142,7 @@
|
|
"wrapper is FILE [default: %s]" %
|
|
target_config.pyuic_interpreter)
|
|
|
|
- if sys.platform != 'win32':
|
|
+ if sys.platform != 'win32' or _POSIX_BUILD:
|
|
g.add_option("--qmake", "-q", dest='qmake', type='string',
|
|
default=None, action='callback', callback=store_abspath_exe,
|
|
metavar="FILE",
|
|
@@ -2634,7 +2660,10 @@
|
|
py_major, py_minor = get_py_major_minor(target_config)
|
|
debug_suffix = get_win32_debug_suffix(target_config.debug)
|
|
|
|
- return '%s -lpython%d%d%s' % (lib_dir, py_major, py_minor, debug_suffix)
|
|
+ if _POSIX_BUILD:
|
|
+ return '%s -lpython%d.%d%s' % (lib_dir, py_major, py_minor, debug_suffix)
|
|
+ else:
|
|
+ return '%s -lpython%d%d%s' % (lib_dir, py_major, py_minor, debug_suffix)
|
|
|
|
|
|
def get_win32_debug_suffix(debug):
|