Difference between revisions of "Building source from apt"

From LSDevLinux
Jump to: navigation, search
m (Reverted edits by Rossanewalters (Talk) to last revision by Eberhard)
 
Line 16: Line 16:
  
 
== Use them for your own program ==
 
== Use them for your own program ==
You will need to find the <code>include</code> and <code>lib</code> directories, which will be somewhere below the <code>debian</code> directory. Something similar to the following lines can then be added to your makefile [http://customessaywriting.us/ analytical essay]:
+
You will need to find the <code>include</code> and <code>lib</code> directories, which will be somewhere below the <code>debian</code> directory. Something similar to the following lines can then be added to your makefile:
 
  CXXFLAGS += -I xyz/libxyz-1.0/debian/.../include
 
  CXXFLAGS += -I xyz/libxyz-1.0/debian/.../include
 
  LDFLAGS  += -L xyz/libxyz-1.0/debian/.../lib
 
  LDFLAGS  += -L xyz/libxyz-1.0/debian/.../lib
  
 
[[Category:Linux tools]]
 
[[Category:Linux tools]]

Latest revision as of 14:39, 4 October 2012

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

Note the 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 include and 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