Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

blackberry/Boost does not build on Windows #6

Open
LawrenceGunn opened this issue Apr 23, 2013 · 4 comments
Open

blackberry/Boost does not build on Windows #6

LawrenceGunn opened this issue Apr 23, 2013 · 4 comments

Comments

@LawrenceGunn
Copy link

I could not get the blackberry port of Boost to build. It seemed to be an issue related to shell scripts.

@nesteruk
Copy link

nesteruk commented May 5, 2013

Same here - you cannot run Bash scripts in windows (well, maybe with Cygwin).

@LawrenceGunn
Copy link
Author

I did have Cygwin (or similar, it was bundled with an app) and the scripts did start but errors happened part way through the scripts.

@nesteruk
Copy link

nesteruk commented May 5, 2013

You also need Python installed, I think. At any rate, it would be much better if we had a CSscript for Windows.

@tvaneerd
Copy link
Collaborator

tvaneerd commented May 6, 2013

Here's how I build 1.52 and/or 1.53, which build almost "out of the box" (search boost's trac system for any qnx fixes that have yet to be upstreamed)

  • bootstrap boost as usual (you might even want to do a build of boost for windows, to make sure you have it bootstrapped correctly)
  • have BB10 NDK installed (and run bbndk-env.bat)

run bjam like the following:

b2 %* install --prefix=C:\boost\ --user-config=blackberry-config.jam --layout=system toolset=qcc target-os=qnxnto

with this blackberry-config.jam file:

import os ;

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 forget to run bbndk-env.bat? ;
    ECHO error: ;
    EXIT ;
}

# _cpp uses dinkumware, _gpp uses gnu std::
if $(QNX_TARGET_ARCH) = x86
{
    dashVOpt = gcc_ntox86_cpp ;
    linkArchDir = x86 ;
}
else
{
    dashVOpt = gcc_ntoarmv7le_cpp ;
    linkArchDir = armle-v7 ;
}


# python is tricky:
# - need python.exe to run the build system
# - need python include and libs to build Boost.Python
# the above are 2 very separate things! Particularly for cross-compiling!
#   the second needs to be the correct python for the target platform.
# Where can you get a port of python for blackberry10??? or QNX in general?
# I don't really know. A *nix variant  should mostly work.
#
if [ os.name ] = "NT"
{
   using python : 2.7 : C:\\Python27
     : C:\\code\\Python-2.7\\armle-v7\\usr\\include\\python2.7
     : C:\\code\\Python-2.7\\armle-v7\\usr\\lib\\python2.7
     : ;
}
else
{
   using python : 2.7 : /usr/lib/python2.7
     : ~/code/Python-2.7/armle-v7/usr/include/python2.7
     : ~/code/Python-2.7/armle-v7/usr/lib/python2.7
     : ;
}

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 ; 

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants