Building source from apt
Debian provides a few tools for building source packages downloaded from apt. This is useful for building debugging versions of libraries. Note that you may need to install build-essentials, fakeroot and cdbs before you start to build.
Obtaining the sources
Create a directory to unpack the sources into, and download:
$ mkdir xyz $ cd xyz $ apt-get source libxyz-1.0
Note that this is done as a regular user
Build the sources
Download the supporting packages and build the source.
$ sudo apt-get build-dep libxyz-1.0 $ cd libxyz-1.0 $ CXXFLAGS=-g fakeroot debian/rules binary
CXXFLAGS part is only needed to build a debugging version of the package. You can use -j2 if you are on a dual processor system.
Use them for your own program
You will need to find the
lib directories, which will be somewhere below the
debian directory. Something similar to the following lines can then be added to your makefile:
CXXFLAGS += -I xyz/libxyz-1.0/debian/.../include LDFLAGS += -L xyz/libxyz-1.0/debian/.../lib