From db6ca2190e3e95ccd28b99e2b981cc8f16ccd628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Mon, 10 Jan 2022 22:53:55 +0100 Subject: [PATCH] Drop Qt4 related parts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit 5f4dfdf2edfa23715cdf3d4e11010be57307a95c) --- siputils.py | 207 ++++------------------------------------------------ 1 file changed, 15 insertions(+), 192 deletions(-) diff --git a/siputils.py b/siputils.py index 71d9f83..a64ee3e 100644 --- a/siputils.py +++ b/siputils.py @@ -233,14 +233,6 @@ class Makefile: if not hasattr(configuration, "qt_version"): error("The target uses Qt but pyqtconfig has not been imported.") - # For Qt v4 interpret Qt support as meaning link against the core - # and GUI libraries (which corresponds to the default qmake - # configuration). Also allow a list of Qt v4 modules to be - # specified. - if configuration.qt_version >= 0x040000: - if type(qt) != list: - qt = ["QtCore", "QtGui"] - self._threaded = configuration.qt_threaded else: self._threaded = threaded @@ -396,8 +388,7 @@ class Makefile: lflags.lextend(mac_lflags) # Don't use a unique list as libraries may need to be searched more - # than once. Also MacOS/X uses the form "-framework lib" so we don't - # want to lose the multiple "-framework". + # than once. libs = [] for l in self.extra_libs: @@ -538,36 +529,7 @@ class Makefile: if not self._debug: defines.append("QT_NO_DEBUG") - if self.config.qt_version >= 0x040000: - for mod in self._qt: - # Note that qmake doesn't define anything for QtHelp. - if mod == "QtCore": - defines.append("QT_CORE_LIB") - elif mod == "QtGui": - defines.append("QT_GUI_LIB") - elif mod == "QtMultimedia": - defines.append("QT_MULTIMEDIA_LIB") - elif mod == "QtNetwork": - defines.append("QT_NETWORK_LIB") - elif mod == "QtOpenGL": - defines.append("QT_OPENGL_LIB") - elif mod == "QtScript": - defines.append("QT_SCRIPT_LIB") - elif mod == "QtScriptTools": - defines.append("QT_SCRIPTTOOLS_LIB") - elif mod == "QtSql": - defines.append("QT_SQL_LIB") - elif mod == "QtTest": - defines.append("QT_TEST_LIB") - elif mod == "QtWebKit": - defines.append("QT_WEBKIT_LIB") - elif mod == "QtXml": - defines.append("QT_XML_LIB") - elif mod == "QtXmlPatterns": - defines.append("QT_XMLPATTERNS_LIB") - elif mod == "phonon": - defines.append("QT_PHONON_LIB") - elif self._threaded: + if self._threaded: defines.append("QT_THREAD_SUPPORT") # Handle library directories. @@ -575,95 +537,17 @@ class Makefile: libdir.extend(libdir_qt) rpaths.extend(libdir_qt) - if self.config.qt_version >= 0x040000: - # For Windows: the macros that define the dependencies on - # Windows libraries. - wdepmap = { - "QtCore": "LIBS_CORE", - "QtGui": "LIBS_GUI", - "QtNetwork": "LIBS_NETWORK", - "QtOpenGL": "LIBS_OPENGL", - "QtWebKit": "LIBS_WEBKIT" - } - - # For Windows: the dependencies between Qt libraries. - qdepmap = { - "QtAssistant": ("QtNetwork", "QtGui", "QtCore"), - "QtGui": ("QtCore", ), - "QtHelp": ("QtSql", "QtGui", "QtCore"), - "QtMultimedia": ("QtGui", "QtCore"), - "QtNetwork": ("QtCore", ), - "QtOpenGL": ("QtGui", "QtCore"), - "QtScript": ("QtCore", ), - "QtScriptTools": ("QtScript", "QtGui", "QtCore"), - "QtSql": ("QtCore", ), - "QtSvg": ("QtXml", "QtGui", "QtCore"), - "QtTest": ("QtGui", "QtCore"), - "QtWebKit": ("QtNetwork", "QtGui", "QtCore"), - "QtXml": ("QtCore", ), - "QtXmlPatterns": ("QtNetwork", "QtCore"), - "phonon": ("QtGui", "QtCore"), - "QtDesigner": ("QtGui", "QtCore"), - "QAxContainer": ("QtGui", "QtCore") - } - - # The QtSql .prl file doesn't include QtGui as a dependency (at - # least on Linux) so we explcitly set the dependency here for - # everything. - if "QtSql" in self._qt: - if "QtGui" not in self._qt: - self._qt.append("QtGui") - - # With Qt v4.2.0, the QtAssistantClient library is now a shared - # library on UNIX. The QtAssistantClient .prl file doesn't - # include QtGui and QtNetwork as a dependency any longer. This - # seems to be a bug in Qt v4.2.0. We explicitly set the - # dependencies here. - if self.config.qt_version >= 0x040200 and "QtAssistant" in self._qt: - if "QtGui" not in self._qt: - self._qt.append("QtGui") - if "QtNetwork" not in self._qt: - self._qt.append("QtNetwork") - - for mod in self._qt: - lib = self._qt4_module_to_lib(mod) - libs.append(self.platform_lib(lib, self._is_framework(mod))) - - if sys.platform == "win32": - # On Windows the dependent libraries seem to be in - # qmake.conf rather than the .prl file and the - # inter-dependencies between Qt libraries don't seem to - # be anywhere. - deps = _UniqueList() - - if mod in list(wdepmap.keys()): - deps.extend(self.optional_list(wdepmap[mod])) - - if mod in list(qdepmap.keys()): - for qdep in qdepmap[mod]: - # Ignore the dependency if it is explicitly - # linked. - if qdep not in self._qt: - libs.append(self.platform_lib(self._qt4_module_to_lib(qdep))) - - if qdep in list(wdepmap.keys()): - deps.extend(self.optional_list(wdepmap[qdep])) - - libs.extend(deps.as_list()) - else: - libs.extend(self._dependent_libs(lib, self._is_framework(mod))) - else: - # Windows needs the version number appended if Qt is a DLL. - qt_lib = self.config.qt_lib + # Windows needs the version number appended if Qt is a DLL. + qt_lib = self.config.qt_lib - if self.generator in ("MSVC", "MSVC.NET", "BMAKE") and win_shared: - qt_lib = qt_lib + version_to_string(self.config.qt_version).replace(".", "") + if self.generator in ("MSVC", "MSVC.NET", "BMAKE") and win_shared: + qt_lib = qt_lib + version_to_string(self.config.qt_version).replace(".", "") - if self.config.qt_edition == "non-commercial": - qt_lib = qt_lib + "nc" + if self.config.qt_edition == "non-commercial": + qt_lib = qt_lib + "nc" - libs.append(self.platform_lib(qt_lib, self.config.qt_framework)) - libs.extend(self._dependent_libs(self.config.qt_lib)) + libs.append(self.platform_lib(qt_lib)) + libs.extend(self._dependent_libs(self.config.qt_lib)) # Handle header directories. try: @@ -681,18 +565,6 @@ class Makefile: qtincdir = self.optional_list("INCDIR_QT") if qtincdir: - if self.config.qt_version >= 0x040000: - for mod in self._qt: - if mod == "QAxContainer": - incdir.append(os.path.join(qtincdir[0], "ActiveQt")) - elif self._is_framework(mod): - if mod == "QtAssistant" and self.config.qt_version < 0x040202: - mod = "QtAssistantClient" - - incdir.append(os.path.join(libdir_qt[0], mod + ".framework", "Headers")) - else: - incdir.append(os.path.join(qtincdir[0], mod)) - # This must go after the module include directories. incdir.extend(qtincdir) @@ -703,10 +575,9 @@ class Makefile: libs.extend(self.optional_list("LIBS_OPENGL")) if self._qt or self._opengl: - if self.config.qt_version < 0x040000 or self._opengl or "QtGui" in self._qt: - incdir.extend(self.optional_list("INCDIR_X11")) - libdir.extend(self.optional_list("LIBDIR_X11")) - libs.extend(self.optional_list("LIBS_X11")) + incdir.extend(self.optional_list("INCDIR_X11")) + libdir.extend(self.optional_list("LIBDIR_X11")) + libs.extend(self.optional_list("LIBS_X11")) if self._threaded: libs.extend(self.optional_list("LIBS_THREAD")) @@ -742,40 +613,6 @@ class Makefile: self.LFLAGS.append("/MANIFEST") self.LFLAGS.append("/MANIFESTFILE:%s.manifest" % target) - def _is_framework(self, mod): - """Return true if the given Qt module is a framework. - """ - return (self.config.qt_framework and (self.config.qt_version >= 0x040200 or mod != "QtAssistant")) - - def _qt4_module_to_lib(self, mname): - """Return the name of the Qt4 library corresponding to a module. - - mname is the name of the module. - """ - if mname == "QtAssistant": - if self.config.qt_version >= 0x040202 and sys.platform == "darwin": - lib = mname - else: - lib = "QtAssistantClient" - else: - lib = mname - - if self._debug: - if sys.platform == "win32": - lib = lib + "d" - elif self.config.qt_version < 0x040200 or sys.platform == "darwin": - lib = lib + "_debug" - - if sys.platform == "win32" and "shared" in self.config.qt_winconfig.split(): - if (mname in ("QtCore", "QtDesigner", "QtGui", "QtHelp", - "QtMultimedia", "QtNetwork", "QtOpenGL", "QtScript", - "QtScriptTools", "QtSql", "QtSvg", "QtTest", - "QtWebKit", "QtXml", "QtXmlPatterns", "phonon") or - (self.config.qt_version >= 0x040200 and mname == "QtAssistant")): - lib = lib + "4" - - return lib - def optional_list(self, name): """Return an optional Makefile macro as a list. @@ -822,34 +659,28 @@ class Makefile: return flags - def platform_lib(self, clib, framework=0): + def platform_lib(self, clib): """Return a library name in platform specific form. clib is the library name in cannonical form. - framework is set of the library is implemented as a MacOS framework. """ if self.generator in ("MSVC", "MSVC.NET", "BMAKE"): plib = clib + ".lib" - elif sys.platform == "darwin" and framework: - plib = "-framework " + clib else: plib = "-l" + clib return plib - def _dependent_libs(self, clib, framework=0): + def _dependent_libs(self, clib): """Return a list of additional libraries (in platform specific form) that must be linked with a library. clib is the library name in cannonical form. - framework is set of the library is implemented as a MacOS framework. """ prl_libs = [] if self.generator in ("MSVC", "MSVC.NET", "BMAKE"): prl_name = os.path.join(self.config.qt_lib_dir, clib + ".prl") - elif sys.platform == "darwin" and framework: - prl_name = os.path.join(self.config.qt_lib_dir, clib + ".framework", clib + ".prl") else: prl_name = os.path.join(self.config.qt_lib_dir, "lib" + clib + ".prl") @@ -1043,11 +874,6 @@ class Makefile: libdir_prefix = "-L" for ld in self.optional_list("LIBDIR"): - if sys.platform == "darwin" and self.config.qt_framework: - fflag = "-F" + _quote(ld) - libs.append(fflag) - cppflags.append(fflag) - libs.append(libdir_prefix + _quote(ld)) libs.extend(self.optional_list("LIBS")) @@ -1749,9 +1575,6 @@ class ProgramMakefile(Makefile): libdir_prefix = "-L" for ld in self.optional_list("LIBDIR"): - if sys.platform == "darwin" and self.config.qt_framework: - build.append("-F" + _quote(ld)) - build.append(libdir_prefix + _quote(ld)) lflags = self.optional_list("LFLAGS")