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
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"
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)