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: Nick Bowler
Subject: Re: building tools during a cross-compilation
Date: Wed, 29 Jan 2014 10:25:27 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

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]