Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Steven Watanabe <watanabesj <at> gmail.com>
Subject: Re: Native-built tools in a cross-compile environment
Newsgroups: gmane.comp.lib.boost.build
Date: Friday 19th October 2012 14:34:35 UTC (over 4 years ago)
AMDG

On 10/15/2012 05:53 PM, Kylo Ginsberg wrote:
> I have ported a project using boost-build from Windows (using msvc) to
> Linux (using gcc), and am now porting it further to a cross-compiled
> Linux (also using gcc).  I want to support all 3 platforms long-term
> (Windows, native Linux, cross-compiled Linux).
> 
> I've put in the basic support for cross-compilation, simply by adding
> a new "using gcc ..." line.  However, this project uses some
> code-generating build tools which are built afresh with every build --
> with my current basic support for cross-compilation, these build tools
> are cross-built and thus don't run on the build machine.  In short,
> these need to be native built at all times and I'm not sure how best
> to specify this.  Is there a best practice for this scenario?
> 
> I can certainly provide more detail on the organization of the
> Jamfiles, etc, but figured I'd start with a short-ish note ;>
> 

# user-config.jam
using msvc ;
using gcc ;
import toolset ;
# globally force the toolset to msvc when building
# for windows
toolset.add-requirements windows:msvc ;

# Jamfile

# force target-os to be the same as host-os
rule native-tool ( properties * )
{
    local host = [ property.select  : $(properties) ] ;
    return $(host:G=) ;
}

exe tool : tool.cpp : @native-tool ;

If  isn't sufficient to distinguish
the host from the target, you can define a new
feature:

import feature ;
import toolset ;
feature.feature native-build : on : optional propagated ;
toolset.add-requirements on:gcc-4.7.2 ;

...

exe tool : tool.cpp : on ;

In Christ,
Steven Watanabe
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
 
CD: 4ms