THIS DOCUMENT DESCRIBES HOW YOU CAN COMPILE KDE WHEN USING CVS

(If you use source tarballs, you can skip "make -f Makefile.cvs" and
should use "make distclean" instead of "make cvs-clean")

What you need
=============

Make sure you get the following stuff from CVS:

qt-copy (This is qt-2.1.1)
kde-qt-addon (stuff which TrollTech forgot to add to Qt :-)
kdesupport (stuff from others which we use)
kdelibs
kdebase (strongly recommended but not strictly necassery)
<any other package you are interested in>

It is important that you compile AND INSTALL the above packages in the 
above order.

Further you will need GNU make, autoconf 2.13, automake 1.4 and 
a working C++ compiler (eg. gcc 2.95.2)

Preparations
============

Before you start you must decide two things:
1) Where do you want to have Qt installed? Qt is a bit lame in that it 
basically installs itselfs in its own source-tree, but symlinks are your 
friend. E.g you could link /usr/lib/qt-2.1.1 to where you keep your Qt 
source. Qt libs then end up in /usr/lib/qt-2.1.1/lib.

Make sure to do
export QTDIR=/usr/lib/qt-2.1.1

2) Where do you want to have KDE installed. A good candidate is /opt/kde2.0.

Make sure you do
export KDEDIR=/opt/kde2.0

Now you want to make sure that Qt and KDE libraries are picked up correctly.
For that you need to do

export LD_LIBRARY_PATH=$KDEDIR/lib:$QTDIR/lib

You probably also want to add $KDEDIR/bin and $QTDIR/bin to your path.

See http://www.kde.org/kde1-and-kde2.html for tips about setting up
KDE 2.0 next to KDE 1.x.


Compiling
=========

The magic sequence to compile & install a package is:
makefile -f Makefile.cvs
./configure --enable-debug
make
make install

For Qt the magic sequence is:

makefile -f Makefile.cvs
./configure -debug -shared -gif -sm -system-zlib -system-libpng -system-jpeg

Common problems
===============

One of the biggest problems is picking up the correct version of Qt, 
especially if your system has more version of Qt installed. Be aware 
that information about library paths gets saved in the "config.cache" 
file, "Makefile.in" as well as "Makefile" files. So it can be that after 
some struggle to get QTDIR/KDEDIR setup correctly your setup is actually 
correct, but old -incorrect- settings are still lying around.

The best thing to do in such a case is to do a "make cvs-clean". This 
removes all files which aren't stored in CVS. You can then start all over 
again with "makefile -f Makefile.cvs". Make sure you don't have any important 
files lying around in your source tree any more, they will be deleted!


Problems?
=========

See http://www.kde.org/compilationfaq.html for common build problems
and their solution.

If you encounter _LINK_ problems you are probably doing something wrong.
Do a "make cvs-clean" and start from scratch, usually this solves the problem.

If you encounter missing include files, especially if the files start with
a 'q', you probably have not setup your QTDIR correct or have the wrong 
version of Qt.

If you encounter compile errors after updating from CVS, check whether you 
need to update kdelibs as well. If the problems persists, wait a few hours,
usually compile errors are fixed shortly after they have been introduced.

If you still have problems read the kde-devel@kde.org mailinglist and/or
post your problem there. You can subscribe by sending mail to
kde-devel-request@kde.org with "subscribe" in the subject.

Have fun!

Cheers,
Waldo Bastian
bastian@kde.org
