* strings.c: Include config.h before bfd.h.

(file_off): New type.
	(file_open): Define.
	(print_strings): Use file_off instead of file_ptr.  Print addresses
	which don't fit into long correctly.
	(get_char): Use file_off instead of file_ptr.  Use getc_unlocked if
	available.
	(strings_file): Use file_off instead of file_ptr.  Use file_open.
	* configure.in: Check for getc_unlocked.
	Check for fopen64 and whether _LARGEFILE64_SOURCE needs to
	be defined for it.
	* configure: Rebuilt.
	* config.h.in: Rebuilt.
This commit is contained in:
Jakub Jelinek
2001-12-04 10:11:22 +00:00
parent d126725049
commit cedd9a5807
5 changed files with 174 additions and 15 deletions

View File

@ -100,7 +100,29 @@ AC_SUBST(DEMANGLER_NAME)
AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
AC_HEADER_SYS_WAIT
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(sbrk utimes setmode)
AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked)
# Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
# needs to be defined for it
AC_MSG_CHECKING([for fopen64])
AC_CACHE_VAL(bu_cv_have_fopen64,
[AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
bu_cv_have_fopen64=yes,
[saved_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
bu_cv_have_fopen64=no)
CPPFLAGS=$saved_CPPFLAGS])])
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
# Some systems have frexp only in -lm, not in -lc.
AC_SEARCH_LIBS(frexp, m)