Building Posadis programs from source

All Posadis programs are open-source, so you can build them from source code. This is useful if you want to change things yourself, apply patches that fix certain problems, or simply because there are no binary packages available for your platform.

Getting the source code for Posadis programs can be done in two ways: for each release, source tarballs are released, and made available through the Download page. You can also get source code from the Posadis CVS repository.

Basic requirements

Specific packages may have specific requirements, but to build Posadis programs, you will at least need a normal building environment: a C++ compiler (usually GNU GCC), a make, and a shell capable of running configure scripts. For Unix problems, this is usually not an issue, but for Windows, you will need to download some extra software. This is described in Building on Win32.

If you build from CVS, you will also need the libtool, autoconf and automake packages from the GNU project. Again, for Win32, see Building on Win32.

Applying patches

A patch is a file that contains additions to the source code of a package. Sometimes, patches are made available to fix problems in Posadis programs, or to add new features. To apply a patch (that is, to merge its additions to your copy of the source code), first download it. Then, from the base source directory, run:

patch -p1 < patchfile

Where patchfile is the file name of the patch. If the patch has been compressed with GZIP (this is the case when it has a .gz extension), instead run the following command:

gunzip -c patchfile.gz | patch -p1

Building from source

If you build from CVS, the first thing you will want to do is run the following command from the base source directory:

./autogen

If this does not work, try:

./autogen.sh

The following instructions apply both when you’re building from a source package and when you’re building from CVS.

Run the following command:

./configure [options]

Here, [options] is a list of package-dependent options; run ./configure –help for a list. Often, –enable-debug produces a build with some debugging options enabled, and other –enable- options can be used to enable or disable specific features. –prefix= can be used to install the program to another directory than the default /usr/local.

If ./configure runs without errors, you can now start compiling:

make

And finally, install the package (this last command will usually, depending on your installation prefix, need superuser privileges):

make install

Build mini-FAQ

:?: When running ./configure, I get an error message from pkg-config claiming that Poslib cannot be found, but I did install Poslib. What’s wrong?

:!: Try entering

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

(substitute /usr/local by your own Poslib installation prefix if you changed it). That should fix the problem.

 
  misc/building.txt · Last modified: 2005/01/09 12:24
 
Copyright © Meilof Veeningen, 2002-2005 - About Posadis.org