Hi Phil,
the attached patch is meant to obsolete an ugly hack found in SuSE rpm specs
to support 64 bit architectures. They simply patch the offending pathes,
which will break often.
Therefore I've added a new command line option (-L dir), to specify the lib
base directory, which defaults to "lib". Hopefully, by using "-L lib64",
build.py is able to build on such archs, but unfortunately I cannot test it,
since I don't have access to such a system by now.
If you're going to accept it, I will create a similar patch for sip, too.
Thanks,
Pete
--- build.py.orig 2003-03-24 02:51:15.000000000 +0100
+++ build.py 2003-03-24 03:35:04.000000000 +0100
@@ -57,21 +57,22 @@
debugMode = "release"
catCppFiles = 0
qpeTag = None
licType = None
gccFlags = []
+libDir = "lib"
def usage(rcode = 2):
"""Display a usage message and exit.
rcode is the return code passed back to the calling process.
"""
- global progName, platBinDir, platMake, modDir, platQTDIRName, sipIncDir
+ global progName, platBinDir, platMake, modDir, platQTDIRName, sipIncDir, libDir
print "Usage:"
- print " %s [-h] [-a version] [-b dir] [-c] [-d dir] [-e dir] [-f gccflag] [-g prog] [-i dir] [-l Qt-library] [-m prog] [-n dir] [-o dir] [-p dir] [-q dir] [-s dir] [-u] [-w]" % (progName)
+ print " %s [-h] [-a version] [-b dir] [-c] [-d dir] [-e dir] [-f gccflag] [-g prog] [-i dir] [-l Qt-library] [-L lib-base-dir] [-m prog] [-n dir] [-o dir] [-p dir] [-q dir] [-s dir] [-u] [-w]" % (progName)
print "where:"
print " -h display this help message"
print " -a tag explicitly enable the qtpe module"
print " -b dir where pyuic and pylupdate will be installed [default %s]" % (platBinDir)
print " -c concatenate each module's C++ source files"
@@ -79,10 +80,11 @@
print " -e dir the directory containing the SIP header files [default %s]" % (sipIncDir)
print " -f gccflag additional GCC flag, eg. -fno-exceptions"
print " -g prog the name of the Makefile generator"
print " -i dir the directory containing the Qt header files [default %s%sinclude]" % (platQTDIRName,os.sep)
print " -l Qt-library explicitly specify the type of Qt library, either qt, qt-mt or qte"
+ print " -L dir Python and Qt lib base directory [default %s]" % (libDir)
print " -m prog the name of the Make program [default %s]" % (platMake)
print " -n dir the directory containing the QScintilla header files [default %s%sinclude]" % (platQTDIRName, os.sep)
print " -o dir the directory containing the QScintilla library [default %s%slib]" % (platQTDIRName, os.sep)
print " -p dir the name of the SIP code generator [default sip]"
print " -q dir the Qt base directory [default %s]" % (platQTDIRName)
@@ -153,11 +155,11 @@
def initGlobals():
"""Sets the values of globals that need more than a simple assignment.
"""
global platMake, platCopy, platPyScriptDir, platPyDLLDir, platPySiteDir
global platPyIncDir, platPyLib, platQTDIRName, platBinDir, platMkdir
- global platRmdir, modDir, pyFullVers, pyVersNr, sipIncDir
+ global platRmdir, modDir, pyFullVers, pyVersNr, sipIncDir, libDir
pyFullVers = string.split(sys.version)[0]
vl = string.split(re.findall("[0-9.]*",pyFullVers)[0],".")
major = vl[0]
@@ -187,17 +189,18 @@
else:
platMake = "make"
platCopy = "cp"
platMkdir = "mkdir"
platRmdir = "rm -rf"
- platPyScriptDir = sys.prefix + "/lib/python" + pyVers
- platPyDLLDir = sys.prefix + "/lib/python" + pyVers + "/lib-dynload"
+ pylib = sys.prefix + "/" + libDir + "/python" + pyVers
+ platPyScriptDir = pylib
+ platPyDLLDir = pylib + "/lib-dynload"
if pyVersNr < 20:
- platPySiteDir = sys.prefix + "/lib/python" + pyVers
+ platPySiteDir = pylib
else:
- platPySiteDir = sys.prefix + "/lib/python" + pyVers + "/site-packages"
+ platPySiteDir = pylib + "/site-packages"
platPyIncDir = sys.prefix + "/include/python" + pyVers
platQTDIRName = "$QTDIR"
platBinDir = "/usr/local/bin"
@@ -566,13 +569,13 @@
def checkQtLibrary():
"""Check which Qt library is to be used.
"""
- global qtDir, qtLib
+ global qtDir, qtLib, libDir
- qtlibdir = qtDir + os.sep + "lib"
+ qtlibdir = qtDir + os.sep + libDir
if qtLib is None:
mtlib = isQtLibrary(qtlibdir,"qt-mt")
stlib = isQtLibrary(qtlibdir,"qt")
emlib = isQtLibrary(qtlibdir,"qte")
@@ -765,13 +768,13 @@
f.close()
# Check the SIP module can be found.
if sipModuleDir is None:
- global platPyScriptDir, platPyDLLDir, platPySiteDir
+ global platPyScriptDir, platPyDLLDir, platPySiteDir
- dirlist = [platPyDLLDir, platPyScriptDir, platPySiteDir]
+ dirlist = [platPyDLLDir, platPyScriptDir, platPySiteDir]
else:
dirlist = [sipModuleDir]
sipModuleDir = None
for d in dirlist:
@@ -1373,15 +1376,15 @@
progName = os.path.basename(argv[0])
initGlobals()
try:
- optlist, args = getopt.getopt(argv[1:],"ha:b:cd:e:f:g:i:l:m:n:o:p:q:s:uw")
+ optlist, args = getopt.getopt(argv[1:],"ha:b:cd:e:f:g:i:l:L:m:n:o:p:q:s:uw")
except getopt.GetoptError:
usage()
- global makeBin, platBinDir, qtLib, qpeTag
+ global makeBin, platBinDir, qtLib, qpeTag, libDir
explicitMake = 0
for opt, arg in optlist:
if opt == "-h":
@@ -1411,10 +1414,12 @@
elif opt == "-l":
if arg in ("qt", "qt-mt", "qte"):
qtLib = arg
else:
usage()
+ elif opt == "-L":
+ libDir = arg
elif opt == "-m":
makeBin = arg
explicitMake = 1
elif opt == "-n":
global sciIncDir