automake
[Top][All Lists]
Advanced

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

Re: building tools during a cross-compilation


From: Pierre Phaneuf
Subject: Re: building tools during a cross-compilation
Date: Wed, 29 Jan 2014 11:26:34 -0500

Since the tool shares code with the main binary, distributing it
separately is inconvenient. One of the platforms targeted is Windows,
so having it in C++ is easiest, since a scripting language would
require users to install even more tools. And there's really a pile of
resource files, the point of it is to avoid distributing them...

That leaves AX_CC_FOR_BUILD (and some digging around found
AX_PROG_CXX_FOR_BUILD, which is similar, but for C++), might do the
trick, thanks!

I'm hoping to change our code to use PhysFS, to get data out of ZIP
archives, and simply get rid of the resource compiler tool, but you
know how this is, all takes time...

Thanks again!

To the other poster: I'm not touching --build option (leaving it to
whatever I'm on), but I want to be able to build one binary that can
run on --host (the usual thing), and one binary that runs on --build
(not the usual!), in the same build.

On Wed, Jan 29, 2014 at 10:25 AM, Nick Bowler <address@hidden> wrote:
> On 2014-01-29 05:10 +0000, Pierre Phaneuf wrote:
>> I've just set up a Makefile.am for a package I'm working on, and it's going
>> pretty well, but I've hit a snag with cross-compilation...
>>
>> This package installs a binary and a resource file. That resource file is
>> build with a special tool that is build by the Makefile.am. When I
>> cross-compile, it works well for the main binary (very easy, great job!),
>> but it builds the tool binary for the --host platform, rather than the
>> --build, so the resource file cannot be built.
>
> Unfortunately, there is not really an ideal solution to this problem.
> Here's a few options, each with their own tradeoffs:
>
>  - You can distribute your build tool(s) in a separate package, and
>    require them to be installed by the user before building your main
>    package.
>
>  - You can rewrite the tool(s) in a language for which interpreters
>    are available on the build machine (e.g., sh, awk).  Then you can
>    easily run them directly on the build machine.
>
>  - Instead of building the resource file at build time, install its
>    sources and any necessary tools so that it can be generated after
>    installation (e.g., when your program is first run).
>
>  - You could try something like the AX_CC_FOR_BUILD[1] macro in the
>    autoconf archive to actually find a compiler for the build system.
>
> [1] 
> http://git.savannah.gnu.org/cgit/autoconf-archive.git/tree/m4/ax_cc_for_build.m4?id=v2013.11.01
>
> Cheers,
> --
> Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]