Salome HOME
Rename MED module to FIELDS: adm files (m4 detection procedure)
[modules/med.git] / adm_local / unix / config_files / check_Med.m4
index 727bf4381b53e544f1eb59b39e1cc0463030b326..5e057354bda6f8052f040247170285be9e4c9b4b 100644 (file)
@@ -1,45 +1,85 @@
-# Check availability of Med binary distribution
+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
+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
+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
+
+# Check availability of Fields binary distribution
 #
 # Author : Nicolas REJNERI (OPEN CASCADE, 2003)
 #
 
-AC_DEFUN([CHECK_MED],[
-
-AC_CHECKING(for Med)
-
-Med_ok=no
+AC_DEFUN([CHECK_FIELDS],[
+AC_REQUIRE([AC_LINKER_OPTIONS])dnl
+AC_REQUIRE([CHECK_MED3])
 
-AC_ARG_WITH(med,
-           [  --with-med=DIR root directory path of MED installation ],
-           MED_DIR="$withval",MED_DIR="")
+AC_CHECKING(for Fields)
 
-if test "x$MED_DIR" == "x" ; then
+Fields_ok=no
 
-# no --with-med-dir option used
+FIELDS_LDFLAGS=""
+FIELDS_CXXFLAGS=""
 
-   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
 
-if test -f ${MED_DIR}/idl/salome/MED.idl ; then
-   Med_ok=yes
-   AC_MSG_RESULT(Using Med module distribution in ${MED_DIR})
+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 "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)
+
+   FIELDS_LDFLAGS=-L${FIELDS_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
+   FIELDS_CXXFLAGS=-I${FIELDS_DIR}/include/salome
+
+   AC_SUBST(FIELDS_LDFLAGS)
+   AC_SUBST(FIELDS_CXXFLAGS)
 
 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 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])