]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR libfortran/26893
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Jan 2007 07:12:16 +0000 (07:12 +0000)
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Jan 2007 07:12:16 +0000 (07:12 +0000)
* acinclude.m4 (LIBGFOR_WORKING_GFORTRAN): New check.
* configure.ac: Add call to LIBGFOR_WORKING_GFORTRAN.
* configure: Regenerate.
* config.h.in: Regenerate because it was forgottent in the last
commit.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120949 138bc75d-0d04-0410-961f-82ee72b054a4

libgfortran/ChangeLog
libgfortran/acinclude.m4
libgfortran/config.h.in
libgfortran/configure
libgfortran/configure.ac

index 5295968fc4ba071bf3e87712b4ed11e27bd077f7..bc303f30cd1d761b1bc46539b8c9d02163c36221 100644 (file)
@@ -1,13 +1,23 @@
+2007-01-19  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/26893
+       * acinclude.m4 (LIBGFOR_WORKING_GFORTRAN): New check.
+       * configure.ac: Add call to LIBGFOR_WORKING_GFORTRAN.
+       * configure: Regenerate.
+       * config.h.in: Regenerate because it was forgottent in the last
+       commit.
+
 2007-01-18  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
            Tobias Burnus  <burnus@net-b.de>
 
        PR libfortran/29649
        * runtime/environ.c (variable_table): New GFORTRAN_ERROR_DUMPCORE
-         environment variable.
+       environment variable.
        * runtime/compile_options.c (set_std): Add new argument.
-       * runtime/error.c (sys_exit): Move from io/unix.c. Add coredump functionality.
+       * runtime/error.c (sys_exit): Move from io/unix.c. Add coredump
+       functionality.
        * libgfortran.h (options_t): New dump_core and backtrace members.
-         (sys_exit): Move prototype.
+       (sys_exit): Move prototype.
        * io/unix.c (sys_exit): Move to runtime/error.c.
        * configure.ac: Add check for getrlimit.
        * configure: Regenerate.
index 73d67e18784971e0ac3ed251230cc0b5fb40cc2e..3c849faca198b7801e5cf7ed263bb7789ed6eded 100644 (file)
@@ -1,6 +1,22 @@
 m4_include(../config/acx.m4)
 m4_include(../config/no-executables.m4)
 
+dnl Check that we have a working GNU Fortran compiler
+AC_DEFUN([LIBGFOR_WORKING_GFORTRAN], [
+AC_MSG_CHECKING([whether the GNU Fortran compiler is working])
+AC_LANG_PUSH([Fortran])
+AC_COMPILE_IFELSE([[
+      program foo
+      real, parameter :: bar = sin (12.34 / 2.5)
+      end program foo]],
+    [AC_MSG_RESULT([yes])],
+    [AC_MSG_RESULT([no])
+     AC_MSG_ERROR([GNU Fortran is not working; please report a bug in http://gcc.gnu.org/bugzilla, attaching $PWD/config.log])
+    ])
+AC_LANG_POP([Fortran])
+])
+
+
 dnl Check:
 dnl * If we have gettimeofday;
 dnl * If we have struct timezone for use in calling it;
index 11f7cc6db754f17da87b734e5b48447fb8e32d3b..c67365fd20c6b588cd5a9b53889dcf02b068dfec 100644 (file)
 /* libc includes getpid */
 #undef HAVE_GETPID
 
+/* Define to 1 if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
 /* Define to 1 if you have the `getrusage' function. */
 #undef HAVE_GETRUSAGE
 
index 30b3eb29c7ad1467562ce6727037c95ee1cb0959..3b3ed6a039e15ad3335d86a5621728f69f78f4a1 100755 (executable)
@@ -4896,6 +4896,67 @@ case "${host}" in
 esac
 
 
+# We need a working compiler at that point, otherwise give a clear
+# error message and bail out.
+
+
+echo "$as_me:$LINENO: checking whether the GNU Fortran compiler is working" >&5
+echo $ECHO_N "checking whether the GNU Fortran compiler is working... $ECHO_C" >&6
+ac_ext=${FC_SRCEXT-f}
+ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+cat >conftest.$ac_ext <<_ACEOF
+
+      program foo
+      real, parameter :: bar = sin (12.34 / 2.5)
+      end program foo
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_fc_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+     { { echo "$as_me:$LINENO: error: GNU Fortran is not working; please report a bug in http://gcc.gnu.org/bugzilla, attaching $PWD/config.log" >&5
+echo "$as_me: error: GNU Fortran is not working; please report a bug in http://gcc.gnu.org/bugzilla, attaching $PWD/config.log" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
 # Check whether --enable-largefile or --disable-largefile was given.
 if test "${enable_largefile+set}" = set; then
   enableval="$enable_largefile"
index d97360f3275bfdad5fad0332f2ecebae5f18dc58..802d5ad3e089928832ad1f8f4ac20ae4b92bf77e 100644 (file)
@@ -151,6 +151,10 @@ case "${host}" in
 esac
 AC_SUBST(extra_ldflags_libgfortran)
 
+# We need a working compiler at that point, otherwise give a clear
+# error message and bail out.
+LIBGFOR_WORKING_GFORTRAN
+
 AC_SYS_LARGEFILE
 AC_TYPE_OFF_T