Re: Detecting build architecture
On Wed, Jan 12, 2011 at 01:19:18PM +0100, Andreas Tille wrote:
> Hi,
Hello,
> I try to build a package which needs information about the architecture
> at compile time. Upstream said I need to set ARCH_64=1 if the
> architecture has 64 bit *pointers* (they said on architectures with 64
> bit integers and 32 bit pointers the programm needs to be compiled as 32
> bit). Is there any safe way to obtain this information automatically or
> do I need to do some lookup in a table with `dpkg --print-architecture`
> as key (and if yes how would this table look like in the sense above)?
See dpkg-architecture(1), in particular:
$ dpkg-architecture -qDEB_BUILD_ARCH_BITS
If I understood what you need, in your d/rules (or Makefile), you have to
do something like:
DEB_BUILD_ARCH_BITS=$(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS)
ifeq ($(DEB_BUILD_ARCH_BITS), 64)
ARCH_64=1
endif
Cheers
--
perl -E'$_=q;$/= @{[@_]};and s;\S+;<inidehG ordnasselA>;eg;say~~reverse'
Reply to: