Construction Details
====================

"sip" is the program that is used generate Python bindings. The input to
sip is a modified version of the C++ .h files corresponding to the C++
code to be bound. sip is run on the input files (*.sip files) and
generates the necessary .py, .cpp, and .h files. With appropriate input
and switches, sip will also generate a Makefile template for the module
being bound, which can be used to generate a Makefile using tmake or
qmake.



The PyKDE package
-----------------

The PyKDE tarball includes:

   - the necessary .sip files for the libraries being bound
     These cover all versions of PyKDE from KDE2.1.1 to KDE3.0.2

   - scripting for generating templates used by tmake/qmake to
     generate Makefiles

   - Python scripts (build, postproc) that replace the
     configure script and generate the necessary cpp
     and h files for each module using the sip program and
     also generate custom Makefiles for each module and the
     entire program.



Building PyKDE
--------------

1. Running build.py ('python build.py') performs the normal system
checks and creates the cpp/h/Makefiles for the versions of Qt and
KDE on the user's machine.

2. If build.py is run with the '-c' switch ('python build.py -c')
it will concatenate together all of the cpp files for each module
into a single huge cpp file per module. Compiling the single huge
file is about 80% faster than compiling the individual files for
each module, and yields exactly the same lib result. Compiling
the single huge file is memory intensive however, and probably
requires at least 256MB of RAM, and/or sufficient swap file
space.

3. Running 'make' compiles the cpp files using gcc and
links .so libraries make builds. make also installs the .so files
into the appropriate directory. Currently, you need to run make
as the 'root' user.

4. Running 'make install' places the generate .py files in their
final destination. 'make install' no longer does a re-link.



Modifying PyKDE after the intial install
----------------------------------------

If PyKDE needs to be patched or the user wants to make changes to
PyKDE after the initial installation, it isn't necessary to re-run
build.py. Using

   python rebuild.py [options] <module>

   where module is the subdirectory of the module modified (for
   example 'kdecore' or 'kspell') and 'option' are the same
   options specified for the build.py script.

sip will be invoked to regenerate the cpp and h files and also
regenerate a correct Makefile for the module. Only the module
specified will recompile; dependent modules will be re-linked.

build.py only needs to be run again if you install a new version
of PyQt, Qt or KDE or relocate the PyQt sip files. rebuild.py cannot
be run until build.py has run to completion at least once.
