From fb5b547845302fe64f118f9bc5eb0ef636cfafb7 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 13 Oct 2004 14:33:51 +0000 Subject: * strings.c (statbuf): New typedef. (file_stat): Define. (strings_object_file): Avoid using get_file_size, instead do the checks here, using file_stat. * configure.in (HAVE_STAT64): New test. * configure: Rebuilt. * config.in: Rebuilt. --- binutils/configure.in | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'binutils/configure.in') diff --git a/binutils/configure.in b/binutils/configure.in index 8889084..3eaa825 100644 --- a/binutils/configure.in +++ b/binutils/configure.in @@ -118,10 +118,27 @@ AC_MSG_RESULT($bu_cv_have_fopen64) if test "$bu_cv_have_fopen64" != no; then AC_DEFINE([HAVE_FOPEN64], 1, [Is fopen64 available?]) - if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE"; then - AC_DEFINE([_LARGEFILE64_SOURCE], 1, - [Enable LFS]) - fi +fi +AC_MSG_CHECKING([for stat64]) +AC_CACHE_VAL(bu_cv_have_stat64, +[AC_TRY_LINK([#include ], [struct stat64 st; stat64 ("/tmp/foo", &st);], +bu_cv_have_stat64=yes, +[saved_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" + AC_TRY_LINK([#include ], [struct stat64 st; stat64 ("/tmp/foo", &st);], +bu_cv_have_stat64="need -D_LARGEFILE64_SOURCE", +bu_cv_have_stat64=no) + CPPFLAGS=$saved_CPPFLAGS])]) +AC_MSG_RESULT($bu_cv_have_stat64) +if test "$bu_cv_have_stat64" != no; then + AC_DEFINE([HAVE_STAT64], 1, + [Is stat64 available?]) +fi +if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE" \ + || test "$bu_cv_have_stat64" = "need -D_LARGEFILE64_SOURCE"; then + AC_DEFINE([_LARGEFILE64_SOURCE], 1, + [Enable LFS]) + CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" fi # Some systems have frexp only in -lm, not in -lc. -- cgit v1.1