Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://github.com/mpoquet/simgrid
[simgrid.git] / tools / cmake / Modules / FindLibunwind.cmake
index d940934..67bcde6 100644 (file)
@@ -1,5 +1,3 @@
-message(STATUS "Looking for libunwind")
-
 if(PROCESSOR_x86_64)
   find_library(PATH_LIBUNWIND_LIB
     NAMES unwind-x86_64
@@ -14,38 +12,23 @@ if(PROCESSOR_x86_64)
     /opt/csw
     /sw
     /usr)
-  message(STATUS "Looking for libunwind-x86_64 - found")
 endif()
 
 if(NOT PATH_LIBUNWIND_LIB)
   find_library(PATH_LIBUNWIND_LIB
     NAMES unwind
     HINTS
-      $ENV{SIMGRID_LIBUNWIND_LIBRARY_PATH}
-      $ENV{LD_LIBRARY_PATH}
-      $ENV{LIBUNWIND_LIBRARY_PATH}
-      PATH_SUFFIXES lib/ GnuWin32/lib lib/system
-      PATHS
-      /opt
-      /opt/local
-      /opt/csw
-      /sw
-      /usr
-      /usr/lib/)
-      
-  # Mac OSX has a libunwind that is not the one we need, so double check
-  if (PATH_LIBUNWIND_LIB)
-    message(STATUS "Looking for libunwind - found")
-    CHECK_LIBRARY_EXISTS(unwind unw_init_local PATH_LIBUNWIND_LIB RIGHT_LIBUNWIND)
-    if (NOT RIGHT_LIBUNWIND)
-      message(STATUS "This libunwind does not contain unw_init_local(). It's unusable.")
-      set(PATH_LIBUNWIND_LIB 0)
-    endif()
-    
-  else()
-    message(STATUS "Looking for libunwind - not found")
-  endif()
-
+    $ENV{SIMGRID_LIBUNWIND_LIBRARY_PATH}
+    $ENV{LD_LIBRARY_PATH}
+    $ENV{LIBUNWIND_LIBRARY_PATH}
+    PATH_SUFFIXES lib/ GnuWin32/lib lib/system
+    PATHS
+    /opt
+    /opt/local
+    /opt/csw
+    /sw
+    /usr
+    /usr/lib/)
 endif()
 
 find_path(PATH_LIBUNWIND_H "libunwind.h"
@@ -68,6 +51,13 @@ else()
   message(STATUS "Looking for libunwind.h - not found")
 endif()
 
+message(STATUS "Looking for libunwind")
+if(PATH_LIBUNWIND_LIB)
+  message(STATUS "Looking for libunwind - found")
+else()
+  message(STATUS "Looking for libunwind - not found")
+endif()
+
 if(PATH_LIBUNWIND_LIB AND PATH_LIBUNWIND_H)
   string(REGEX REPLACE "/libunwind.*[.]${LIB_EXE}$" "" PATH_LIBUNWIND_LIB "${PATH_LIBUNWIND_LIB}")
   string(REGEX REPLACE "/libunwind.h"               "" PATH_LIBUNWIND_H   "${PATH_LIBUNWIND_H}")