[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Creating debs using a cross-build environment?



On Thu, 2012-02-23 at 13:00 +0100, Hector Oron wrote:
> Hello,
> 
> 2012/2/23 Jonathan Nieder <jrnieder@gmail.com>:
> 
> > I don't know the emdebian cross tools well, but I believe they are
> > built from the standard Debian binutils and gcc packages by setting
> > appropriate variables at build time to request that they target
> > another architecture.  See
> > https://wiki.debian.org/BuildingCrossCompilers for details.

They obviously target other architectures, i.e. CPUs, not OSes like
GNU/kFreeBSD or GNU/Hurd.

> Most underlying mechanisms assume Linux kernel, AFAICT, none has
> attempted to change those to use another kernel, but that might be
> possible changing Linux kernel headers by some other kernel headers.

I've looked at this web page (and several other guides and web pages).
The Debian web page does not help much in creating a cross compiler for
another kernel than GNU/Linux. These steps I already have done and
written down for the GNU/Hurd OS. Anybody interested? 

My questions and aims are:
Assuming the cross and target build environment is available, as above.

BUILD=x86_64-linux-gnu
TARGET=i486-gnu
TOOLS=/somewhere/cross_tools
SYSROOT=/somewhere/target_tools

Current method:
===============
apt-get source package
mkdir build-package
cd build-package
../package/configure --build=$BUILD --host=$HOST (+ other options)
make all
make install
No .deb package is created, all headers, libraries and executables are
directly installed in $SYSROOT.

With cross-build dpkg-support:
==============================
Set up where the cross tools and target headers, libraries and
executables are located.
cd package
DEB_BUILD_GNU_TYPE=$BUILD DEB_HOST_GNU_TYPE=$TARGET dpkg-buildpackage -b
That will create .debs to be installed on the target box or in $SYSROOT.

The gnat issue is related but separate from the above description. For
gnat we have a chicken-and-egg situation (as often is the case with
compilers).

Thanks!


Reply to: