diff options
author | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-23 20:43:54 +0000 |
---|---|---|
committer | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-23 20:43:54 +0000 |
commit | daad4fd542e74d22445a05a5be91761f094d4f27 (patch) | |
tree | 5d5bd3e427e9311346a6f6558c309b3c7348fc9d /libgfortran/configure | |
parent | 25b29122d906c4a4c1902a441ac3f2aecff90e5e (diff) | |
download | gcc-daad4fd542e74d22445a05a5be91761f094d4f27.tar.gz |
PR libfortran/23272
* acinclude.m4 (LIBGFOR_CHECK_WORKING_STAT): New check.
* configure.ac: Use LIBGFOR_CHECK_WORKING_STAT.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
* io/unix.c (compare_file_filename): Add fallback case for
systems without working stat.
* io/open.c (already_open): Correct call to
compare_file_filename.
* io/io.h: Correct proto for compare_file_filename.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105824 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/configure')
-rwxr-xr-x | libgfortran/configure | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/libgfortran/configure b/libgfortran/configure index 69ca7b75bc4..b3cc868364c 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -19353,6 +19353,82 @@ _ACEOF fi +# Check whether the system has a working stat() + + echo "$as_me:$LINENO: checking whether the target stat is reliable" >&5 +echo $ECHO_N "checking whether the target stat is reliable... $ECHO_C" >&6 +if test "${have_working_stat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "$cross_compiling" = yes; then + +case "${target}" in + *mingw*) have_working_stat=no ;; + *) have_working_stat=yes;; +esac +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +int main () +{ + FILE *f, *g; + struct stat st1, st2; + + f = fopen ("foo", "w"); + g = fopen ("bar", "w"); + if (stat ("foo", &st1) != 0 || stat ("bar", &st2)) + return 1; + if (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino) + return 1; + fclose(f); + fclose(g); + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (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 + have_working_stat=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +have_working_stat=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $have_working_stat" >&5 +echo "${ECHO_T}$have_working_stat" >&6 +if test x"$have_working_stat" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_WORKING_STAT 1 +_ACEOF + +fi + # Fallback in case isfinite is not available. echo "$as_me:$LINENO: checking for finite in -lm" >&5 echo $ECHO_N "checking for finite in -lm... $ECHO_C" >&6 |