Differences between revisions 2 and 3
Revision 2 as of 2009-03-16 03:32:11
Size: 3643
Editor: anonymous
Comment: converted to 1.6 markup
Revision 3 as of 2009-07-15 15:53:26
Size: 3479
Editor: GeoffSimmons
Comment: Formatting fixes, link pentium-builder; drop woody, kernel 2.0/2.4 references and broken link.
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Index: <<TableOfContents>>
<<TableOfContents>>
Line 67: Line 66:
If you're building older kernel sources on newer versions of Debian, you may have to use an older version of gcc than the default.  For example, to build a 2.0.* kernel on woody, you should install the {{{gcc272}}} package and edit the top-level kernel {{{Makefile}}} to replace gcc with gcc272. Likewise, to build older 2.4.* kernels on sid, you may have to replace gcc with gcc-2.95. If you're building older kernel sources on newer versions of Debian, you may have to use an older version of gcc than the default.
Line 74: Line 73:
deb-src http://http.us.debian.org/debian/ stable main contrib non-free}}} deb-src http://http.us.debian.org/debian/ lenny main contrib non-free}}}
Line 76: Line 75:
(If you're trying to build a backport, you may want unstable instead of stable. It won't hurt you because this is only source code.) Then: (If you're trying to build a backport, you may want sid instead of lenny. It won't hurt you because this is only source code.) Then:
Line 78: Line 77:
{{{apt-get update {{{
apt-get update
Line 87: Line 87:
(or {{{dpkg-buildpackage -uc -us -rfakeroot}}} if you prefer). For more details, see the next question. ##(or {{{dpkg-buildpackage -uc -us -rfakeroot}}} if you prefer). For more details, see the next question.
(or {{{dpkg-buildpackage -uc -us -rfakeroot}}} if you prefer).
Line 89: Line 90:
== Is there a good howto on building debian packages? ==

Try http://www.linuks.mine.nu/irc/debian-packaging/ which is a very short introduction with nice pointers.
## HTTP 404 as at 2009-07-16
##
== Is there a good howto on building debian packages? ==
##
##Try http://www.linuks.mine.nu/irc/debian-packaging/ which is a very short introduction with nice pointers.
Line 95: Line 97:
Install the {{{pentium-builder}}} package and read the instructions. Install the DebianPkg:pentium-builder package and read the instructions.

Development questions

I'm trying to build something and it says "C compiler cannot create executables".

apt-get install build-essential

I'm trying to configure my kernel with make menuconfig, and it says "curses.h not found".

apt-get install build-essential libncurses5-dev

What do I need to build GTK+ programs?

apt-get install libgtk1.2-dev

for GTK+, or

apt-get install libgtk2.0-dev

for GTK+2. No, you cannot compile a GTK+ application against GTK+2. The APIs are not compatible.

What do I need to build programs that require glib, but not GTK+?

apt-get install libglib1.2-dev

but note that this should be relatively rare, since usually you will have acquired libglib1.2-dev by installing libgtk1.2-dev.

What do I need to build QT programs?

apt-get install libqt3-mt-dev

What do I need to build SDL programs?

apt-get install libsdl1.2-dev

What do I need to build programs that use libz?

apt-get install zlib1g-dev

What do I need to build programs that use X?

apt-get install xlibs-dev

How do I build a kernel the Debian way?

apt-get install build-essential kernel-package

Also install libncurses5-dev if you want to use menuconfig, or libgtk1.2-dev for gconfig in 2.6. Install bin86 for 2.2 or earlier kernels on the i386 architecture.

Extract your kernel source, cd into the resulting directory, apply any patches you wanted (optional), then run the command

make-kpkg --revision=custom.1 binary-arch

This should create two .deb files in the parent directory. You can change the revision string to include a hostname, etc.

If you have third party modules in /usr/src/modules/ then add modules_image to the end of the make-kpkg command to build a package for the modules. (This applies to PCMCIA, NVidia, ATI, etc. It doesn't apply to modules which are part of the Linux source tree, that you marked with M.)

If you're building older kernel sources on newer versions of Debian, you may have to use an older version of gcc than the default.

How do I recompile a Debian package from source?

First, add a deb-src line to your sources.list file. For example,

deb-src http://http.us.debian.org/debian/ lenny main contrib non-free

(If you're trying to build a backport, you may want sid instead of lenny. It won't hurt you because this is only source code.) Then:

apt-get update
apt-get build-dep mypackage
apt-get -b source mypackage

The resulting .deb files will be in the current directory. If you want to make modifications to the source code before you build it, then omit the -b option, cd into the resulting directory, make your changes, and then run:

fakeroot debian/rules binary

(or dpkg-buildpackage -uc -us -rfakeroot if you prefer).

How do I recompile packages with CPU-specific optimizations?

Install the pentium-builder package and read the instructions.