[MOAB-dev] r2932 - in MOAB/trunk: . m4

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Fri Jun 5 14:03:39 CDT 2009


Author: kraftche
Date: 2009-06-05 14:03:38 -0500 (Fri, 05 Jun 2009)
New Revision: 2932

Modified:
   MOAB/trunk/configure.ac
   MOAB/trunk/m4/compiler.m4
Log:
do not check for fortran compilers unless iMesh support is enabled

Modified: MOAB/trunk/configure.ac
===================================================================
--- MOAB/trunk/configure.ac	2009-06-05 06:16:36 UTC (rev 2931)
+++ MOAB/trunk/configure.ac	2009-06-05 19:03:38 UTC (rev 2932)
@@ -10,8 +10,43 @@
 AC_CHECK_PROG( [SED], [sed], [sed], [true] )
 
 
+################################################################################
+#                           iMesh
+################################################################################
+CONFIGURE_FORTRAN=no
+AC_ARG_ENABLE( [imesh],
+[AC_HELP_STRING([--enable-imesh(=nofortran)],[Build iMesh interface.  If optional
+'nofortran' argument is given, support for FORTRAN name mangling will be disabled.])
+AC_HELP_STRING([--disable-imesh],[Don't build support for iMesh interface.])],
+[DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --enable-imesh=\"${enableval}\""],
+[enableval=yes] )
+
+case $enableval in
+  yes)
+    ENABLE_imesh=yes
+    CONFIGURE_FORTRAN=yes
+    ;;
+  nofortran|NoFortran|noFORTRAN|NoFORTRAN|Nofortran)
+    ENABLE_imesh=yes
+    ;;
+  no)
+    ENABLE_imesh=no
+    ;;
+  *)
+    AC_MSG_ERROR([Invalid argument to --enable-imesh : $enableval])
+    ;;
+esac
+AC_MSG_CHECKING([if iMesh support is to be built])
+AC_MSG_RESULT([$ENABLE_imesh])
+AM_CONDITIONAL([ENABLE_imesh],[test "xyes" == "x$ENABLE_imesh"])
+
+
+################################################################################
+#                           Compilers
+################################################################################
+
 EXTRA_GNU_FLAGS='-Wall -pipe -pedantic'
-SNL_CHECK_COMPILERS
+SNL_CHECK_COMPILERS([yes],[yes],[$CONFIGURE_FORTRAN])
 AM_CONDITIONAL(PARALLEL,[test "x$WITH_MPI" != "xno"])
 LIBS="-lm"
 
@@ -277,37 +312,7 @@
 MB_OPTIONAL_TOOL([gsets],        [yes])
 
 
-
 ################################################################################
-#                           iMesh
-################################################################################
-AC_ARG_ENABLE( [imesh],
-[AC_HELP_STRING([--enable-imesh(=nofortran)],[Build iMesh interface.  If optional
-'nofortran' argument is given, support for FORTRAN name mangling will be disabled.])
-AC_HELP_STRING([--disable-imesh],[Don't build support for iMesh interface.])],
-[DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --enable-imesh=\"${enableval}\""],
-[enableval=yes] )
-
-case $enableval in
-  yes)
-    ENABLE_imesh=yes
-    ;;
-  nofortran|NoFortran|noFORTRAN|NoFORTRAN|Nofortran)
-    ENABLE_imesh=yes
-    ;;
-  no)
-    ENABLE_imesh=no
-    ;;
-  *)
-    AC_MSG_ERROR([Invalid argument to --enable-imesh : $enableval])
-    ;;
-esac
-AC_MSG_CHECKING([if iMesh support is to be built])
-AC_MSG_RESULT([$ENABLE_imesh])
-AM_CONDITIONAL([ENABLE_imesh],[test "xyes" == "x$ENABLE_imesh"])
-
-
-################################################################################
 #                           Zoltan
 ################################################################################
 if test $ENABLE_mbzoltan = yes; then

Modified: MOAB/trunk/m4/compiler.m4
===================================================================
--- MOAB/trunk/m4/compiler.m4	2009-06-05 06:16:36 UTC (rev 2931)
+++ MOAB/trunk/m4/compiler.m4	2009-06-05 19:03:38 UTC (rev 2932)
@@ -25,9 +25,23 @@
 #  CXXFLAGS - C++ compiler flags
 #  WITH_MPI - 'yes' if parallel support, 'no' otherwise
 #
+# Arguments:  three strings that msut be either "yes" or "no".
+#             - test for C compiler
+#             - test for C++ compiler
+#             - test for Fortran compiler
 #######################################################################################
 AC_DEFUN([SNL_CHECK_COMPILERS], [
 
+CHECK_CC="$1"
+CHECK_CXX="$2"
+CHECK_FC="$3"
+
+# If not specified or invalid value, change to yes.
+test "xno" = "x$CHECK_CC" || CHECK_CC=yes 
+test "xno" = "x$CHECK_CXX" || CHECK_CXX=yes 
+test "xno" = "x$CHECK_FC" || CHECK_FC=yes 
+
+
   # Save these before calling AC_PROG_CC or AC_PROG_CXX
   # because those macros will modify them, and we want
   # the original user values, not the autoconf defaults.
@@ -95,17 +109,31 @@
     WITH_MPI=yes
     ;;
 esac
-AC_PROG_CC( [$CC_LIST] )
+
+if test "xno" != "x$CHECK_CC"; then
+  AC_PROG_CC( [$CC_LIST] )
+  SNL_CC_FLAGS
+else
+  CC=
+fi
 AC_PROG_CPP
-AC_PROG_CXX( [$CXX_LIST] )
-AC_PROG_CXXCPP
-AC_PROG_FC( [$FC_LIST] )
-AC_PROG_F77( [$F77_LIST] )
+if test "xno" != "x$CHECK_CXX"; then
+  AC_PROG_CXX( [$CXX_LIST] )
+  AC_PROG_CXXCPP
+  SNL_CXX_FLAGS
+else
+  CXX=
+fi
+if test "xno" != "x$CHECK_FC"; then
+  AC_PROG_FC( [$FC_LIST] )
+  AC_PROG_F77( [$F77_LIST] )
+else
+  FC=
+  F77=
+fi
 
 # Try to determine compiler-specific flags.  This must be done
 # before setting up libtool so that it can override libtool settings.
-SNL_CC_FLAGS
-SNL_CXX_FLAGS
 CFLAGS="$USER_CFLAGS $SNL_CC_SPECIAL"
 CXXFLAGS="$USER_CXXFLAGS $SNL_CXX_SPECIAL"
 



More information about the moab-dev mailing list