[Top][All Lists]

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

Re: A way to specify a host CC during cross compile?

From: Daniel Herring
Subject: Re: A way to specify a host CC during cross compile?
Date: Tue, 5 Apr 2011 01:42:28 -0400 (EDT)
User-agent: Alpine 2.00 (LNX 1167 2008-08-23)

On Tue, 5 Apr 2011, Dave Hart wrote:
On Mon, Apr 4, 2011 at 22:15 PM, Martin Hicks <address@hidden> wrote:
Is there a way to specify a different compiler for compile-time helper
programs that are used during the build of a package?

I think the short answer is no.  I have some source files in a package
which are built by running a C program, which would be a use case for
$HOSTCC-type functionality.  I use a cross-compiling AM_CONDITIONAL to
disable the rules for updating those generated sources, and I
distribute them.  The result is changes to the sources of the
generated sources must be built in a non-cross-compile environment,
then the up-to-date generated sources can be transported (such as via
make dist, or committing to SCM) to the cross-build environment.

Similar story here. HOSTCC is rarely the whole story. You may need to split the project into two parts, one for the build machine and one for the executable host/target.

proj/ # for host machine
proj/tools/ # for build machine

By default, the top build system recursively configures and builds the tools. For a cross-compile, the tools can be configured separately. My systems use --with-tools= to specify this situation.

Make does allow you to specify target-specific variables; so that might be easier in some cases. I have also done address@hidden@ to override the default in a single makefile...

- Daniel

reply via email to

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