]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
Fix bugs of CHECK_BLSURF procedure
authorvsr <vsr@opencascade.com>
Wed, 23 Mar 2011 12:32:53 +0000 (12:32 +0000)
committervsr <vsr@opencascade.com>
Wed, 23 Mar 2011 12:32:53 +0000 (12:32 +0000)
adm_local/unix/config_files/check_BLSURF.m4

index 42dbe794baeed7e0ba42c28a79d19fbb1d989746..4a351226a8adf426a28388bf3ddf1930373569c8 100644 (file)
@@ -25,15 +25,15 @@ AC_DEFUN([CHECK_BLSURF],[
 AC_REQUIRE([AC_PROG_CXX])dnl
 AC_REQUIRE([AC_PROG_CXXCPP])dnl
 
-AC_CHECKING(for BLSURF commercial product)
+AC_CHECKING([for BLSURF commercial product])
 
 AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
+AC_LANG_C
 
 BLSURF_INCLUDES=""
 BLSURF_LIBS=""
 
-AC_ARG_WITH(blsurf,
+AC_ARG_WITH([blsurf],
            [  --with-blsurf=DIR       root directory path of BLSURF installation])
 
 BLSURF_ok=no
@@ -59,39 +59,39 @@ if test "$with_blsurf" != "no" ; then
     echo BLSURF commercial product to generate 2D mesh.
     echo
 
-    BLSURF_INCLUDES="-I$BLSURF_HOME/include"
-    BLSURF_LIBS="-L$BLSURF_HOME/lib -lBLSurf"
+    LOCAL_INCLUDES="-I$BLSURF_HOME/include"
+    LOCAL_LIBS="-L$BLSURF_HOME/lib -lBLSurf"
     if test $(/bin/arch) = x86_64 ; then
       if test -f $BLSURF_HOME/lib/Linux_64/libBLSurf.so ; then
-        BLSURF_LIBS="-L$BLSURF_HOME/lib/Linux_64 -lBLSurf"
+        LOCAL_LIBS="-L$BLSURF_HOME/lib/Linux_64 -lBLSurf"
       fi
     fi
 
     CPPFLAGS_old="$CPPFLAGS"
     CXXFLAGS_old="$CXXFLAGS"
-    CPPFLAGS="$BLSURF_INCLUDES $CPPFLAGS"
-    CXXFLAGS="$BLSURF_INCLUDES $CXXFLAGS"
+    CPPFLAGS="$LOCAL_INCLUDES $CPPFLAGS"
+    CXXFLAGS="$LOCAL_INCLUDES $CXXFLAGS"
 
-    AC_MSG_CHECKING(for BLSURF header file)
+    AC_MSG_CHECKING([for BLSURF header file])
 
-    AC_CHECK_HEADER(distene/api.h,BLSURF_ok=yes,BLSURF_ok=no)
+    AC_CHECK_HEADER([distene/api.h],[BLSURF_ok=yes],[BLSURF_ok=no])
 
     if test "x$BLSURF_ok" == "xyes"; then
 
-      AC_MSG_CHECKING(for BLSURF library)
+      AC_MSG_CHECKING([for BLSURF library])
 
       LDFLAGS_old="$LDFLAGS"
-      LDFLAGS="-L. -$BLSURF_LIBS $LDFLAGS"
+      LDFLAGS="-L. $LOCAL_LIBS $LDFLAGS"
 
       AC_TRY_LINK(
-       #include "distene/api.h",
-       BLSURF_init();,
-       BLSURF_ok=yes,BLSURF_ok=no
+       [#include "distene/api.h"],
+       [distene_context_new()],
+       [BLSURF_ok=yes],[BLSURF_ok=no]
        )
 
       LDFLAGS="$LDFLAGS_old"
 
-      AC_MSG_RESULT($BLSURF_ok)
+      AC_MSG_RESULT([$BLSURF_ok])
     fi
 
     CPPFLAGS="$CPPFLAGS_old"
@@ -101,11 +101,13 @@ if test "$with_blsurf" != "no" ; then
 fi
 
 if test "x$BLSURF_ok" == xno ; then
-  AC_MSG_RESULT(for BLSURF: no)
-  AC_MSG_WARN(BLSURF includes or libraries are not found or are not properly installed)
-  AC_MSG_WARN(Cannot build without BLSURF. Use --with-blsurf option to define BLSURF installation.)
+  AC_MSG_RESULT([for BLSURF: no])
+  AC_MSG_WARN([BLSURF includes or libraries are not found or are not properly installed])
+  AC_MSG_WARN([Cannot build without BLSURF. Use --with-blsurf option to define BLSURF installation.])
 else
-  AC_MSG_RESULT(for BLSURF: yes)
+  BLSURF_INCLUDES=$LOCAL_INCLUDES
+  BLSURF_LIBS=$LOCAL_LIBS
+  AC_MSG_RESULT([for BLSURF: yes])
 fi
 
 AC_SUBST(BLSURF_INCLUDES)