瀏覽代碼

configure.ac: do not enable fortran if it was explicitely disabled by command-line option

Nathalie Furmento 7 年之前
父節點
當前提交
4ed5710472
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      configure.ac

+ 6 - 3
configure.ac

@@ -2488,10 +2488,12 @@ AC_SUBST([pkglibdir])
 
 AC_ARG_ENABLE(fortran, [AS_HELP_STRING([--disable-fortran],
 			[disable build of fortran examples])],
-			enable_build_fortran=$enableval, enable_build_fortran=yes)
+			enable_build_fortran_requested=$enableval, enable_build_fortran_requested=yes)
 use_mpi_fort=no
-if test "x$FC" != "x"; then
-	if $FC --version|grep -q 'GNU Fortran'; then
+enable_build_fortran=no
+if test "x$enable_build_fortran_requested" = "xyes" ; then
+   if test "x$FC" != "x"; then
+   	if $FC --version|grep -q 'GNU Fortran'; then
 		 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
      	         #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)
                  int dummy;
@@ -2574,6 +2576,7 @@ if test "x$FC" != "x"; then
 			fi
 		fi
 	fi
+   fi
 fi
 if test "x$enable_build_fortran" = "xyes" ; then
    if test "x$FC" = "x" ; then