Boost Users :
From: Paul (elegant_dice_at_[hidden])
Date: 2008-07-01 02:21:32
This probably won't work for the same reason highlighted in my reply to
Mikko - it will want to link to -pthreads instead of -mthreads, and do
various other things because it assumes that because the host computer is
linux, that I want to compile for linux.
2008/7/1 Tim St. Clair <timothysc_at_[hidden]>:
> If you wanted too... you can also overload all the standard variables for
> cross compilation and it "should" function properly.
> // Rip'd from a script.
> export CC=$(TARGET_STAGING_DIR)/bin/$(TARGET_ARCH)-linux-gcc
> export CXX=$(TARGET_STAGING_DIR)/bin/$(TARGET_ARCH)-linux-c++
> export AR=$(TARGET_STAGING_DIR)/bin/$(TARGET_ARCH)-linux-ar
> export GCC=$(TARGET_STAGING_DIR)/bin/$(TARGET_ARCH)-linux-gcc
> export GXX=$(TARGET_STAGING_DIR)/bin/$(TARGET_ARCH)-linux-g++
> export LD=$(TARGET_STAGING_DIR)/bin/$(TARGET_ARCH)-linux-ld
> export NM=$(TARGET_STAGING_DIR)/bin/$(TARGET_ARCH)-linux-nm
> then call bjam install
> I typically do this during cross compilation, as I don't trust most tools
> to implicitly "do the right thing".
> Instead, I explicitly configure an environment where there "can be only
> one" way to compile.
> Then I let the scripts sort it out...
> Hope this helps,
> On Mon, Jun 30, 2008 at 6:13 AM, Paul <elegant_dice_at_[hidden]> wrote:
>> I find the bjam documentation and configuration files very frustrating...
>> it seems to almost do what you want, but it doesn't finish the job and tell
>> you how to actually do it correctly.
>> I have been trying to cross-compile boost 1.35.0 for windows, on a linux
>> host. The gcc.jam file mentions cross-compiling, but does not mention how
>> to get it done.
>> I almost got it to work with a user-config.jam:
>> using gcc
>> : mingw
>> : /home/paul/mingw/bin/mingw32-g++
>> : <flavor>mingw32
>> and then hacking away at the gcc.jam file, which checks the os.system
>> variable to decide how to link object files and use the -fPIC flag...
>> around line 703:
>> if [ os.on-windows ] change to...
>> if [ modules.peek : UNIX ] to force it to use -mthreads instead of
>> if [ os.name ] != CYGWIN && [ os.name ] != NT change to
>> if [ os.name ] = CYGWIN && [ os.name ] != NT to correct -fPIC
>> it almost did the right thing, except for the extensions... i assume if i
>> hack these lines, I'll get what i want...
>> type.set-generated-target-suffix STATIC_LIB : <toolset>gcc
>> <target-os>cygwin : a ;
>> type.set-generated-target-suffix IMPORT_LIB : <toolset>gcc
>> <target-os>cygwin : dll.a ;
>> type.set-generated-target-prefix IMPORT_LIB : <toolset>gcc
>> <target-os>cygwin : lib ;
>> BUT then I'll have to fight to use the mingw32-ar and mingw32-windres and
>> other programs.
>> Isn't there an easier way? *please*
>> I'm giving up on 1.35 as I've just read about the serialization vector
>> bug, so I'll attempt to use 1.34.1
>> Boost-users mailing list
> Timothy St. Clair
> Boost-users mailing list
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net