title: How to compile boost_thread with "-pthread" instead of "-mthread"?
body: <p>I have an os and compile with no <code>-mthread</code> avaliable. Thow I have <code>-pthread</code>. How to compile <strong>boost_thread</strong> with <code>-pthread</code> instead of <code>-mthread</code>?</p>
  
  <p>My current compiler build log:</p>
  
  <pre><code>./b2 -j1 --with-thread link=static --prefix=./install-dir release threading=multi --builddir=./bu
  ild-dir install
  
  Component configuration:
  
      - chrono                   : not building
      - context                  : not building
      - date_time                : not building
      - exception                : not building
      - filesystem               : not building
      - graph                    : not building
      - graph_parallel           : not building
      - iostreams                : not building
      - locale                   : not building
      - math                     : not building
      - mpi                      : not building
      - program_options          : not building
      - python                   : not building
      - random                   : not building
      - regex                    : not building
      - serialization            : not building
      - signals                  : not building
      - system                   : not building
      - test                     : not building
      - thread                   : building
      - timer                    : not building
      - wave                     : not building
  
  ...patience...
  ...found 19764 targets...
  ...updating 16 targets...
  gcc.compile.c++ bin.v2/libs/system/build/gcc-4.2.1/release/link-static/threading-multi/error_code.o
  cc1plus: error: unrecognized command line option "-mthreads"
  
      "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -mthreads  -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG  -I"." -c -o "bin.v2\libs\system\build\gcc-4.2.
  1\release\link-static\threading-multi\error_code.o" "libs\system\src\error_code.cpp"
  
  ...failed gcc.compile.c++ bin.v2/libs/system/build/gcc-4.2.1/release/link-static/threading-multi/error_code.o...
  ...skipped &lt;pbin.v2/libs/system/build/gcc-4.2.1/release/link-static/threading-multi&gt;libboost_system.a(clean) for lack of &lt;pbin.v2/libs/system/build/gcc-4.2.1/release/link-static/threading-multi&gt;error_
  code.o...
  ...skipped &lt;pbin.v2/libs/system/build/gcc-4.2.1/release/link-static/threading-multi&gt;libboost_system.a for lack of &lt;pbin.v2/libs/system/build/gcc-4.2.1/release/link-static/threading-multi&gt;error_code.o.
  ..
  ...skipped &lt;pinstall-dir/lib&gt;libboost_system.a for lack of &lt;pbin.v2/libs/system/build/gcc-4.2.1/release/link-static/threading-multi&gt;libboost_system.a...
  gcc.compile.c++ bin.v2/libs/chrono/build/gcc-4.2.1/release/link-static/threading-multi/chrono.o
  cc1plus: error: unrecognized command line option "-mthreads"
  
      "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -mthreads -Wextra -Wno-long-long -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_All_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATE
  D -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG  -I"." -c -o "bin.v2\libs\chrono\build\gcc-4.2.1\release\link-static\threading-multi\chrono.o" "libs\chrono\src\chrono.cpp"
  
  ...failed gcc.compile.c++ bin.v2/libs/chrono/build/gcc-4.2.1/release/link-static/threading-multi/chrono.o...
  gcc.compile.c++ bin.v2/libs/chrono/build/gcc-4.2.1/release/link-static/threading-multi/thread_clock.o
  cc1plus: error: unrecognized command line option "-mthreads"
  
      "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -mthreads -Wextra -Wno-long-long -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_All_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATE
  D -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG  -I"." -c -o "bin.v2\libs\chrono\build\gcc-4.2.1\release\link-static\threading-multi\thread_clock.o" "libs\chrono\src\thread_clock.cpp"
  
  ...failed gcc.compile.c++ bin.v2/libs/chrono/build/gcc-4.2.1/release/link-static/threading-multi/thread_clock.o...
  gcc.compile.c++ bin.v2/libs/chrono/build/gcc-4.2.1/release/link-static/threading-multi/process_cpu_clocks.o
  cc1plus: error: unrecognized command line option "-mthreads"
  
      "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -mthreads -Wextra -Wno-long-long -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_All_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATE
  D -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG  -I"." -c -o "bin.v2\libs\chrono\build\gcc-4.2.1\release\link-static\threading-multi\process_cpu_clocks.o" "libs\chrono\src\process_cpu_clocks.cpp"
  
  ...failed gcc.compile.c++ bin.v2/libs/chrono/build/gcc-4.2.1/release/link-static/threading-multi/process_cpu_clocks.o...
  ...skipped &lt;pbin.v2/libs/chrono/build/gcc-4.2.1/release/link-static/threading-multi&gt;libboost_chrono.a(clean) for lack of &lt;pbin.v2/libs/chrono/build/gcc-4.2.1/release/link-static/threading-multi&gt;chrono
  .o...
  ...skipped &lt;pbin.v2/libs/chrono/build/gcc-4.2.1/release/link-static/threading-multi&gt;libboost_chrono.a for lack of &lt;pbin.v2/libs/chrono/build/gcc-4.2.1/release/link-static/threading-multi&gt;chrono.o...
  ...skipped &lt;pinstall-dir/lib&gt;libboost_chrono.a for lack of &lt;pbin.v2/libs/chrono/build/gcc-4.2.1/release/link-static/threading-multi&gt;libboost_chrono.a...
  gcc.compile.c++ bin.v2/libs/thread/build/gcc-4.2.1/release/link-static/threading-multi/pthread/thread.o
  cc1plus: error: unrecognized command line option "-mthreads"
  
      "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -mthreads -Wextra -Wno-long-long -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPREC
  ATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_POSIX -DNDEBUG  -I"." -c -o "bin.v2\libs\thread\build\gcc-4.2.1\release\link-static\threading-multi\pthread\thread.o" "libs\
  thread\src\pthread\thread.cpp"
  
  ...failed gcc.compile.c++ bin.v2/libs/thread/build/gcc-4.2.1/release/link-static/threading-multi/pthread/thread.o...
  gcc.compile.c++ bin.v2/libs/thread/build/gcc-4.2.1/release/link-static/threading-multi/pthread/once.o
  cc1plus: error: unrecognized command line option "-mthreads"
  
      "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -mthreads -Wextra -Wno-long-long -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPREC
  ATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_POSIX -DNDEBUG  -I"." -c -o "bin.v2\libs\thread\build\gcc-4.2.1\release\link-static\threading-multi\pthread\once.o" "libs\th
  read\src\pthread\once.cpp"
  
  ...failed gcc.compile.c++ bin.v2/libs/thread/build/gcc-4.2.1/release/link-static/threading-multi/pthread/once.o...
  gcc.compile.c++ bin.v2/libs/thread/build/gcc-4.2.1/release/link-static/threading-multi/future.o
  cc1plus: error: unrecognized command line option "-mthreads"
  
      "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -mthreads -Wextra -Wno-long-long -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPREC
  ATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_POSIX -DNDEBUG  -I"." -c -o "bin.v2\libs\thread\build\gcc-4.2.1\release\link-static\threading-multi\future.o" "libs\thread\s
  rc\future.cpp"
  
  ...failed gcc.compile.c++ bin.v2/libs/thread/build/gcc-4.2.1/release/link-static/threading-multi/future.o...
  ...skipped &lt;pbin.v2/libs/thread/build/gcc-4.2.1/release/link-static/threading-multi&gt;libboost_thread.a(clean) for lack of &lt;pbin.v2/libs/thread/build/gcc-4.2.1/release/link-static/threading-multi&gt;pthrea
  d/thread.o...
  ...skipped &lt;pbin.v2/libs/thread/build/gcc-4.2.1/release/link-static/threading-multi&gt;libboost_thread.a for lack of &lt;pbin.v2/libs/thread/build/gcc-4.2.1/release/link-static/threading-multi&gt;pthread/threa
  d.o...
  ...skipped &lt;pinstall-dir/lib&gt;libboost_thread.a for lack of &lt;pbin.v2/libs/thread/build/gcc-4.2.1/release/link-static/threading-multi&gt;libboost_thread.a...
  ...failed updating 7 targets...
  ...skipped 9 targets...
  </code></pre>
  
  <p>Is it possible to somehow patch boost_thread to compile on my platform with my compiler so to make boost_thread thint that it shall be compiled with <code>-pthread</code>?</p>
  
  <p>Platform - old, hevily modified cigwin, gcc-4.2.1</p>