diff --git a/config/ompi_config_pthreads.m4 b/config/ompi_config_pthreads.m4 index c1bfd5f81a..7543e5a257 100644 --- a/config/ompi_config_pthreads.m4 +++ b/config/ompi_config_pthreads.m4 @@ -356,7 +356,7 @@ AC_DEFUN([OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC], [ # # Fortran compiler # -if test "$ompi_pthread_fortran_success" = "0" -a "$OMPI_WANT_FORTRAN_BINDINGS" = "1"; then +if test "$ompi_pthread_fortran_success" = "0" -a "$OMPI_WANT_FORTRAN_BINDINGS" = "1" -a $ompi_fortran_happy -eq 1; then for pf in $pflags; do AC_MSG_CHECKING([if Fortran compiler and POSIX threads work with $pf]) FCFLAGS="$orig_FCFLAGS $pf" @@ -541,7 +541,7 @@ AC_DEFUN([OMPI_INTL_POSIX_THREADS_LIBS_FC],[ # # Fortran compiler # -if test "$ompi_pthread_fortran_success" = "0" -a "$OMPI_WANT_FORTRAN_BINDINGS" = "1"; then +if test "$ompi_pthread_fortran_success" = "0" -a "$OMPI_WANT_FORTRAN_BINDINGS" = "1" -a $ompi_fortran_happy -eq 1; then if test ! "$ompi_pthread_c_success" = "0" -a ! "$PTHREAD_LIBS" = "" ; then AC_MSG_CHECKING([if Fortran compiler and POSIX threads work with $PTHREAD_LIBS]) LIBS="$orig_LIBS $PTHREAD_LIBS" @@ -680,7 +680,7 @@ CXXCPPFLAGS="$orig_CXXCPPFLAGS" LDFLAGS="$orig_LDFLAGS" LIBS="$orig_LIBS" -if test "$OMPI_WANT_FORTRAN_BINDINGS" != "1"; then +if test "$OMPI_WANT_FORTRAN_BINDINGS" != "1" -o $ompi_fortran_happy -ne 1; then ompi_pthread_fortran_success=1 fi