Introduction

This page is aimed at both Debian and upstream developers, talking about things to keep in mind when developing a program or packaging it so that it remains portable.

See also

Compare built status of packages across many arches, including the lesser-known ones; provide a maintainer email address as p= parameter, for example the XFCE team's summary:

Cross Compiling

Terminology

Build
The system the software is being compiled on.
Host
The system the software will run on.
Target
When building a compiler, the system the software built by the compiler will run on.

Package Build

($DEB_BUILD_ARCH, $DEB_HOST_ARCH, $DEB_TARGET_ARCH & co.)

Reduce the amount of arch-specific Build-Depends by building whatever is possible (documentation for example) in a binary-indep target, hence those dependencies become Build-Depends-Indep and only one architecture needs these.

Building and Running Tools

Best Practices

Autoconf and Automake

(how to build a toplevel project)

Programming Considerations

(Link to ArchitectureSpecificsMemo?)

Integral Types

Endianness

Alignment

Floating Point Behaviour

Page Sizes

Feature vs System detection

System detection (usually wrong)

config.{guess,sub}

uname

CPP system macros

Other system checks ...

Check for specific functionality (good)

(autoconf)

Build Failures

Unportable ioctls

Limiting macros

(PATH_MAX and friends)

Optional POSIX features

Kernel/System dependencies

(linuxisms: mount, linuxthreads abuse)

(bsdisms: sys_errlist[] vs. strerror())

Runtime Failures

/proc

/sys

devfs on kFreeBSD

(some nodes are not allowed on FreeBSD's devfs)

Missing kernel features

(sysv shm)

Hardcoded values instead of using macros

(open())

Making dirs ending with a slash '/'


CategoryEmdebian CategoryPorts