RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Which of {host,build,target} to use in configure.ac?

From: Peter O'Gorman <peter@pogma.com>
Date: Wed 13 Aug 2008 - 17:55:18 CEST
Message-ID: <48A303E6.40407@pogma.com>
Jeff Johnson wrote:
> I'm integrating a patch to make rpm's build more cross-platform ready.
> 
> So here's how ${target_cpu} is currently used in configure.ac to
> choose RPMCANONCOLOR:
> 
>     RPMCANONCOLOR=3
>     case "${target_cpu}" in
>     *86)            RPMCANONARCH=i386 ;;
>     ia32e*)         RPMCANONARCH=ia32e ;;
>     amd64*)         RPMCANONARCH=amd64 ;;
>     x86_64*)        RPMCANONARCH=x86_64 ;;
> 
> Examinig rpm.org git, I see ${host_cpu} being used instead:
> 
>     case "${host_cpu}" in
>     *86)            RPMCANONCOLOR=0; RPMCANONARCH=i386 ;;
>     ia32e*)         RPMCANONCOLOR=3; RPMCANONARCH=ia32e ;;
>     amd64*)         RPMCANONCOLOR=3; RPMCANONARCH=amd64 ;;
>     x86_64*)        RPMCANONCOLOR=3; RPMCANONARCH=x86_64 ;;
> 
> And originally, rpm's configure.ac used ${build_cpu} (from the patch I'm
> integrating):
> 
>     @@ -934,7 +937,7 @@
>      autorelocate_path='%{nil}'
>      autorelocate_dcolor='0'
>      RPMCANONCOLOR=3
>     -case "${build_cpu}" in
>     +case "${target_cpu}" in
>      *86)           RPMCANONARCH=i386 ;;
> 
> Heh ...
> 
> What is the proper usage? I see all of {host,build,target} having been
> used, with
> no clear differentiator, mostly because I don't cross compile rpm.

$host_*is the machine that the final binary will run on.
$build_* is the machine that it is being built on,
$target_* is for compilers etc. (they could be built on one machine, run
on another and generate binaries for a third). It is generally the same
as $host_ (but in places where rpm is using $target_, it is highly
likely that it should be using $host_)

Peter
-- 
Peter O'Gorman
http://pogma.com
Received on Wed Aug 13 18:01:47 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.