From: Reece Dunn (msclrhd_at_[hidden])
Date: 2004-11-19 10:40:05
>>What if you want to support cross-compilation? For example, I am
>>developing a GUI library in the sandbox that is aiming to support
>>Win32/64 API on Windows, Cocoa on MacOS, PalmOS API on PalmOS and X11,
>>Motif/Lesstif and GTK+ on Linux as well as the possibility for others.
>>The way I see it, I would need to define a feature, e.g. gui, and define
>>it like this:
>> win32 win64 cocoa palmos x11 motif gtk custom
>>But then how do I add <define>s specific to the platform, e.g.:
>> win32 --> <define>PLATF_WINDOWS <define>PLATF_WIN32
>> cocoa --> <define>PLATF_MACOS <define>PLATF_COCOA
> How about the very last code example at:
> by replacing <library> with <define> and <parallelism> with <gui>, you should
> get pretty close.
Cool! This is exactly what I'm looking for :).
>> exe guiapp : guiapp.cpp gui//libgui : <gui>win32 ;
>>work as well as:
>> exe guiapp : guiapp.cpp gui//libgui ;
>> bjam release gcc-3.3 gui=win32
>> bjam release cw-8.3 gui=palmos
> I'd except yes.
> However, we might take the time to implement the right support for
> cross-compiling. So that you'd say:
> bjam release gcc-3.3 os=NT
> bjam release cw-83 os=palmos
> Your Jamfiles would have conditions for all supportest OSes:
> lib gui : .......... : <os>NT:<define>FOO <os>palmos:<define>BAR ;
> The only problem I see if that we need to adjust the tools so that they
> understand the <os> feature.
The <os> feature is currently builtin and defined to the OS that is
running (e.g. cygwin, linux, NT). Maybe this could be <target-os>, which
would allow you to leave <os> as the "host" operating system and
<target-os> as the os being compiled to.
E.g. bjam cw-8.3 target-os=mac # os=NT
One of the motivations for using <gui> as a feature, or a better name
might be <os-api>, is to allow support for different APIs, e.g.:
bjam msvc-8.0 os-api=win32
bjam msvc-8.0 os-api=win64
bjam gcc-3.3 target-os=linux os-api=x11
bjam gcc-3.3 target-os=linux os-api=motif
>>SIDE NOTE: When I compile a GUI application (<user-interface>gui) in gcc
>>using bjam, I get a console window as well as the GUI frame. Is there a
>>way to remove the console window in this configuration?
> I don't know. Do you have WinMain as entry point?
The WinMain entry point is implemented in lib gui. Maybe, if I add an
extern WinMain to the header included by the application it may work.
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk