Salome HOME
Rename MED module to FIELDS: adm files (m4 detection procedure)
[modules/med.git] / adm_local / unix / config_files / check_Med.m4
index 576db978e56ee4d59e69af437b1dda1621d65676..5e057354bda6f8052f040247170285be9e4c9b4b 100644 (file)
@@ -1,92 +1,85 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
-# Check availability of Med binary distribution
+
+# Check availability of Fields binary distribution
 #
 # Author : Nicolas REJNERI (OPEN CASCADE, 2003)
 #
 
-AC_DEFUN([CHECK_MED],[
+AC_DEFUN([CHECK_FIELDS],[
 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
-AC_REQUIRE([CHECK_MED2])
-
-AC_CHECKING(for Med)
+AC_REQUIRE([CHECK_MED3])
 
-Med_ok=no
+AC_CHECKING(for Fields)
 
-MED_LDFLAGS=""
-MED_CXXFLAGS=""
+Fields_ok=no
 
-AC_ARG_WITH(med,
-           [  --with-med=DIR root directory path of MED installation ],
-           MED_DIR="$withval",MED_DIR="")
+FIELDS_LDFLAGS=""
+FIELDS_CXXFLAGS=""
 
-if test "x${MED_DIR}" == "x" ; then
-  AC_MSG_RESULT(for \${MED_ROOT_DIR}: ${MED_ROOT_DIR})
-# no --with-med-dir option used
-   if test "x${MED_ROOT_DIR}" != "x" ; then
-
-    # MED_ROOT_DIR environment variable defined
-      MED_DIR=${MED_ROOT_DIR}
+AC_ARG_WITH(fields,
+           [  --with-fields=DIR root directory path of Fields installation ],
+           FIELDS_DIR="$withval",FIELDS_DIR="")
 
+if test "x${FIELDS_DIR}" == "x" ; then
+   AC_MSG_RESULT(for \${FIELDS_ROOT_DIR}: ${FIELDS_ROOT_DIR})
+   # --with-fields option is not used
+   if test "x${FIELDS_ROOT_DIR}" != "x" ; then
+      # FIELDS_ROOT_DIR environment variable defined
+      FIELDS_DIR=${FIELDS_ROOT_DIR}
    fi
-
 fi
 
-MED_ENABLE_MULTIPR=no
+if test -f ${FIELDS_DIR}/idl/salome/MEDCouplingCorbaServant.idl ; then
+   AC_MSG_RESULT(Using Fields module distribution in ${FIELDS_DIR})
+   Fields_ok=yes
 
-if test -f ${MED_DIR}/idl/salome/MED.idl ; then
-   AC_MSG_RESULT(Using Med module distribution in ${MED_DIR})
-   Med_ok=yes
-
-   if test "x$MED_ROOT_DIR" == "x" ; then
-      MED_ROOT_DIR=${MED_DIR}
+   if test "x$FIELDS_ROOT_DIR" == "x" ; then
+      FIELDS_ROOT_DIR=${FIELDS_DIR}
    fi
 
-   AC_SUBST(MED_ROOT_DIR)
+   AC_SUBST(FIELDS_ROOT_DIR)
 
-   MED_LDFLAGS=-L${MED_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
-   MED_CXXFLAGS=-I${MED_DIR}/include/salome
+   FIELDS_LDFLAGS=-L${FIELDS_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
+   FIELDS_CXXFLAGS=-I${FIELDS_DIR}/include/salome
 
-   AC_SUBST(MED_LDFLAGS)
-   AC_SUBST(MED_CXXFLAGS)
+   AC_SUBST(FIELDS_LDFLAGS)
+   AC_SUBST(FIELDS_CXXFLAGS)
 
-   # MULTIPR
-   AC_CHECK_FILE(${MED_DIR}/include/salome/MULTIPR_Obj.hxx,
-                 ENABLE_MULTIPR=yes,
-                 ENABLE_MULTIPR=no)
-   AC_SUBST(ENABLE_MULTIPR)
-   MULTIPR_CPPFLAGS=""
-   MULTIPR_LIBS=""
-   if test "x${ENABLE_MULTIPR}" = "xyes" ; then
-      MULTIPR_CPPFLAGS="-DENABLE_MULTIPR"
-      MULTIPR_LIBS="-lMULTIPR_API"
-   fi
-   AC_SUBST(MULTIPR_CPPFLAGS)
-   AC_SUBST(MULTIPR_LIBS)
 else
-   AC_MSG_WARN("Cannot find Med module sources")
+   AC_MSG_WARN("Cannot find Fields module sources")
 fi
 
-AC_MSG_RESULT(for Med: $Med_ok)
-AC_MSG_RESULT(for MULTIPR Med package: $ENABLE_MULTIPR)
+AC_MSG_RESULT(for Fields: $Fields_ok)
+
+dnl Backward compatibility
+MED_ROOT_DIR=${FIELDS_ROOT_DIR}
+MED_CXXFLAGS=${FIELDS_CXXFLAGS}
+MED_LDFLAGS=${FIELDS_LDFLAGS}
+AC_SUBST(MED_ROOT_DIR)
+AC_SUBST(MED_CXXFLAGS)
+AC_SUBST(MED_LDFLAGS)
 
 ])dnl
+
+dnl Backward compatibility
+AC_DEFUN([CHECK_MED],[CHECK_FIELDS])