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

Re: Long-term mass bug filing for crossbuild support



On Tue, 06 Nov 2007 17:18:57 -0800
Russ Allbery <rra@debian.org> wrote:

> Neil Williams <codehelp@debian.org> writes:
> 
> > The most common change is simply to retrieve the cross-building
> > metadata from dpkg-architecture in debian/rules:
> > http://wiki.debian.org/EmdebianGuide
> 
> > DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
> > DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
> 
> > Depending on whether the package uses ./configure:
> > ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
> > CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
> > else
> > CROSS=
> > endif
> 
> This is a bad suggestion and was apparently made without referring to the
> existing Debian instructions for how to handle packages that use Autoconf
> and friends. 

Your assumption is wrong, I'm afraid. For one reason or another, I
spend a lot of time in the autofoo documentation. Must be crazy, yes,
yes....

> Please see the autotools-dev instructions, which are more
> detailed and which correctly recommend:
> 
> DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
> DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
> ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
>     SYSTEM = --build $(DEB_HOST_GNU_TYPE)
> else
>     SYSTEM = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
> endif
> 
> # ...
> 
>         ./configure $(SYSTEM)        

Actually, /usr/share/doc/autotools-dev/README.Debian.gz differs from
that by specifying $(confflags) instead of SYSTEM and using 'export'. I
don't see what benefit arises from the only other difference, ?=
instead of =. When cross-compiling, it isn't sensible to allow the
value to be overridden elsewhere. The value is set in the
cross-compiling tools via dpkg-architecture and should be read into
debian/rules as such. 

As noted elsewhere in this thread, --build can be specified alone but is
usually only used for specialist builds for i686 on i386 etc. I fail to
see the merit of proposing that packages add --build to the normal
Debian build for no reason.

I don't see why this makes the proposed change "bad". Please explain
why ?= is better than = in this specific instance and why I should use
SYSTEM instead of CROSS (when the "recommended" one is $(confflags)
anyway) or add --build to every package instead of leaving the variable
as empty.

AFAICT there is no material reason to use the autofoo recommended
layout and no justification for calling my layout "bad" merely because
of minor changes in variable names.

-- 


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

Attachment: pgpVujWSXjiew.pgp
Description: PGP signature


Reply to: