gccross — a tool to wrap GCC calls in cross-compile aware manner
gccross [any parameter will be forwarded to GCC ]
gccross is a tool which changes pathnames of GCC command line arguments -I, -L and any standalone full qualified file name, as defined in cross-compile configuration file. The conversion rules are the same as used by dpkg-cross so in most cases use of gccross allows you not to change your Makefiles to cross-compile your application.
To use gccross without dpkg-buildpackage you have to create symlinks for your cross-compiler that point to gccross. gccross identifies your compiler and convert all calling parameters based on your configuration.
No conversion is done if the architecture is not specified. dpkg-buildpackage |
||
sets the environment variable ARCH by default so you do not have to worry about this. |
Using gccross outside of the Debian build process your have to choices where the host architecture is specified, cross-compile (local and system wide) or the environment variable ARCH
# export ARCH=powerpc
# for fn in cc cpp gcc g++; do ln −s /usr/share/dpkg-cross/bin/gccross /usr/local/bin/powerpc-linux-$fn; done
# export GCCROSS_PREFIX=/usr/bin/ccache
This example assumes that /usr/local/bin is in your PATH before the directory that contains real cross-compiler binary.
The GCCROSS_PREFIX environment variable makes it simple to let an secondary tool precede your compiler. In this example we use the ccache |
||
compiler cache. Without GCCROSS_PREFIX the compiler is called directly. |
gccross searches in PATH for compiler executable, skipping itself automatically.
When converting arguments, gccross leaves as is any pathnames that point to GCC library directory /usr/lib/gcc-lib and it’s subdirectories, as well as directories that contain headers and libraries for the target.
/etc/dpkg-cross/cross-compile
dpkg-cross(1), cross-compile(5), /usr/share/doc/dpkg-cross/README.Debian.gz
Raphael Bossek <bossekr AT debian DOT org>
Neil Williams <codehelp AT debian DOT org>
$Revision: 1.7 $
Copyright © 2007 Raphael Bossek
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.