build.py Options

PyKDE builds and installs in a lot of different environments and it isn't always possible to foresee where users or distributions will locate components that PyKDE depends on. There are a number of command line switches used to force build.py to look in the correct locations for directories or files.

python build.py -h

Usage:
    build.py [-h]
    build.py [options]

where:
    -h             display this help message

options:
    -c+            concatenate each module's C++ source files [default: use -c- to disable]
    -d dir         where PyKDE will be installed
    -e dir         the directory containing the SIP header files
    -g prog        the complete path/name of the Makefile generator"
    -i dir         the directory containing the Qt header files
    -j #           split the concatenated C++ source files into # pieces
    -k dir         the KDE base directory
    -m prog        the name of the Make program
    -n dir         the directory containing the KDE header files
    -o dir         the directory containing the KDE lib files
    -p dir         the name of the SIP code generator [default sip]
    -q dir         the Qt base directory
    -r dir         the directory containing the Qt library
    -s dir         the directory containing the SIP module
    -t dir         the directory containing the Python library directories
    -u value       version checking on for PyQt and sip [all}, off for sip [nosip], or none [none] (default all)
    -v dir         the directory containing the PyQt sip files
    -z file        the name of a file containing command line flags

NOTE: In the descriptions below "Default" is a "typical" value for common distributions and may not be the complete path needed. You should always specify the complete path. build.py searches a number of locations in looking for the appropriate directories, which may depend on the distribution used, where the version of Python used to run build.py is located, and other factors. For example, a default value of "python/site-packages" could be "/usr/lib/python/site-packages", "/usr/local/python2.3/site-packages" or other values depending on how and where Python is installed or which of several installed versions of Python is used to run build.py. build.py will not try to complete the path for switch specified paths - you must specifiy the complete path (eg /usr/lib/python/site-packages or ../kdecore)

For "normal" installations, build.py will automatically discover all of the information covered by the options below -- it is only necessary to use the options switches when build.py can't discover a location by itself.


-c Concatenation
Value: + or - build.py Default: +
Building PyKDE involves loading a large number of cpp and h files. The compile process can be speeded up considerably (by as much as 80%) by concatenating all of the cpp files into a one (or several - see -j) large cpp file. The price for this speed up is a large increase in memory usage. By default, the feature is 'on' in build.py. To turn this feature off, use '-c-' To turn it on explicitly, use '-c+'. You may wish to turn this off if the system doing the compile has 128MB or less RAM.

-d Installation directory
Value: directory path build.py Default: python/site-packages/
Normally, the PyKDE modules are installed in python/site-packages. Writing to this directory requires root access. RPM builders sometimes need to build the modules to a different directory, or you may want to install the modules in a different location (for example, in a subdirectory of site-packages/). For this option to be useful, you need to ensure that Python can still locate and import the PyKDE modules from the specified destination.

-e sip h files
Value: directory path build.py Default: include/python/
The location of the sip include files (usually sip.h and sipQt.h). The sip installation procedure normally installs these in a well-known location like "/usr/include/python/"

-g Makefile generator
Value: path or name of Makefile generator build.py Default: qmake
At present, build.py will only use qmake (it does not recognize tmake or other similar Makefile generators, or use the GNU autotools). If your version of qmake is in a location build.py doesn't check, you can specify the complete path to qmake here (qmake is usually found in qt3/bin/)

-i Qt h files
Value: directory path build.py Default: lib/qt3/include
The path to the Qt toolkit's h files. May require the qt-devel rpm to be installed.

-j # of splits of concatenated files
Value: number of splits build.py Default: 1
Intended for use on multi-CPU systems. Splits the concatenated cpp file into the specified number of segments, each of which can be compiled concurretnly in separate threads.

-k KDE base directory
Value: directory path build.py Default: kde3/
The top level directory under which kde3/libs and kde3/include are located (these paths can also be specified independently see -n and -o) On SuSE distributions, this is typically /opt/kde3. On Red Hat and Mandrake, this is typically /usr. build.py will find the typical locations automatically. build.py will use the KDEDIR environment variable value if it is defined and the -k switch is NOT used.

-m name of Make program
Value: name of the 'make' program build.py Default: make
Used for platforms whose "make" program is not named make (eg "pmake" or "gmake") PyKDE's build.py uses 'make' for testing the C++ compiler. When actually running 'make', use what your platform has installed.

-n KDE h files
Value: directory path build.py Default: kde3/include
The path to KDE's h files. (May require installation of kdelibs3-devel rpm package) build.py/PyKDE will locate h files in subdirectories of this path automatically (eg kde3/include/kio/*.h)

-o KDE library files
Value: directory path build.py Default: kde3/libs
The path to KDE's library files (libkdecore.so, etc).

-p name of sip code generator
Value: path or name of code genetator build.py Default: sip
Typically this is sip and sip is normally installed in your PATH. If sip is not in your system's PATH, you can specify the path to the sip executable here.

-q Qt base directory
Value: directory path build.py Default: /usr/lib/qt3/
The path to the top level Qt directory (parent of include/ and lib/ - see -i and -r). For most distributions, this is /usr/lib/qt3, but a customized location may be specified here. If the environment variable QTDIR has been defined, its value will be used here if the -q switch is NOT used.

-r Qt library files
Value: directory path build.py Default: lib/qt3/lib
The path to Qt's library files (eg libqt-mt.so.3)

-s sip module directory
Value: directory path build.py Default: python/site-packages
The path to libsip.so - typically installed in Python's site-packages subdirectory.

-t Python library files
Value: dirctory path build.py Default: python/config
The path to the Python lib (eg libpython2.2.a for Python 2.2.x)

-u Version checking control
Value: one of [all, nosip, none] build.py Default: all
Normally, the PyKDE version (eg 3.8) must be in sync with the sip and PyQt versions (also 3.8). In some circumstances, PyKDE will compile with older or newer versions of sip/PyQt. For example, PyKDE 3.7 would build with sip/PyQt 3.8. build.py normally (by default) does strict version checking among PyKDE, sip, the PyQt modules and the PyQt sip files to make sure all versions are the same. Supplying 'nosip' for this switch will allow building against a different sip version. Specifying 'none' will turn off this version checking. There are no guarantees that PyKDE/PyQt/sip will work with differing version numbers among the three programs - in fact usually they won't. Check with the PyKDE mailing list if unsure.

-v PyQt sip files
Value: dirctory path build.py Default: varies
build.py checks a number of possible locations for the PyQt *.sip files. PyKDE will not build without these files (if PyQt was installed from rpms, this may require installation of a PyQt-devel rpm package). This must be the complete path to the sip files, not just to the top level PyQt directory. For example, "/usr/local/PyQt-x11-gpl-3.8" will NOT work - it would need to be "/usr/local/PyQt-x11-gpl-3.8/sip".

-z Path to build.py options file
Value: filename or path build.py Default: none
If your site requires the use of more than one or two option switches, you can place all of the options in a text file and then reference only the text file's path and name on the command line. The options are placed in the text file just as they would be on the command line, with one option per line. For example, the options file for the command "python build.py -c- -v /usr/local/PyQt/sip" would look like:

options.txt

-c
-v /usr/local/PyQt/sip

and would be run as "python build.py -z options.txt" (assuming options.txt is in the current directory).