Salome HOME
Updated copyright comment
[modules/med.git] / adm_local / unix / config_files / check_Med.m4
1 dnl Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
2 dnl
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
5 dnl
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.
10 dnl
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.
15 dnl
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
19 dnl
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 dnl
22
23 # Check availability of Fields binary distribution
24 #
25 # Author : Nicolas REJNERI (OPEN CASCADE, 2003)
26 #
27
28 AC_DEFUN([CHECK_FIELDS],[
29 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
30 AC_REQUIRE([CHECK_MED3])
31
32 AC_CHECKING(for Fields)
33
34 Fields_ok=no
35
36 FIELDS_LDFLAGS=""
37 FIELDS_CXXFLAGS=""
38
39 AC_ARG_WITH(fields,
40             [  --with-fields=DIR root directory path of Fields installation ],
41             FIELDS_DIR="$withval",FIELDS_DIR="")
42
43 if test "x${FIELDS_DIR}" == "x" ; then
44    AC_MSG_RESULT(for \${FIELDS_ROOT_DIR}: ${FIELDS_ROOT_DIR})
45    # --with-fields option is not used
46    if test "x${FIELDS_ROOT_DIR}" != "x" ; then
47       # FIELDS_ROOT_DIR environment variable defined
48       FIELDS_DIR=${FIELDS_ROOT_DIR}
49    fi
50 fi
51
52 if test -f ${FIELDS_DIR}/idl/salome/MEDCouplingCorbaServant.idl ; then
53    AC_MSG_RESULT(Using Fields module distribution in ${FIELDS_DIR})
54    Fields_ok=yes
55
56    if test "x$FIELDS_ROOT_DIR" == "x" ; then
57       FIELDS_ROOT_DIR=${FIELDS_DIR}
58    fi
59
60    AC_SUBST(FIELDS_ROOT_DIR)
61
62    FIELDS_LDFLAGS=-L${FIELDS_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
63    FIELDS_CXXFLAGS=-I${FIELDS_DIR}/include/salome
64
65    AC_SUBST(FIELDS_LDFLAGS)
66    AC_SUBST(FIELDS_CXXFLAGS)
67
68 else
69    AC_MSG_WARN("Cannot find Fields module sources")
70 fi
71
72 AC_MSG_RESULT(for Fields: $Fields_ok)
73
74 dnl Backward compatibility
75 MED_ROOT_DIR=${FIELDS_ROOT_DIR}
76 MED_CXXFLAGS=${FIELDS_CXXFLAGS}
77 MED_LDFLAGS=${FIELDS_LDFLAGS}
78 AC_SUBST(MED_ROOT_DIR)
79 AC_SUBST(MED_CXXFLAGS)
80 AC_SUBST(MED_LDFLAGS)
81
82 ])dnl
83
84 dnl Backward compatibility
85 AC_DEFUN([CHECK_MED],[CHECK_FIELDS])