1 dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, 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.
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_METIS],[
25 AC_CHECKING(for METIS Library)
35 AC_CHECKING(for METIS location)
37 [ --with-metis=DIR root directory path to METIS library installation ],
39 AC_MSG_RESULT("select $withval as path to METIS library")])
41 AC_MSG_RESULT(\$METISDIR = ${METISDIR})
43 CPPFLAGS_old="${CPPFLAGS}"
46 if test "x${METISDIR}" != "x" ; then
47 METIS_CPPFLAGS="-DMED_ENABLE_METIS -I${METISDIR}/Lib"
48 METIS_LIBS="-L${METISDIR} -lmetis"
56 AC_CHECKING(for METIS headers)
57 CPPFLAGS="${CPPFLAGS_old} ${METIS_CPPFLAGS}"
59 metis_include_dir_ok=yes
60 if test "x${METISDIR}" != "x" ; then
61 AC_CHECK_FILE(${METISDIR}/Lib/metis.h,
62 metis_include_dir_ok=yes,
63 metis_include_dir_ok=no)
66 if test "x${metis_include_dir_ok}" = "xyes" ; then
67 AC_TRY_COMPILE([#include <metis.h>],
68 [Change2CNumbering(0,0,0)],
73 if test "x${metis_headers_ok}" = "xno" ; then
74 METIS_CPPFLAGS="METIS_CPPFLAGS_NOT_DEFINED"
76 AC_MSG_RESULT(\$METIS_CPPFLAGS = ${METIS_CPPFLAGS})
78 AC_MSG_RESULT(for metis headers: $metis_headers_ok)
80 if test "x${metis_headers_ok}" = "xyes" ; then
82 AC_CHECKING(for METIS binaries)
84 if test "x${METISDIR}" != "x" ; then
85 AC_CHECK_FILE(${METISDIR}/libmetis.a,
88 if test "x${metis_lib_dir_ok}" = "xno" ; then
90 AC_CHECK_FILE(${METISDIR}/libmetis.a,
95 if test "x${metis_lib_dir_ok}" = "xyes" ; then
96 LIBS="${LIBS_old} ${METIS_LIBS}"
97 AC_TRY_LINK([#include <metis.h>],
98 [Change2CNumbering(0,0,0)],
99 metis_binaries_ok=yes,
100 metis_binaries_ok=no)
101 if test "x${metis_binaries_ok}" = "xno" ; then
103 LIBS="${LIBS_old} ${METIS_LIBS} "
104 AC_TRY_LINK([#include <metis.h>],
105 [Change2CNumbering(0,0,0)],
106 metis_binaries_ok=yes,
107 metis_binaries_ok=no)
112 if test "x${metis_binaries_ok}" = "xno" ; then
113 METIS_LIBS="METIS_LIBS_NOT_FOUND"
114 METIS_LIBSUFFIX="-not-defined"
116 AC_MSG_RESULT(\$METIS_LIBSUFFIX = ${METIS_LIBSUFFIX})
117 AC_MSG_RESULT(\$METIS_LIBS = ${METIS_LIBS})
119 AC_MSG_RESULT(for metis binaries: $metis_binaries_ok)
121 CPPFLAGS="${CPPFLAGS_old}"
124 if test "x${metis_headers_ok}" = "xyes" ; then
125 if test "x${metis_binaries_ok}" = "xyes" ; then
131 AC_MSG_RESULT(for metis: $metis_ok)
133 AC_SUBST(METIS_CPPFLAGS)
134 AC_SUBST(METIS_LIBSUFFIX)
136 AC_SUBST(ENABLE_METIS)