Opened 6 years ago

Closed 6 years ago

Last modified 6 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 Changed 6 years ago by tvaneerd@…

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 Changed 6 years ago by viboes

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

comment:3 Changed 6 years ago by viboes

Is target-os a property defined by default?

comment:4 Changed 6 years ago by Jürgen Hunold

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 Changed 6 years ago by viboes

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 Changed 6 years ago by viboes

Milestone: To Be Determined
Resolution: duplicate
Status: assignedclosed

Duplicated Ticket #3393

comment:7 Changed 6 years ago by viboes

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

Note: See TracTickets for help on using tickets.