Getting Started/Build/kdesrc-build-config

< Getting Started‎ | Build
Revision as of 21:47, 8 March 2009 by Mpyne (Talk | contribs)

Jump to: navigation, search

Contents

kdesvn-buildrc

Introduction

The kdesvn-build program, which is used to download, build, and install KDE from the KDE source repository, uses a file called kdesvn-buildrc in order to control what is downloaded and built, what options are used, and where KDE is installed to.

This is a description of how to use kdesvn-buildrc.

Creating your configuration

The kdesvn-build download will include a file called kdesvn-buildrc-sample, which is a sample configuration file suitable for building KDE 4.

To create your configuration, it is recommended to use this file as a base since it includes the standard list of KDE modules to build, in the correct order. (You can, of course, add or remove most modules if you like).

You can use any standard text editor to edit this file, such as KWrite, nano, vi, etc.

Global configuration

Once you open the file, you will see that it starts with some comments (on lines beginning with #), and then the world "global". This starts the global configuration for the kdesvn-buildrc, which is used to specify options which are common to all of the modules.

Each option in the global section is specified in the following form:

option-name value

Many options are already listed, with default values, and comments about the option on top. Some options have more than one sample value listed. In this situation, all but one of these will have comments. If you want to use a different sample option, simply uncomment the line by deleting the '#' at the beginning, and commenting or deleting the other lines with the same option name.

Here's a short listing of some of the important global options:

  • source-dir: This option controls where kdesvn-build will download the sources to. In addition, most other directories that kdesvn-build uses will be subdirectories of this directory by default, so it is a kind of "kdesvn-build prefix". The default value is ~/kdesvn, which downloads the source in a subdirectory under your home directory.
  • build-dir: This controls where kdesvn-build actually builds the various modules. Normally it is the directory build under your source directory.
  • kdedir: This controls where KDE (and the various supporting modules such as kdesupport) get installed to. The default is ~/kde, which installs KDE to your home directory.
noframe
 
Note
As you can see, there are three different major directories, source, build, and install. The build directory is used to keep the source directory clean and to hold intermediate files that don't get installed
Ktip.png
 
Tip
You can use ~/ in these options to represent your home directory


  • qtdir: This controls where Qt 4 is assumed to be. If you use the qt-copy module, it also controls where qt-copy is installed to. Default is ~/qt4, which installs qt-copy to your home directory.
Ktip.png
 
Tip
qt-copy is a copy of the Qt source code in the KDE repository, which can optionally also have some bugfix patches applied


  • cmake-options: This controls what options are passed to CMake for every KDE module. For instance, if you want to enable full debugging information, you could set:
cmake-options -DCMAKE_BUILD_TYPE=debugfull
  • make-options: This is used to pass command line options to the make command, which is what actually performs the build. The most likely option is -jN, where N is the number of jobs to perform at once. If you have a system with more than one CPU, it is recommended to use N = number_of_CPUs + 1. For instance, -j3 on a dual core machine or -j5 on a quad-core. You can lower this number if your system is sluggish during the build, but raising it won't buy you much in build speed.
  • make-install-prefix: This is used to allow a program to run make install on your behalf. Normally with would be the sudo program, which is used to perform actions as super user. You only need this for the following:
  1. You want to install KDE to the system and not your home directory.
  2. Some installed files require setuid root to work properly (this is true for kdebase, and some files in kdelibs).

If this is the case for you, you can use this option (either globally, or for each module) to run make install using sudo, or su, etc.

Location

kdesvn-build will search in several locations for your rc file.

  1. First, kdesvn-build will look for a file called kdesvn-buildrc in the current directory. Notice that in this situation there is no leading dot on the filename. This allows you to control the build based on what directory you're in, which would be useful for maintaining two different Subversion installs.
  2. If no kdesvn-buildrc is found, kdesvn-build will look for a ~/.kdesvn-buildrc. Notice there is a leading dot on the filename in this situation. This is the standard Linux/UNIX convention for configuration files stored in the home directory, and marks this as a hidden file. So if you try to find the file in Dolphin or Konqueror, you may need to Show Hidden Files first. This controls the default configuration kdesvn-build will use, no matter what directory you run kdesvn-build from.
  3. If you specify the --rc-file option to kdesvn-build, kdesvn-build will try to read the given kdesvn-buildrc file instead of the default ones. This is also independent of what directory kdesvn-build is run in. But, you must remember to pass this option every time, so it is only useful for testing or for a one-time-only run.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal