Index: config/f77_get_value_true.m4
===================================================================
--- config/f77_get_value_true.m4	(revision 8263)
+++ config/f77_get_value_true.m4	(working copy)
@@ -25,22 +25,81 @@
     AC_MSG_RESULT([no Fortran 77 bindings -- skipped])
 else
 
+if test "x$ompi_ac_doubleunder" = xy || test "x$ompi_ac_singleunder" = xy; then
+    ompi_ac_print_logical_fn=print_
+else
+    if test "x$ompi_ac_nounder" = xy; then
+        ompi_ac_print_logical_fn=print
+    else
+        if test "x$ompi_ac_caps" = xy; then
+            ompi_ac_print_logical_fn=PRINT
+        else
+            AC_MSG_WARN([*** FORTRAN external naming convention undefined])
+            AC_MSG_ERROR([*** Cannot continue.])
+        fi
+    fi
+fi
+
+#
+# C module
+# We really need the confdefs.h Header file for
+# the ompi_fortran_logical_t definition
+#
+if test \! -f confdefs.h ; then
+    AC_MSG_WARN([*** Problem running configure test!])
+    AC_MSG_WARN([*** Cannot find confdefs.h file for config test])
+    AC_MSG_WARN([*** See config.log for details.])
+    AC_MSG_ERROR([*** Cannot continue.])
+fi
+
+cat > conftest.c <<EOF
+#include <stdio.h>
+#include <stdlib.h>
+#include "confdefs.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+void $ompi_ac_print_logical_fn(ompi_fortran_logical_t * logical);
+
+void $ompi_ac_print_logical_fn(ompi_fortran_logical_t * logical)
+{
+    int result = 0;
+    FILE *f=fopen("conftestval", "w");
+    if (!f) exit(1);
+
+    if( 1 == sizeof(ompi_fortran_logical_t) ) {
+        fprintf(f, "%d\n", (int)*logical);
+    } else if( 2 == sizeof(ompi_fortran_logical_t) ) {
+        fprintf(f, "%d\n", (int)*logical);
+    } else if( 4 == sizeof(ompi_fortran_logical_t) ) {
+        fprintf(f, "%d\n", (int)*logical);
+    } else {
+        exit(1);
+    }
+}
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+
   cat > conftestf.f <<EOF
       program main
       logical value
-      open(8, file="conftestval")
       value=.TRUE.
-      write(8, fmt="(I5)") value
-      close(8)
+      CALL PRINT(value)
       end
 EOF
 
   #
   # Try the compilation and run.
   #
-  OMPI_LOG_COMMAND([$F77 $FFLAGS -o conftest conftestf.f],
+  OMPI_LOG_COMMAND( [$CC $CFLAGS -I. -c conftest.c],
+      OMPI_LOG_COMMAND([$F77 $FFLAGS -o conftest conftest.o conftestf.f $LDFLAGS $LIBS],
           OMPI_LOG_COMMAND([./conftest], [HAPPY=1], [HAPPY=0]),
-          [HAPPY=0])
+          [HAPPY=0]),
+      [HAPPY=0])
 
   if test "$HAPPY" = "1" -a -f conftestval; then
       # get rid of leading spaces for eval assignment
@@ -51,8 +110,10 @@
   else
       AC_MSG_RESULT([unknown])
 
+      OMPI_LOG_MSG([here is the C program:], 1)
+      OMPI_LOG_FILE([conftest.c])
       OMPI_LOG_MSG([here is the fortran program:], 1)
-      OMPI_LOG_FILE([conftestf.f90])
+      OMPI_LOG_FILE([conftestf.f])
 
       AC_MSG_WARN([*** Problem running configure test!])
       AC_MSG_WARN([*** See config.log for details.])
@@ -65,4 +126,4 @@
 AC_DEFINE_UNQUOTED(OMPI_FORTRAN_VALUE_TRUE,
   $OMPI_FORTRAN_VALUE_TRUE,
   [Fortran value for LOGICAL .TRUE. value])
-])dnl
\ No newline at end of file
+])dnl
