1
dnl----------------------------------------------------------------------------
2
dnl This file is part of the Code_Saturne Kernel, element of the
3
dnl Code_Saturne CFD tool.
5
dnl Copyright (C) 2011 EDF S.A., France
7
dnl The Code_Saturne Kernel is free software; you can redistribute it
8
dnl and/or modify it under the terms of the GNU General Public License
9
dnl as published by the Free Software Foundation; either version 2 of
10
dnl the License, or (at your option) any later version.
12
dnl The Code_Saturne Kernel is distributed in the hope that it will be
13
dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14
dnl of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
dnl GNU General Public License for more details.
17
dnl You should have received a copy of the GNU General Public Licence
18
dnl along with the Code_Saturne Preprocessor; if not, write to the
19
dnl Free Software Foundation, Inc.,
20
dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
dnl-----------------------------------------------------------------------------
23
# CS_AC_TEST_ENV_MODULES
24
#-----------------------
25
# checks for environement modules
27
AC_DEFUN([CS_AC_TEST_ENV_MODULES], [
30
[AS_HELP_STRING([--with-modules=LIST],
31
[colon-separated list of environment modules])],
32
[with_modules=$withval],
35
# Attempt at auto-detection
39
if test "x$with_modules" = "xcheck" ; then
41
# Test for environment modules
43
if test "x$MODULESHOME" != "x" ; then
45
AC_MSG_CHECKING([for environment modules])
52
for m in $LOADEDMODULES; do try_modules="$try_modules $m"; done
57
while test "x$try_modules" != "x$try_modules_p" ;
59
try_modules_p=$try_modules
61
for m in $try_modules_p ; do
62
prv_LOADED=$LOADEDMODULES
63
module load $m > /dev/null 2>&1
64
if test "$prv_LOADED" != "$LOADEDMODULES" ; then
65
cs_env_modules="$cs_env_modules $m"
67
try_modules="$retry_modules $m"
75
elif test "x$with_modules" != "xno" ; then
79
for m in $with_modules; do cs_env_modules="$cs_env_modules $m"; done
84
AC_SUBST(cs_env_modules)