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

Re: debian/rules and environment variables



On Wed, 05 Sep 2007 22:51:30 +0200
Bernd Zeimetz <bernd@bzed.de> wrote:

> Hi,
> 
> > On a related note, I'm thinking that *all* packages using ./configure
> > should be using:
> > DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
> > DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
> > ...
> > ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
> >  ...
> > 
> > This then allows cross-builders to simply call dpkg-architecture to set
> > the correct environment and ./configure will do the right thing.
> 
> What about packages which do not use configure?

Then it is up to the cross-building scripts to set the correct
environment and up to the package NOT to override those environment
settings. Right now, the way to do this is being rewritten and previous
behaviour is known to be causing build failures so just try to leave
the environment variables alone.

If you need to change the upstream behaviour, use a patch. Get your
package to build cleanly on a native system (i.e. without overwriting
environment variables) and it should cross-build cleanly.

> Are there any rules to follow, especially if you need to pass CC and
> other options to upstream's build system, 

Don't do that. There should be no reason to change CC. If you want
optimisations, that's CFLAGS or CPPFLAGS.

> which is just a bunch of
> Makefiles in this case. Although I doubt that anybody would
> cross-compile this package, I'd appreciate some general hints.

Every package is likely to need to be cross-compiled by someone at some
point - except Architecture: all. That's why I was working on a patch
for gcc during Debconf - to cross-build gcc using a gcc cross-compiler
to package libraries built from the gcc source on amd64 (or powerpc) to
link against packages cross built for arm.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

Attachment: pgphdk5HeqqMd.pgp
Description: PGP signature


Reply to: