I work for RIM (ie BlackBerry), and am trying to make using boost as easy as possible to use for BB developers. So I would like to make building boost for BB as easy as possible. I would also like to make building boost work "as expected" for anyone who understands Boost.Build. It is the "as expected" part that I'm not sure of. ie should I just offer a blackberry-config.jam? should Boost.Build be changed to auot-detect the BB NDK? should blackberry be a toolset? a target-os? ...? how would you *expect* it hook into Boost.Build? (And note that I expect that developers *also* use the same boost for Windows, etc, so I don't want to replace/affect the simple build for the host machine.) - And finally, it would be nice if this was upstreamed back into boost build (if people think that makes sense), so that boost "just works" on BlackBerry. Here's what I have so far: from the command line, you run something like: b2 install --prefix=C:\boost\ --user-config=blackberry-config.jam --layout=system toolset=gcc target-os=qnxnto I'd prefer it if they didn't need to type so much. And the config file looks like basically the rest of this email: import os ; # these env vars are set by installing the BB NDK QNX_TARGET_ARCH = [ os.environ QNX_TARGET_ARCH ] ; QNX_TARGET = [ os.environ QNX_TARGET ] ; QNX_HOST = [ os.environ QNX_HOST ] ; if ! $(QNX_TARGET) || ! $(QNX_HOST) { ECHO error: ; ECHO error: BlackBerry build of Boost requires QNX_TARGET and QNX_HOST env variables. Did you run bbndk-env.bat? ; ECHO error: ; EXIT ; } if $(QNX_TARGET_ARCH) = x86 { dashVOpt = gcc_ntox86_cpp ; linkArchDir = x86 ; } else { dashVOpt = gcc_ntoarmv7le_cpp ; linkArchDir = armle-v7 ; } using qcc # Version : # C++-compile-command : $(QNX_HOST)/usr/bin/QCC -V$(dashVOpt) # Compiler options : <compileflags>"-D__QNX__" <compileflags>"-D__QNXNTO__" # Add -D__USE_ISOC99 for rounding control mechanism (boost/numeric/interval/hw_rounding.hpp) <compileflags>"-D__USE_ISOC99" <compileflags>"-I$(QNX_TARGET)/usr/include" # Prevent this from being output: "note: the mangling of 'va_list' has changed in GCC 4.4" <compileflags>"-Wno-psabi" # Add -fPIC to link without error to LibTestNativeLibTuTest.o (for statechart tests) <compileflags>"-fPIC" # Requested by BBM team <compileflags>"-fno-strict-aliasing" # Functions like sync_val_compare_and_swap and sync_fetch_and_add aren't available <compileflags>"-DBOOST_SP_NO_SYNC" <linkflags>"-L$(QNX_TARGET)/$(linkArchDir)/usr/lib -L$(QNX_TARGET)/$(linkArchDir)/lib" ; import option ; option.set keep-going : false ; ------------------------ Thanks in advance, Tony
AMDG On 10/23/2012 11:03 AM, Gottlob Frege wrote:
I work for RIM (ie BlackBerry), and am trying to make using boost as easy as possible to use for BB developers. So I would like to make building boost for BB as easy as possible. I would also like to make building boost work "as expected" for anyone who understands Boost.Build. It is the "as expected" part that I'm not sure of.
ie should I just offer a blackberry-config.jam? should Boost.Build be changed to auot-detect the BB NDK? should blackberry be a toolset? a target-os? ...?
how would you *expect* it hook into Boost.Build?
I would say that this should be a modification of the qcc toolset to deduce as much as possible. However, I don't really know anything about the compiler: a) What exactly does the setup script do? Normally, I'd expect to be able to write bbndk-env.bat && QCC ... and expect it to work. Does it really just set environment variables that have to be manually passed to the compiler? b) What would be the implications of having using qcc : : : <setup>/path/to/bbndk-env.bat ; Is qcc used for other platforms? If so, do they also have setup scripts? How does the behavior differ?
<snip>
using qcc # Version :
# C++-compile-command : $(QNX_HOST)/usr/bin/QCC -V$(dashVOpt)
# Compiler options : <compileflags>"-D__QNX__" <compileflags>"-D__QNXNTO__"
Is this really necessary? It would be better to rely on the compiler's built-in macros, if possible. (Even if that means changing the Boost source).
<snip>
In Christ, Steven Watanabe
Thanks for replying.
Answers, or at least responses, inline:
On Tue, Oct 23, 2012 at 2:57 PM, Steven Watanabe
AMDG
I would say that this should be a modification of the qcc toolset to deduce as much as possible. However, I don't really know anything about the compiler:
qcc is a small wrapper around gcc, I think. It works for anything compiling to QNX (the base OS), not just "BlackBerry", which is somehow different. (QNX is still a microkernel OS used in a crazy number of strange places, not just for BlackBerry devices). Although when compiling boost, any blackberry vs qnx differences probably are moot.
a) What exactly does the setup script do? Normally, I'd expect to be able to write bbndk-env.bat && QCC ... and expect it to work. Does it really just set environment variables that have to be manually passed to the compiler?
Basically, for most BB mobile development, you build from the IDE (custom IDE based on Eclipse), so you don't see the env variables, etc. You only see them for command line work. And actually I don't know if the IDE uses the same variables, or uses some other mechanism (I suspect the latter), so maybe the env vars are really only for command line. But they aren't just for building boost. They will be used if you are building your own code on the command line. ie They are also used via qmake (ie Qt, which most BB C++ apps use), so I think that's another reason why they have been refactored out into evn vars. Mostly I was hoping not to change what currently exists (ie the env vars and bbndk.bat) but just use it to build boost.
b) What would be the implications of having using qcc : : : <setup>/path/to/bbndk-env.bat ; Is qcc used for other platforms? If so, do they also have setup scripts? How does the behavior differ?
I haven't looked into <setup>. Sounds like I should. Does it run at the start of boost build, or for every run of qcc called by boost build, or ...? As mentioned above, qcc is just gcc for qnx. Not even sure of any differences. Maybe the QNX guys just like the letter q. Assume it works the same as gcc (definitely takes the same args, etc).
<snip>
using qcc # Version :
# C++-compile-command : $(QNX_HOST)/usr/bin/QCC -V$(dashVOpt)
# Compiler options : <compileflags>"-D__QNX__" <compileflags>"-D__QNXNTO__"
Is this really necessary? It would be better to rely on the compiler's built-in macros, if possible. (Even if that means changing the Boost source).
I adopted this config file (ie I'm not the original author), so I'm not completely sure. If the compiler is just a thin gcc wrapper, maybe it is too thin, and doesn't even set macros like this. I'll look into it. I agree Boost source should use whatever the "official" macros are, if any. But boost has supported qnx for a long time, so I suspect it is doing it correctly. More likely is that this config file is being overly paranoid...
<snip>
In Christ, Steven Watanabe
Thanks! Tony
participants (2)
-
Gottlob Frege
-
Steven Watanabe