summaryrefslogtreecommitdiffstats
path: root/configure.py
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-08-01 18:23:10 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-08-01 22:34:55 +0900
commit8ccbd4fc0219267d2d8b00e7191b1d92de834569 (patch)
treefcf9541ad97d54e1060e196ba9ca52258fcc5b45 /configure.py
parentaa6764916ff2706bc094a8858691f9b0a98f395c (diff)
downloadpytqt-8ccbd4fc0219267d2d8b00e7191b1d92de834569.tar.gz
pytqt-8ccbd4fc0219267d2d8b00e7191b1d92de834569.zip
Removed unnecessary code
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'configure.py')
-rw-r--r--configure.py201
1 files changed, 87 insertions, 114 deletions
diff --git a/configure.py b/configure.py
index fe90adf..b600ac3 100644
--- a/configure.py
+++ b/configure.py
@@ -207,14 +207,13 @@ class ConfigurePyTQt3(ConfigureBase):
check_module("tqtxml", "tqdom.h", "TQDomImplementation()")
check_module("tqtgl", "tqgl.h", "TQGLWidget()", opengl=1)
- if tqt_version >= 0x030000:
- check_module("tqtui", "tqwidgetfactory.h", "TQWidgetFactory()", lib="tqui")
+ check_module("tqtui", "tqwidgetfactory.h", "TQWidgetFactory()", lib="tqui")
- if tqt_edition in ("enterprise", "free"):
- check_module("tqtsql", "tqsql.h", "TQSql()")
+ if tqt_edition in ("enterprise", "free"):
+ check_module("tqtsql", "tqsql.h", "TQSql()")
- if sys.platform == "win32" and sipcfg.sip_version >= 0x040200:
- check_module("tqtaxcontainer", "tqaxobject.h", "TQAxObject()", lib="tqaxcontainer")
+ if sys.platform == "win32" and sipcfg.sip_version >= 0x040200:
+ check_module("tqtaxcontainer", "tqaxobject.h", "TQAxObject()", lib="tqaxcontainer")
if tqsci_version:
check_module("tqtext", "tqextscintillabase.h", "TQextScintillaBase()", define=tqsci_define, include_dir=opt_tqsciincdir, lib_dir=opt_tqscilibdir, lib="tqscintilla")
@@ -224,16 +223,15 @@ class ConfigurePyTQt3(ConfigureBase):
tqtmod_lib = None
- if tqt_version >= 0x030100:
- sip_tqt_config.inform("Checking to see if the TQAssistantClient class is available...")
+ sip_tqt_config.inform("Checking to see if the TQAssistantClient class is available...")
- if check_class("tqassistantclient.h", "TQAssistantClient(\"foo\")", lib="tqassistantclient"):
+ if check_class("tqassistantclient.h", "TQAssistantClient(\"foo\")", lib="tqassistantclient"):
+ tqtmod_lib = "tqassistantclient"
+ else:
+ if check_class("ntqassistantclient.h", "TQAssistantClient(\"foo\")", lib="tqassistantclient"):
tqtmod_lib = "tqassistantclient"
else:
- if check_class("ntqassistantclient.h", "TQAssistantClient(\"foo\")", lib="tqassistantclient"):
- tqtmod_lib = "tqassistantclient"
- else:
- disabled_classes.append("TQAssistantClient")
+ disabled_classes.append("TQAssistantClient")
return tqtmod_lib
@@ -290,77 +288,74 @@ class ConfigurePyTQt3(ConfigureBase):
def tools(self):
tool_dirs = []
- if tqt_version >= 0x030000:
- # The Professional Edition needs special handling.
- prof = (tqt_edition == "professional")
+ # The Professional Edition needs special handling.
+ prof = (tqt_edition == "professional")
- sip_tqt_config.inform("Creating pytquic Makefile...")
+ sip_tqt_config.inform("Creating pytquic Makefile...")
- if prof or "tqtxml" not in pytqt_modules:
- buildfile= "pytquic-prof.sbf"
+ if prof or "tqtxml" not in pytqt_modules:
+ buildfile= "pytquic-prof.sbf"
- for xml in ("tqdom.cpp", "tqxml.cpp"):
- shutil.copyfile(tqt_dir + "/src/xml/" + xml, "pytquic3/" + xml)
- else:
- buildfile= "pytquic.sbf"
+ for xml in ("tqdom.cpp", "tqxml.cpp"):
+ shutil.copyfile(tqt_dir + "/src/xml/" + xml, "pytquic3/" + xml)
+ else:
+ buildfile= "pytquic.sbf"
- makefile = sip_tqt_config.ProgramMakefile(
- configuration=sipcfg,
- build_file=os.path.join(src_dir, "pytquic3", buildfile),
- dir="pytquic3",
- install_dir=opt_pytqtbindir,
- console=1,
- tqt=1,
- warnings=1
- )
+ makefile = sip_tqt_config.ProgramMakefile(
+ configuration=sipcfg,
+ build_file=os.path.join(src_dir, "pytquic3", buildfile),
+ dir="pytquic3",
+ install_dir=opt_pytqtbindir,
+ console=1,
+ tqt=1,
+ warnings=1
+ )
- makefile.extra_defines.append("UIC")
- makefile.extra_defines.append("TQT_INTERNAL_XML")
+ makefile.extra_defines.append("UIC")
+ makefile.extra_defines.append("TQT_INTERNAL_XML")
- if prof or "tqtxml" not in pytqt_modules:
- makefile.extra_defines.append("TQT_MODULE_XML")
+ if prof or "tqtxml" not in pytqt_modules:
+ makefile.extra_defines.append("TQT_MODULE_XML")
- if tqt_version < 0x030100:
- makefile.extra_include_dirs.append(tqt_dir + "/src/3rdparty/zlib")
- makefile.extra_include_dirs.append(os.path.join(src_dir, "pytquic3"))
-
- if not os.access("pytquic3", os.F_OK):
- os.mkdir("pytquic3")
+ makefile.extra_include_dirs.append(os.path.join(src_dir, "pytquic3"))
+
+ if not os.access("pytquic3", os.F_OK):
+ os.mkdir("pytquic3")
- makefile.generate()
- tool_dirs.append("pytquic3")
+ makefile.generate()
+ tool_dirs.append("pytquic3")
- sip_tqt_config.inform("Creating pytqlupdate Makefile...")
+ sip_tqt_config.inform("Creating pytqlupdate Makefile...")
- if prof or "tqtxml" not in pytqt_modules:
- buildfile= "pytqlupdate-prof.sbf"
+ if prof or "tqtxml" not in pytqt_modules:
+ buildfile= "pytqlupdate-prof.sbf"
- shutil.copyfile(tqt_dir + "/src/xml/tqxml.cpp", "pytqlupdate3/tqxml.cpp")
- else:
- buildfile= "pytqlupdate.sbf"
+ shutil.copyfile(tqt_dir + "/src/xml/tqxml.cpp", "pytqlupdate3/tqxml.cpp")
+ else:
+ buildfile= "pytqlupdate.sbf"
- makefile = sip_tqt_config.ProgramMakefile(
- configuration=sipcfg,
- build_file=os.path.join(src_dir, "pytqlupdate3", buildfile),
- dir="pytqlupdate3",
- install_dir=opt_pytqtbindir,
- console=1,
- tqt=1,
- warnings=1
- )
+ makefile = sip_tqt_config.ProgramMakefile(
+ configuration=sipcfg,
+ build_file=os.path.join(src_dir, "pytqlupdate3", buildfile),
+ dir="pytqlupdate3",
+ install_dir=opt_pytqtbindir,
+ console=1,
+ tqt=1,
+ warnings=1
+ )
- makefile.extra_defines.append("TQT_INTERNAL_XML")
+ makefile.extra_defines.append("TQT_INTERNAL_XML")
- if prof or "tqtxml" not in pytqt_modules:
- makefile.extra_defines.append("TQT_MODULE_XML")
+ if prof or "tqtxml" not in pytqt_modules:
+ makefile.extra_defines.append("TQT_MODULE_XML")
- makefile.extra_include_dirs.append(os.path.join(src_dir, "pytqlupdate3"))
+ makefile.extra_include_dirs.append(os.path.join(src_dir, "pytqlupdate3"))
- if not os.access("pytqlupdate3", os.F_OK):
- os.mkdir("pytqlupdate3")
+ if not os.access("pytqlupdate3", os.F_OK):
+ os.mkdir("pytqlupdate3")
- makefile.generate()
- tool_dirs.append("pytqlupdate3")
+ makefile.generate()
+ tool_dirs.append("pytqlupdate3")
return tool_dirs
@@ -386,11 +381,8 @@ def inform_user():
sip_tqt_config.inform("The TQt header files are in %s." % tqt_incdir)
sip_tqt_config.inform("The %s TQt library is in %s." % (opt_tqtlib, tqt_libdir))
- if tqt_version >= 0x020000:
- sip_tqt_config.inform("pyuic will be installed in %s." % opt_pytqtbindir)
-
- if tqt_version >= 0x030000:
- sip_tqt_config.inform("pylupdate will be installed in %s." % opt_pytqtbindir)
+ sip_tqt_config.inform("pyuic will be installed in %s." % opt_pytqtbindir)
+ sip_tqt_config.inform("pylupdate will be installed in %s." % opt_pytqtbindir)
if opt_vendorcheck:
sip_tqt_config.inform("PyTQt will only be usable with signed interpreters.")
@@ -414,8 +406,8 @@ def create_config(module, template, macros):
"pytqt_mod_dir": opt_pytqtmoddir,
"pytqt_sip_dir": opt_pytqtsipdir,
"pytqt_modules": pytqt_modules,
- "pytqt_tqt_sip_flags": tqt_sip_flags,
- "tqt_version": tqt_version,
+ "pytqt_tqt_sip_flags": tqt_sip_flags,
+ "tqt_version": tqt_version,
"tqt_edition": tqt_edition,
"tqt_winconfig": tqt_winconfig,
"tqt_framework": 0,
@@ -700,7 +692,7 @@ int main(int argc,char **argv)
fprintf(fp,"-x TQt_THREAD_SUPPORT\\n");
#endif
-#if !defined(Q_WS_WIN) || TQT_VERSION < 0x030000 || defined(TQT_NO_STYLE_WINDOWSXP)
+#if !defined(Q_WS_WIN) || defined(TQT_NO_STYLE_WINDOWSXP)
fprintf(fp,"-x TQt_STYLE_WINDOWSXP\\n");
#endif
@@ -1112,56 +1104,37 @@ def check_tqt_installation(macros):
tqt_version, ignore = sip_tqt_config.read_version(tqglobal, "TQt", "TQT_VERSION")
- # Early versions of TQt for the Mac didn't include everything. Rather than
- # maintain these in the future we just mandate a later version.
- if sys.platform == "darwin" and tqt_version < 0x030100:
- sip_tqt_config.error("PyTQt for MacOS/X requires TQt v3.1.0 or later.")
-
- # The way SIP-TQt v4.2 and later handle connections between signals and Python
- # slots only works with TQt v3 and later. Therefore TQt v2 and earlier needs
- # SIP-TQt v3.
- if tqt_version < 0x030000:
- sip_tqt_config.error("TQt v2.x and earlier require SIP-TQt v3.x.")
-
- if tqt_version >= 0x040000:
- sip_tqt_config.error("TQt v4.x requires PyTQt v5.x.")
-
# Try and work out which edition it is.
global tqt_edition
- if tqt_version >= 0x030000:
- if opt_tqconfigdir:
- tqconfigdir = opt_tqconfigdir
- else:
- tqconfigdir = tqt_incdir
+ if opt_tqconfigdir:
+ tqconfigdir = opt_tqconfigdir
+ else:
+ tqconfigdir = tqt_incdir
- tqconfig = os.path.join(tqconfigdir, "tqconfig.h")
+ tqconfig = os.path.join(tqconfigdir, "tqconfig.h")
- if not os.access(tqconfig,os.F_OK):
- tqconfig = os.path.join(tqconfigdir, "ntqconfig.h")
+ if not os.access(tqconfig,os.F_OK):
+ tqconfig = os.path.join(tqconfigdir, "ntqconfig.h")
- if not os.access(tqconfig,os.F_OK):
- sip_tqt_config.error("tqconfig.h or ntqconfig.h could not be found in %s." % tqconfigdir)
+ if not os.access(tqconfig,os.F_OK):
+ sip_tqt_config.error("tqconfig.h or ntqconfig.h could not be found in %s." % tqconfigdir)
- f = open(tqconfig)
- l = f.readline()
+ f = open(tqconfig)
+ l = f.readline()
- while l:
- wl = l.split()
- if len(wl) == 3 and wl[0] == "#define" and wl[1] == "QT_PRODUCT_LICENSE":
- tqt_edition = wl[2][4:-1]
- break
+ while l:
+ wl = l.split()
+ if len(wl) == 3 and wl[0] == "#define" and wl[1] == "QT_PRODUCT_LICENSE":
+ tqt_edition = wl[2][4:-1]
+ break
- l = f.readline()
+ l = f.readline()
- f.close()
+ f.close()
- if not tqt_edition:
- sip_tqt_config.error("The TQt edition could not be determined by parsing %s." % tqconfig)
- elif tqt_version == 0x020300 and sys.platform == "win32":
- # See if we have the TQt v2 non-commercial version.
- if os.access(os.path.join(tqt_libdir, "tqt-mt230nc.lib"), os.F_OK):
- tqt_edition = "non-commercial"
+ if not tqt_edition:
+ sip_tqt_config.error("The TQt edition could not be determined by parsing %s." % tqconfig)
if sys.platform == "win32":
# Work out how TQt was built on Windows.