RPM Community Forums

Mailing List Message of <rpm-devel>

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

From: Dan Nicholson <dbn.lists@gmail.com>
Date: Wed 13 Aug 2008 - 19:20:22 CEST
Message-ID: <91705d080808131020g44196041v660e9d853a2f4858@mail.gmail.com>
On Wed, Aug 13, 2008 at 8:55 AM, Peter O'Gorman <peter@pogma.com> wrote:
> 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_)

The autoconf manual has a lot more information on this:

http://www.gnu.org/software/autoconf/manual/autoconf.html#Specifying-Names

The default rpm %configure passes --host=%_host, which is derived at
rpm build time. Probably better would be to pass %_target_platform as
--host, --build and --target.

--
Dan
Received on Wed Aug 13 19:20:24 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.