1 dnl Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 dnl This library is free software; you can redistribute it and/or
5 dnl modify it under the terms of the GNU Lesser General Public
6 dnl License as published by the Free Software Foundation; either
7 dnl version 2.1 of the License.
9 dnl This library is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 dnl Lesser General Public License for more details.
14 dnl You should have received a copy of the GNU Lesser General Public
15 dnl License along with this library; if not, write to the Free Software
16 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 dnl See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 AC_DEFUN([CHECK_METIS],[
24 AC_CHECKING(for METIS Library)
34 AC_CHECKING(for METIS location)
36 [ --with-metis=DIR root directory path to METIS library installation ],
38 AC_MSG_RESULT("select $withval as path to METIS library")])
40 AC_MSG_RESULT(\$METISDIR = ${METISDIR})
42 CPPFLAGS_old="${CPPFLAGS}"
45 if test "x${METISDIR}" != "x" ; then
46 METIS_CPPFLAGS="-DENABLE_METIS -I${METISDIR}/Lib"
47 METIS_LIBS="-L${METISDIR} -lmetis"
55 AC_CHECKING(for METIS headers)
56 CPPFLAGS="${CPPFLAGS_old} ${METIS_CPPFLAGS}"
58 metis_include_dir_ok=yes
59 if test "x${METISDIR}" != "x" ; then
60 AC_CHECK_FILE(${METISDIR}/Lib/metis.h,
61 metis_include_dir_ok=yes,
62 metis_include_dir_ok=no)
65 if test "x${metis_include_dir_ok}" = "xyes" ; then
66 AC_TRY_COMPILE([#include <metis.h>],
67 [Change2CNumbering(0,0,0)],
72 if test "x${metis_headers_ok}" = "xno" ; then
73 METIS_CPPFLAGS="METIS_CPPFLAGS_NOT_DEFINED"
75 AC_MSG_RESULT(\$METIS_CPPFLAGS = ${METIS_CPPFLAGS})
77 AC_MSG_RESULT(for metis headers: $metis_headers_ok)
79 if test "x${metis_headers_ok}" = "xyes" ; then
81 AC_CHECKING(for METIS binaries)
83 if test "x${METISDIR}" != "x" ; then
84 AC_CHECK_FILE(${METISDIR}/libmetis.a,
87 if test "x${metis_lib_dir_ok}" = "xno" ; then
89 AC_CHECK_FILE(${METISDIR}/libmetis.a,
94 if test "x${metis_lib_dir_ok}" = "xyes" ; then
95 LIBS="${LIBS_old} ${METIS_LIBS}"
96 AC_TRY_LINK([#include <metis.h>],
97 [Change2CNumbering(0,0,0)],
98 metis_binaries_ok=yes,
100 if test "x${metis_binaries_ok}" = "xno" ; then
102 LIBS="${LIBS_old} ${METIS_LIBS} "
103 AC_TRY_LINK([#include <metis.h>],
104 [Change2CNumbering(0,0,0)],
105 metis_binaries_ok=yes,
106 metis_binaries_ok=no)
111 if test "x${metis_binaries_ok}" = "xno" ; then
112 METIS_LIBS="METIS_LIBS_NOT_FOUND"
113 METIS_LIBSUFFIX="-not-defined"
115 AC_MSG_RESULT(\$METIS_LIBSUFFIX = ${METIS_LIBSUFFIX})
116 AC_MSG_RESULT(\$METIS_LIBS = ${METIS_LIBS})
118 AC_MSG_RESULT(for metis binaries: $metis_binaries_ok)
120 CPPFLAGS="${CPPFLAGS_old}"
123 if test "x${metis_headers_ok}" = "xyes" ; then
124 if test "x${metis_binaries_ok}" = "xyes" ; then
130 AC_MSG_RESULT(for metis: $metis_ok)
132 AC_SUBST(METIS_CPPFLAGS)
133 AC_SUBST(METIS_LIBSUFFIX)
135 AC_SUBST(ENABLE_METIS)