dpkg-cross

Langue: en

Version: 2010-05-23 (ubuntu - 24/10/10)

Section: 1 (Commandes utilisateur)

Name

dpkg-cross - manage libraries for cross compiling
  Copyright (C) 1997-2000  Roman Hodek <roman@hodek.net>
  Copyright (C) 2000-2002  Colin Watson <cjwatson@debian.org>
  Copyright (C) 2002-2004  David Schleef <ds@schleef.org>
  Copyright (C) 2004  Nikita Youshchenko <yoush@cs.msu.su>
  Copyright (C) 2004  Raphael Bossek <bossekr@debian.org>
  Copyright (c) 2007-2008  Neil Williams <codehelp@debian.org>
 
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
 
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
 
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 

SYNOPSIS

  dpkg-cross [ -v | --verbose ] [ -q | --quiet ] [ -A | --convert-anyway ]
  [ -X | --exclude PACKAGE ] [ -k | --keep-temp ] { -i | --install 
  | -b | --build | -r | --remove | --purge | -s | --status | -l | --list 
  | -L | --list-files | -u | --update | -Q | --query } 
  { -a | --arch architecture} package [package ... ]
 
 

DESCRIPTION

dpkg-cross is a tool to install and manage libraries and header files for cross compiling. dpkg-cross converts native Debian packages for the target architecture to cross compiling support packages that can be installed on any architecture, but in different paths to avoid conflicts. It then calls dpkg to install the converted package. The conversion step alone can be done with the --build option. Other options are wrappers around corresponding dpkg functionality.

dpkg-cross is intended to make it easier for you to keep your cross compiling libraries up-to-date, as it works directly on Debian packages. It saves you copying the libs and headers from a machine with your target architecture, or extracting them via dpkg-deb --fsys-tarfile.

dpkg-cross also collects and install the .shlibs files in -dev packages, which are needed by dpkg-shlibdeps.

dpkg-cross works in the directories defined in /etc/dpkg-cross/cross-compile; see cross-compile(5) for more information.

CMAKE

CMake cross-building support is experimental!

CMake requires a little support from dpkg-cross to cross-build. The included cmake support file is an example for Linux kernels. Use:

  rm CMakeCache.txt
  cmake -DCMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt
 
 

The main changes involve setting PKG_CONFIG_LIBDIR within CMake an setting the include directories to locate the cross libraries installed by dpkg-cross e.g.

  #Make pkg-config look in the right place
  SET(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig/)
  ELSE (CMAKE_CROSSCOMPILING)
 
 

Packages using cmake may need some tweaks to debian/rules, e.g.

  ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
  export CC=$(DEB_HOST_GNU_TYPE)-gcc
  export CXX=$(DEB_HOST_GNU_TYPE)-g++
  export CMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt
  else
  export CC=gcc
  export CXX=g++
  endif
 
 

OPTIONS

dpkg-cross follows the usual GNU command line syntax, with long options starting with two dashes ('-').
  -h|--help
 
 

Show summary of options.

  -v|--verbose
 
 

Be more verbose.

  -q|--quiet
 
 

Be more quiet.

  -a|--arch architecture
 
 

Install for architecture architecture.

  -i|--install
 
 

Install Debian packages (.deb) named on the command line. Only files in the directories /lib, /usr/lib, /usr/X11R6/lib, /usr/include and /usr/X11R6/include are extracted, since only they can be relevant for cross compiling. In the lib directories, also no subdirectories are extracted.

  -A|--convert-anyway
 
 

Convert Debian package even if it does not provide any files useful for cross-compile environment.

  -X|--exclude PACKAGE
 
 

Removes the specified package from the dependencies of the current package. Typically used to drop dependencies on packages that are not required within a cross-build environment, e.g. packages containing only executables or architecture independent files.

dpkg-cross can only check the current package and information about a dependency is not available (for that, use apt-cross). By default, dpkg-cross converts all dependencies to specify the cross version of the dependency package.

If you know that a particular dependency should not be converted (it provides no useful files or is architecture independent), that dependency can be excluded and dpkg-cross will remove that package from the dependency information of the cross package. -X has replaced the use of keepdeps and removedeps in /etc/dpkg-cross/cross-compile.

-X|--exclude PACKAGE needs to be repeated for each package to be excluded.

  -k|--keep-temp
 
 

Keep the built and installed package instead of deleting it. Useful with apt-cross -k. Requires --install.

  -b|--build
 
 

Just build the converted Debian package, but do not install it with dpkg.

  -r|--remove
 
 

Remove the cross compiling packages named on the command line.

  -s|--status
 
 

Print status of the named packages.

  -l|--list
 
 

Print short version of status of named packages or package name patterns.

  -L|--list-files
 
 

List files belonging to the named packages.

  -u|--update
 
 

Update current cross-installation with Debian packages found in/under the paths given as arguments. Will check all packages there if they are installed already as cross-compiling packages and if they are really updates. Those packages will be installed as with -i.

  -Q|--query
 
 

Much like --update, but just prints available update packages and does not install them.

FILES

/etc/dpkg-cross/cross-compile defines some settings for dpkg-cross and can be overridden by an optional file in your home directory: $HOME/.dpkg-cross/cross-compile - see also apt-cross.

Only default_arch is used routinely.

  default_arch (default: none)
 
 

The default architecture for dpkg-cross is normally set by debconf. To change the system-wide value, use:

  $ sudo dpkg-reconfigure dpkg-cross
 
 

Alternatively, the default can be overridden on a per-user basis using the optional file in $HOME/.dpkg-cross/

Other values previously used in this file for legacy code are now unsupported.

Multiarch behaviour

Files

/etc/dpkg-cross/multiarch-cross.d/

Any file in this directory will be expected to contain a simple list of binary package names which are multiarch-compliant for all uses of dpkg-cross on that system.

apt-cross includes a helper script to identify these packages (/usr/share/apt-cross/update-multiarch.pl or you can use:

  grep-aptavail -s Package -F Multi-Arch same
  grep-aptavail -s Package -F Multi-Arch foreign
  grep-aptavail -s Package -F Multi-Arch allowed
 
 

See:

  https://wiki.ubuntu.com/MultiarchSpec
 
 

Constraints

Absolute and total reliance on the accuracy of a config file created, updated and maintained by a separate process, e.g. update-multiarch.pl from apt-cross.
If this package name exists in that config file, create a multiarch version
multiarch versions have NO files in the package of any kind.
multiarch versions have a mangled description indicating a zombie package
multiarch versions depend on the multiarch native package, i.e. libfoo-ARCH-cross depends on libfoo at or greater than the version of libfoo that first includes multiarch support.
multiarch versions include a new control field: X-Multiarch: delete