Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#7706 closed Bugs (duplicate)

cross compiling of threads library - JamFile.v2

Reported by: tvaneerd@… Owned by: viboes
Milestone: Component: thread
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc: viboes

Description (last modified by viboes)

Thread's jam file assumes the compile target is the same as the host :-(

ie a check for windows should probably be a check for the target being windows:

@@ -105,7 +107,7 @@ 
 local rule default_threadapi ( )
 {
     local api = pthread ;
-    if [ os.name ] = "NT" { api = win32 ; }
+    if <target-os>windows in $(properties) { api = win32 ; }
     return $(api) ;
 }

Change History (7)

comment:1 by tvaneerd@…, 10 years ago

grrr, forgot about WikiFormatting again

@@ -105,7 +107,7 @@ 
 local rule default_threadapi ( )
 {
     local api = pthread ;
-    if [ os.name ] = "NT" { api = win32 ; }
+    if <target-os>windows in $(properties) { api = win32 ; }
     return $(api) ;
 }
 

comment:2 by viboes, 10 years ago

Cc: viboes added
Component: Nonethread
Description: modified (diff)
Owner: set to viboes
Status: newassigned

comment:3 by viboes, 10 years ago

Is target-os a property defined by default?

comment:4 by Jürgen Hunold, 10 years ago

Yes, <target-os> and also <host-os> are predefined. Using [ os.name ] is wrong in other Jamfiles as well. The patch looks good.

comment:5 by viboes, 10 years ago

I've added the patch and a trace

    if <target-os>windows in $(properties)
    {
      echo "************************************************************" ;
      echo "windows build."           ;
      echo "************************************************************" ;

      api = win32 ;
    }
    else
    {
      echo "************************************************************" ;
      echo "pthread build."           ;
      echo "************************************************************" ;
    }

and it doesn't works for me on MinGW. It seems the test fails always.

$ bjam2 toolset=msvc
************************************************************
pthread build.
************************************************************
************************************************************
Trying to build Boost.Thread with pthread support.
If you need pthread you should specify the paths.
You can specify them in site-config.jam, user-config.jam
or in the environment.
For example:
PTW32_INCLUDE=C:\Program Files\ptw32\Pre-built2\include
PTW32_LIB=C:\Program Files\ptw32\Pre-built2\lib
************************************************************
...found 1 target...

botet@FRLANN0L014960 /d/boost/trunk/libs/thread/build
$ bjam2 toolset=msvc target-os=windows
************************************************************
pthread build.
************************************************************
************************************************************
Trying to build Boost.Thread with pthread support.
If you need pthread you should specify the paths.
You can specify them in site-config.jam, user-config.jam
or in the environment.
For example:
PTW32_INCLUDE=C:\Program Files\ptw32\Pre-built2\include
PTW32_LIB=C:\Program Files\ptw32\Pre-built2\lib
************************************************************
...found 1 target...

botet@FRLANN0L014960 /d/boost/trunk/libs/thread/build
$

Do you have any idea what could be wrong?

comment:6 by viboes, 10 years ago

Milestone: To Be Determined
Resolution: duplicate
Status: assignedclosed

Duplicated Ticket #3393

comment:7 by viboes, 10 years ago

Please could you check the patch provided by Jürgen Hunold attached to #3393?

Note: See TracTickets for help on using tickets.