1 dnl Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
3 dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 dnl This library is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU Lesser General Public
8 dnl License as published by the Free Software Foundation; either
9 dnl version 2.1 of the License, or (at your option) any later version.
11 dnl This library is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 dnl Lesser General Public License for more details.
16 dnl You should have received a copy of the GNU Lesser General Public
17 dnl License along with this library; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 AC_DEFUN([CHECK_CGNS],[
24 AC_REQUIRE([AC_PROG_CC])dnl
25 AC_REQUIRE([AC_PROG_CPP])dnl
26 AC_REQUIRE([CHECK_HDF5])dnl
31 [ --with-cgns=DIR root directory path to CGNS installation ],
33 AC_MSG_RESULT("select $withval as path to CGNS")
36 AC_SUBST(CGNS_INCLUDES)
45 LOCAL_LIBS="-lcgns $HDF5_LIBS"
47 if test "x$CGNSHOME" != "xno"; then
48 if test "x$CGNSHOME" == "xyes"; then
53 AC_MSG_WARN(undefined CGNSHOME variable which specify CGNS library installation directory)
54 AC_PATH_PROG(BINDIR, cgnsversion)
55 if test "x$BINDIR" != "x" ; then
57 CGNSHOME=`echo ${CGNSHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
58 CGNSHOME=`echo ${CGNSHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
61 if test ! -z $CGNSHOME
63 LOCAL_INCLUDES="-I$CGNSHOME/include"
64 if test "x$CGNSHOME" != "x/usr"; then
65 LOCAL_LIBS="-L$CGNSHOME/lib $LOCAL_LIBS"
69 dnl check cgnslib header
71 CPPFLAGS_old=$CPPFLAGS
72 CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
74 AC_CHECK_HEADER(cgnslib.h,cgns_ok=yes ,cgns_ok=no)
76 CPPFLAGS=$CPPFLAGS_old
79 if test "x$cgns_ok" = "xyes"
82 dnl check cgns library
85 LIBS="$LIBS $LOCAL_LIBS"
86 AC_CHECK_LIB(cgns,cg_open,cgns_ok=yes,cgns_ok=no)
92 if test "x$cgns_ok" = "xyes"
94 CGNS_LIBS="$LOCAL_LIBS"
95 CGNS_INCLUDES="$LOCAL_INCLUDES"
96 CPPFLAGS="-DWITH_CGNS $CPPFLAGS"
99 AC_MSG_RESULT(for CGNS: $cgns_ok)
101 AM_CONDITIONAL(WITH_CGNS, [test x"$cgns_ok" = xyes])