diff options
-rw-r--r-- | libgfortran/ChangeLog | 16 | ||||
-rw-r--r-- | libgfortran/acinclude.m4 | 16 | ||||
-rw-r--r-- | libgfortran/config.h.in | 3 | ||||
-rwxr-xr-x | libgfortran/configure | 61 | ||||
-rw-r--r-- | libgfortran/configure.ac | 4 |
5 files changed, 97 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 5295968fc4b..bc303f30cd1 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -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. diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index 73d67e18784..3c849faca19 100644 --- a/libgfortran/acinclude.m4 +++ b/libgfortran/acinclude.m4 @@ -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; diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in index 11f7cc6db75..c67365fd20c 100644 --- a/libgfortran/config.h.in +++ b/libgfortran/config.h.in @@ -375,6 +375,9 @@ /* 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 diff --git a/libgfortran/configure b/libgfortran/configure index 30b3eb29c7a..3b3ed6a039e 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -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" diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index d97360f3275..802d5ad3e08 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -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 |