summaryrefslogtreecommitdiffstats
path: root/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'build.py')
-rw-r--r--build.py170
1 files changed, 85 insertions, 85 deletions
diff --git a/build.py b/build.py
index 11e4a0c..692fa50 100644
--- a/build.py
+++ b/build.py
@@ -1,23 +1,23 @@
# Copyright (c) 2007
# Riverbank Computing Limited <info@riverbankcomputing.co.uk>
#
-# This file is part of PyQt.
+# This file is part of PyTQt.
#
-# This copy of PyQt is free software; you can redistribute it and/or modify it
+# This copy of PyTQt is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2, or (at your option) any later
# version.
#
-# PyQt is supplied in the hope that it will be useful, but WITHOUT ANY
+# PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
-# PyQt; see the file LICENSE. If not, write to the Free Software Foundation,
+# PyTQt; see the file LICENSE. If not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# This is the build script for PyQt. It should be run in the top level
+# This is the build script for PyTQt. It should be run in the top level
# directory of the source distribution and by the Python interpreter for which
# it is being built. It uses either qmake or tmake to do the hard work of
# generating the platform specific Makefiles.
@@ -41,7 +41,7 @@ except:
print "SIP v3.9 or later installed."
sys.exit(1)
-config = sipconfig.SIPConfig("PyQt 3.18.1")
+config = sipconfig.SIPConfig("PyTQt 3.18.1")
# Initialise the globals.
@@ -74,13 +74,13 @@ def usage(rcode = 2):
print " -a tag explicitly enable the qtpe module"
print " -b dir where pyuic and pylupdate will be installed [default %s]" % config.default_bin_dir
print " -c concatenate each module's C++ source files"
- print " -d dir where the PyQt modules will be installed [default %s]" % config.default_mod_dir
+ print " -d dir where the PyTQt modules will be installed [default %s]" % config.default_mod_dir
print " -g always release the GIL (SIP v3.x behaviour)"
print " -j # split the concatenated C++ source files into # pieces [default 1]"
- print " -n dir the directory containing the QScintilla header files [default %s]" % config.qt_inc_dir
- print " -o dir the directory containing the QScintilla library [default %s]" % config.qt_lib_dir
+ print " -n dir the directory containing the TQScintilla header files [default %s]" % config.qt_inc_dir
+ print " -o dir the directory containing the TQScintilla library [default %s]" % config.qt_lib_dir
print " -r generate code with tracing enabled [default disabled]"
- print " -v dir where the PyQt .sip files will be installed [default %s]" % config.default_sip_dir
+ print " -v dir where the PyTQt .sip files will be installed [default %s]" % config.default_sip_dir
sys.exit(rcode)
@@ -117,7 +117,7 @@ SOURCES = qttest.cpp
LIBS += @TEST_QUI_LIB@ @TEST_QSCINTILLA_LIB@
""")
- # Disable OpenGL, qui and QScintilla support by default.
+ # Disable OpenGL, tqui and TQScintilla support by default.
config.patches["@TEST_OPENGL@"] = ""
config.patches["@TEST_QUI_LIB@"] = ""
config.patches["@TEST_QSCINTILLA_INC@"] = ""
@@ -137,11 +137,11 @@ LIBS += @TEST_QUI_LIB@ @TEST_QSCINTILLA_LIB@
def tryModule(maindir, mname, incfile, ctor):
- """See if a PyQt module should be built and update the buildModules list
+ """See if a PyTQt module should be built and update the buildModules list
accordingly.
maindir is the directory containing this script.
- mname is the name of the PyQt module.
+ mname is the name of the PyTQt module.
incfile is the C++ header file that defines the class being used for the
test.
ctor is the constructor of the class being used for the test.
@@ -170,10 +170,10 @@ int main(int argc,char **argv)
sipconfig.run_make("clean")
-def checkQScintilla():
- """See if QScintilla can be found and what its version is.
+def checkTQScintilla():
+ """See if TQScintilla can be found and what its version is.
"""
- # Find the QScintilla header files.
+ # Find the TQScintilla header files.
sciglobal = os.path.join(sciIncDir, "qextscintillaglobal.h")
if os.access(sciglobal,os.F_OK):
@@ -181,26 +181,26 @@ def checkQScintilla():
sipconfig.inform("%s contains qextscintillaglobal.h." % (sciIncDir))
- # Get the QScintilla version number.
+ # Get the TQScintilla version number.
global sciVersion
- sciVersion, sciversstr = sipconfig.read_version(sciglobal, "QScintilla", "QSCINTILLA_VERSION", "QSCINTILLA_VERSION_STR")
+ sciVersion, sciversstr = sipconfig.read_version(sciglobal, "TQScintilla", "TQSCINTILLA_VERSION", "TQSCINTILLA_VERSION_STR")
- sipconfig.inform("QScintilla %s is being used." % (sciversstr))
+ sipconfig.inform("TQScintilla %s is being used." % (sciversstr))
# If we find a snapshot then set the version number to 0 as a special
# case.
if sciversstr[:8] == "snapshot":
sciVersion = 0
- # Find the QScintilla library.
+ # Find the TQScintilla library.
if sys.platform == "win32":
lpatt = "qscintilla.lib"
else:
lpatt = "libqscintilla.*"
if len(glob.glob(os.path.join(sciLibDir, lpatt))):
- sipconfig.inform("%s contains the QScintilla library." % sciLibDir)
+ sipconfig.inform("%s contains the TQScintilla library." % sciLibDir)
global sciLib
@@ -211,57 +211,57 @@ def checkQScintilla():
config.patches["@PYQT_QSCINTILLA_LIB@"] = sciLib
else:
- sipconfig.inform("The QScintilla library could not be found in %s and so the qtext module will not be built. If QScintilla is installed then use the -o argument to explicitly specify the correct directory." % (sciLibDir))
+ sipconfig.inform("The TQScintilla library could not be found in %s and so the qtext module will not be built. If TQScintilla is installed then use the -o argument to explicitly specify the correct directory." % (sciLibDir))
sciVersion = -1
else:
- sipconfig.inform("qextscintillaglobal.h could not be found in %s and so the qtext module will not be built. If QScintilla is installed then use the -n argument to explicitly specify the correct directory." % sciIncDir)
+ sipconfig.inform("qextscintillaglobal.h could not be found in %s and so the qtext module will not be built. If TQScintilla is installed then use the -n argument to explicitly specify the correct directory." % sciIncDir)
sciVersion = -1
def moduleChecks(maindir):
- """See which PyQt modules to build.
+ """See which PyTQt modules to build.
"""
- sipconfig.inform("Checking which additional PyQt modules to build.");
+ sipconfig.inform("Checking which additional PyTQt modules to build.");
- tryModule(maindir,"qtcanvas", "qcanvas.h", "QCanvas()")
- tryModule(maindir,"qtnetwork", "qsocket.h", "QSocket()")
- tryModule(maindir,"qttable", "qtable.h", "QTable()")
- tryModule(maindir,"qtxml", "qdom.h", "QDomImplementation()")
+ tryModule(maindir,"qtcanvas", "qcanvas.h", "TQCanvas()")
+ tryModule(maindir,"qtnetwork", "qsocket.h", "TQSocket()")
+ tryModule(maindir,"qttable", "qtable.h", "TQTable()")
+ tryModule(maindir,"qtxml", "qdom.h", "TQDomImplementation()")
if config.qt_version >= 0x030000:
- tryModule(maindir,"qtsql", "qsql.h", "QSql()")
+ tryModule(maindir,"qtsql", "qsql.h", "TQSql()")
# We need a different Makefile for the qtgl module.
config.patches["@TEST_OPENGL@"] = "opengl"
config.create_makefile("qttest.pro")
- tryModule(maindir,"qtgl", "qgl.h", "QGLWidget()")
+ tryModule(maindir,"qtgl", "qgl.h", "TQGLWidget()")
# Put things back.
config.patches["@TEST_OPENGL@"] = ""
config.create_makefile("qttest.pro")
- # Check for the qui library.
+ # Check for the tqui library.
if config.qt_version >= 0x030000:
if sys.platform == "win32":
- quilib = r"$(QTDIR)\lib\qui.lib"
+ tquilib = r"$(QTDIR)\lib\tqui.lib"
else:
- quilib = "-lqui"
+ tquilib = "-ltqui"
- config.patches["@PYQT_QUI_LIB@"] = quilib
+ config.patches["@PYQT_QUI_LIB@"] = tquilib
- config.patches["@TEST_QUI_LIB@"] = quilib
+ config.patches["@TEST_QUI_LIB@"] = tquilib
config.create_makefile("qttest.pro")
- tryModule(maindir,"qtui", "qwidgetfactory.h", "QWidgetFactory()")
+ tryModule(maindir,"qtui", "qwidgetfactory.h", "TQWidgetFactory()")
# Put things back.
config.patches["@TEST_QUI_LIB@"] = ""
config.create_makefile("qttest.pro")
- # Check for the QScintilla library.
+ # Check for the TQScintilla library.
if sciVersion >= 0:
config.patches["@TEST_QSCINTILLA_INC@"] = sciIncDir
config.patches["@TEST_QSCINTILLA_LIB@"] = sciLib
@@ -276,7 +276,7 @@ def moduleChecks(maindir):
def generateFeatures(featfile):
- """Generate the header file describing the Qt features that are enabled if
+ """Generate the header file describing the TQt features that are enabled if
it doesn't already exist. (If it already exists then we are probably cross
compiling and generated the file through other means.)
@@ -288,8 +288,8 @@ def generateFeatures(featfile):
sipconfig.inform("Generating the features file.")
- # The features that a given Qt configuration may or may not support. Note
- # that STYLE_WINDOWSXP requires special handling.
+ # The features that a given TQt configuration may or may not support. Note
+ # that STYLE_WINDOWSXP retquires special handling.
flist = ["ACTION", "CLIPBOARD", "CODECS", "COLORDIALOG", "DATASTREAM",
"DIAL", "DNS", "DOM", "DRAGANDDROP", "ICONVIEW", "IMAGE_TEXT",
"INPUTDIALOG", "FILEDIALOG", "FONTDATABASE", "FONTDIALOG",
@@ -315,7 +315,7 @@ def generateFeatures(featfile):
int main(int argc,char **argv)
{
FILE *fp;
- QApplication app(argc,argv,0);
+ TQApplication app(argc,argv,0);
if ((fp = fopen("%s","w")) == NULL)
{
@@ -324,12 +324,12 @@ int main(int argc,char **argv)
}
#if !defined(QT_THREAD_SUPPORT)
- fprintf(fp,"-x Qt_THREAD_SUPPORT\\n");
+ fprintf(fp,"-x TQt_THREAD_SUPPORT\\n");
#endif
#if (defined(Q_OS_WIN32) || defined(Q_OS_WIN64)) && QT_VERSION >= 0x030000
- if (qWinVersion() != Qt::WV_XP)
- fprintf(fp,"-x Qt_STYLE_WINDOWSXP\\n");
+ if (qWinVersion() != TQt::WV_XP)
+ fprintf(fp,"-x TQt_STYLE_WINDOWSXP\\n");
#endif
""" % (ffstr, ffstr))
@@ -337,7 +337,7 @@ int main(int argc,char **argv)
f.write(
"""
#if defined(QT_NO_%s)
- fprintf(fp,"-x Qt_%s\\n");
+ fprintf(fp,"-x TQt_%s\\n");
#endif
""" % (feat, feat))
@@ -359,11 +359,11 @@ int main(int argc,char **argv)
def generateSource(mname, plattag, qttag, xtrtag):
- """Generate the C++ source code for a particular PyQt module.
+ """Generate the C++ source code for a particular PyTQt module.
mname is the name of the module.
plattag is the SIP tag for the platform.
- qttag is the SIP tag for the Qt version.
+ qttag is the SIP tag for the TQt version.
xtrtag is an optional extra SIP tag.
"""
sipconfig.inform("Generating the C++ source for the %s module." % mname)
@@ -521,22 +521,22 @@ def main(argv):
else:
sipconfig.error("Please copy the license file %s to the sip directory.\n" % config.license_file)
- # Check the Qt version.
+ # Check the TQt version.
if config.qt_version == 0:
- sipconfig.error("SIP has been built with Qt support disabled.\n")
+ sipconfig.error("SIP has been built with TQt support disabled.\n")
- # Early versions of Qt for the Mac didn't include everything. Rather than
+ # 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 config.qt_version < 0x030100:
- sipconfig.error("PyQt for MacOS/X requires Qt v3.1.0 or later.\n")
+ sipconfig.error("PyTQt for MacOS/X retquires TQt v3.1.0 or later.\n")
# Check the installation directory is valid and add it as a patch.
if not os.access(modDir,os.F_OK):
- sipconfig.error("The %s PyQt destination directory does not seem to exist. Use the -d argument to set the correct directory." % (modDir))
+ sipconfig.error("The %s PyTQt destination directory does not seem to exist. Use the -d argument to set the correct directory." % (modDir))
config.patches["@PYQT_MODDIR@"] = sipconfig.escape(modDir)
- sipconfig.inform("%s is the PyQt installation directory." % (modDir))
+ sipconfig.inform("%s is the PyTQt installation directory." % (modDir))
# Enable warnings for SIP v4 generated code.
if sipMajorVersion >= 4:
@@ -573,7 +573,7 @@ def main(argv):
config.patches["@PYQT_RBPROF@"] = rbprof
- # Link in the qassistantclient library for Qt v3.1+.
+ # Link in the qassistantclient library for TQt v3.1+.
qaclib = ""
if config.qt_version >= 0x030100:
@@ -584,9 +584,9 @@ def main(argv):
config.patches["@PYQT_QASSISTANTCLIENT_LIB@"] = qaclib
- # Check for QScintilla.
+ # Check for TQScintilla.
if config.qt_version >= 0x030000:
- checkQScintilla()
+ checkTQScintilla()
# Create a build directory that we can compile test programs.
maindir = mkTempBuildDir()
@@ -595,7 +595,7 @@ def main(argv):
if config.qt_version >= 0x020000:
moduleChecks(maindir)
- # Work out the platform and Qt version tags to pass to SIP to generate the
+ # Work out the platform and TQt version tags to pass to SIP to generate the
# code we need.
if config.qt_lib == "qte":
plattag = "WS_QWS"
@@ -607,36 +607,36 @@ def main(argv):
plattag = "WS_X11"
qttags = {
- 0x020000: "Qt_1_43",
- 0x020100: "Qt_2_00",
- 0x020200: "Qt_2_1_0",
- 0x020300: "Qt_2_2_0",
- 0x020301: "Qt_2_3_0",
- 0x030000: "Qt_2_3_1",
- 0x030001: "Qt_3_0_0",
- 0x030002: "Qt_3_0_1",
- 0x030004: "Qt_3_0_2",
- 0x030005: "Qt_3_0_4",
- 0x030006: "Qt_3_0_5",
- 0x030100: "Qt_3_0_6",
- 0x030101: "Qt_3_1_0",
- 0x030102: "Qt_3_1_1",
- 0x030200: "Qt_3_1_2",
- 0x030300: "Qt_3_2_0",
- 0x040000: "Qt_3_3_0"
+ 0x020000: "TQt_1_43",
+ 0x020100: "TQt_2_00",
+ 0x020200: "TQt_2_1_0",
+ 0x020300: "TQt_2_2_0",
+ 0x020301: "TQt_2_3_0",
+ 0x030000: "TQt_2_3_1",
+ 0x030001: "TQt_3_0_0",
+ 0x030002: "TQt_3_0_1",
+ 0x030004: "TQt_3_0_2",
+ 0x030005: "TQt_3_0_4",
+ 0x030006: "TQt_3_0_5",
+ 0x030100: "TQt_3_0_6",
+ 0x030101: "TQt_3_1_0",
+ 0x030102: "TQt_3_1_1",
+ 0x030200: "TQt_3_1_2",
+ 0x030300: "TQt_3_2_0",
+ 0x040000: "TQt_3_3_0"
}
- qttag = versionToTag(config.qt_version, qttags, "Qt")
+ qttag = versionToTag(config.qt_version, qttags, "TQt")
- # Work out the QScintilla tag.
+ # Work out the TQScintilla tag.
if sciVersion >= 0:
scitags = {
- 0x010100: "QScintilla_1_0",
- 0x010200: "QScintilla_1_1",
- 0x020000: "QScintilla_1_2"
+ 0x010100: "TQScintilla_1_0",
+ 0x010200: "TQScintilla_1_1",
+ 0x020000: "TQScintilla_1_2"
}
- scitag = versionToTag(sciVersion, scitags, "QScintilla")
+ scitag = versionToTag(sciVersion, scitags, "TQScintilla")
else:
scitag = None
@@ -697,7 +697,7 @@ def main(argv):
config.create_makefile("pyuic.pro", [])
sipconfig.pop_dir(olddir)
- # Build pylupdate if Qt v3.0 or later.
+ # Build pylupdate if TQt v3.0 or later.
if config.qt_version >= 0x030000:
sipconfig.inform("Creating Makefile for pylupdate3.")
subdirs.append("pylupdate3")
@@ -708,11 +708,11 @@ def main(argv):
# Generate the top-level Makefile.
sipconfig.inform("Creating top level Makefile.")
- sipconfig.copy_to_file("PyQt.pro.in", "TEMPLATE = subdirs\nSUBDIRS = " + string.join(subdirs) + "\n")
- config.create_makefile("PyQt.pro")
+ sipconfig.copy_to_file("PyTQt.pro.in", "TEMPLATE = subdirs\nSUBDIRS = " + string.join(subdirs) + "\n")
+ config.create_makefile("PyTQt.pro")
# Tell the user what to do next.
- msg = "The build of the PyQt source code for your system is now complete. To compile and install PyQt run \"%s\" and \"%s install\" with appropriate user privileges." % (config.make_bin, config.make_bin)
+ msg = "The build of the PyTQt source code for your system is now complete. To compile and install PyTQt run \"%s\" and \"%s install\" with appropriate user privileges." % (config.make_bin, config.make_bin)
sipconfig.inform(msg)