[cgma-dev] r4110 - cgm/trunk

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Mon Aug 30 16:32:51 CDT 2010


Author: kraftche
Date: 2010-08-30 16:32:51 -0500 (Mon, 30 Aug 2010)
New Revision: 4110

Modified:
   cgm/trunk/configure.ac
Log:
fix two issues when detecting static OCC libraries

Modified: cgm/trunk/configure.ac
===================================================================
--- cgm/trunk/configure.ac	2010-08-27 15:16:44 UTC (rev 4109)
+++ cgm/trunk/configure.ac	2010-08-30 21:32:51 UTC (rev 4110)
@@ -394,17 +394,37 @@
                                [AC_MSG_ERROR([OpenCascade config error: libTKernel not found ])],
                                [-ldl] )
                 ] )
+  
+  # Common setup for tests below
+  old_LIBS="$LIBS"
+  CPPFLAGS="$CPPFLAGS $OCC_INC_FLAG"
 
+  # Check if OpenCascade requires -lpthread
+  AC_MSG_CHECKING([if OpenCascade requires -lpthread])
+  LIBS="$OCC_LIBS $old_LIBS"
+  AC_LINK_IFELSE(
+     [AC_LANG_PROGRAM([#include "Standard_Mutex.hxx"], [Standard_Mutex mutex; mutex.TryLock();])],
+     [AC_MSG_RESULT([no])],
+     [# Try test again with pthreads library
+      LIBS="$LIBS -lpthread"
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM([#include "Standard_Mutex.hxx"], [Standard_Mutex mutex; mutex.TryLock();])],
+        [AC_MSG_RESULT([yes]); OCC_LIBS="$OCC_LIBS -lpthread"],
+        [AC_MSG_ERROR([Cannot link libTKKernel with Standard_Mutex])]
+      )])
+  
+
   HAVE_OCC_DEF="-DHAVE_OCC"
-  # Check for IGES, STEP, and STL support
+ 
+  # Check for IGES support
   AC_CHECK_LIB( [TKIGES], [igesread], 
                 [HAVE_OCC_DEF="$HAVE_OCC_DEF -DHAVE_OCC_IGES"
                  OCC_LIBS="-lTKIGES -lTKXSBase $OCC_LIBS"], 
-                [], [$OCC_LIBS] )
+                [], [-lTKXSBase $OCC_LIBS] )
+
+  # Check for STEP support
   AC_MSG_CHECKING([for OpenCascade STEP support (libTKSTEP)])
-  old_LIBS="$LIBS"
-  LIBS="$OCC_STEP_LIBS $OCC_LIBS $LIBS"
-  CPPFLAGS="$CPPFLAGS $OCC_INC_FLAG"
+  LIBS="$OCC_STEP_LIBS $OCC_LIBS $old_LIBS"
   AC_LINK_IFELSE(
      [AC_LANG_PROGRAM([#include "STEPControl_Reader.hxx"], 
                       [STEPControl_Reader reader;])],
@@ -412,6 +432,8 @@
       OCC_LIBS="$OCC_STEP_LIBS $OCC_LIBS"
       AC_MSG_RESULT([yes])],
      [AC_MSG_RESULT([no])])


More information about the cgma-dev mailing list