]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add support for FreeBSD
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 14 Oct 2012 18:44:34 +0000 (18:44 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 14 Oct 2012 18:44:34 +0000 (18:44 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@27118 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/TODO.CMAKE
deal.II/cmake/configure/configure_1_tbb.cmake

index 7ed4ba0358d14f366759b7fe899f8df00fa8f09f..2773ec541015130078e38c3f30615ba2ca6953c2 100644 (file)
@@ -1,7 +1,5 @@
 Major:
 
-* Add support for native FreeBSD: -lpthread --> -pthread
-
 * Add the rest of the Bug tests
 
 * Test the fparser 4.5 functionality.
index 31b92f9c8c53b5f701d6ec9af7a452779802e699..e881213a6ddf6586e0cffb18730e0d9632f2c218 100644 (file)
@@ -33,9 +33,25 @@ MACRO(SETUP_THREADING var)
     #
     # We support threading. Go on and configure the rest:
     #
+    SET(DEAL_II_USE_MT TRUE)
+
+    #
+    # Change -lphtread to -pthread for more compatibility on non linux
+    # platforms:
+    #
+    IF("${CMAKE_THREAD_LIBS_INIT}" MATCHES "-lpthread")
+      CHECK_CXX_COMPILER_FLAG("-pthread"
+        DEAL_II_HAVE_FLAG_-pthread
+        )
+      IF(DEAL_II_HAVE_FLAG_-pthread)
+        STRING(REPLACE "-lpthread" "-pthread" CMAKE_THREAD_LIBS_INIT
+          "${CMAKE_THREAD_LIBS_INIT}"
+          )
+      ENDIF()
+    ENDIF()
 
     ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
-    SET(DEAL_II_USE_MT TRUE)
+
 
     #
     # Set up some posix thread specific configuration toggles:

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.