[cgma-dev] r4075 - cgm/trunk
kraftche at cae.wisc.edu
kraftche at cae.wisc.edu
Tue Aug 10 11:20:01 CDT 2010
Author: kraftche
Date: 2010-08-10 11:20:01 -0500 (Tue, 10 Aug 2010)
New Revision: 4075
Modified:
cgm/trunk/configure.ac
Log:
Fix detection of OCC STEP & STL support:
It is no longer possible to use the 'main trick' to work around the
lack of support for detecting C++ libraries with autoconf because
calling 'main' or taking the address of it violates the upcomming C++
standard.
Modified: cgm/trunk/configure.ac
===================================================================
--- cgm/trunk/configure.ac 2010-08-06 17:59:48 UTC (rev 4074)
+++ cgm/trunk/configure.ac 2010-08-10 16:20:01 UTC (rev 4075)
@@ -309,6 +309,7 @@
OCC_LCAF_LIBS="-lTKLCAF -lTKBinL"
OCC_LIBS="$OCC_LCAF_LIBS $OCC_GEOM_LIBS $OCC_CORE_LIBS"
CUBIT_OCC_LIB="-lcubit_OCC"
+ OCC_STEP_LIBS="-lTKSTEP -lTKSTEP209 -lTKSTEPAttr -lTKSTEPBase -lTKXSBase"
# Set OCC_INC_FLAG and OCC_LIB_FLAG based on --with-occ option
if test "x$occ_DIR" = "x"; then
@@ -400,15 +401,27 @@
[HAVE_OCC_DEF="$HAVE_OCC_DEF -DHAVE_OCC_IGES"
OCC_LIBS="-lTKIGES -lTKXSBase $OCC_LIBS"],
[], [$OCC_LIBS] )
- AC_CHECK_LIB( [TKSTEP], [main],
- [HAVE_OCC_DEF="$HAVE_OCC_DEF -DHAVE_OCC_STEP"
- OCC_LIBS="-lTKSTEP -lTKSTEP209 -lTKSTEPAttr -lTKSTEPBase -lTKXSBase $OCC_LIBS"],
- [], [$OCC_LIBS] )
- AC_CHECK_LIB( [TKSTL], [main],
- [HAVE_OCC_DEF="$HAVE_OCC_DEF -DHAVE_OCC_STL"
- OCC_LIBS="-lTKSTL $OCC_LIBS"],
- [], [$OCC_LIBS] )
-
+ AC_MSG_CHECKING([for OpenCascade STEP support (libTKSTEP)])
+ old_LIBS="$LIBS"
+ LIBS="$OCC_STEP_LIBS $OCC_LIBS $LIBS"
+ CPPFLAGS="$CPPFLAGS $OCC_INC_FLAG"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include "STEPControl_Reader.hxx"],
+ [STEPControl_Reader reader;])],
+ [HAVE_OCC_DEF="$HAVE_OCC_DEF -DHAVE_OCC_STEP"
+ OCC_LIBS="$OCC_STEP_LIBS $OCC_LIBS"
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])])
+ AC_MSG_CHECKING([for OpenCascade STL support (libTKSTL)])
+ LIBS="-lTKSTL $OCC_LIBS $old_LIBS"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include "StlAPI_Reader.hxx"],
+ [StlAPI_Reader reader;])],
+ [HAVE_OCC_DEF="$HAVE_OCC_DEF -DHAVE_OCC_STL"
+ OCC_LIBS="-lTKSTL $OCC_LIBS"
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])])
+ LIBS="$old_LIBS"
AC_LANG_POP(C++)
More information about the cgma-dev
mailing list