summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-09 23:51:39 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-09 23:51:39 (GMT)
commit810cc51d5f46a50c3a5caf33cc9b9eb6705f13fc (patch)
tree6c1e264b93f28549e38f5527e54df79c4b762571 /configure.in
parenta0a62225094a890c1b07ebc4f89e4c7c45c66b13 (diff)
downloadcpython-810cc51d5f46a50c3a5caf33cc9b9eb6705f13fc.zip
cpython-810cc51d5f46a50c3a5caf33cc9b9eb6705f13fc.tar.gz
cpython-810cc51d5f46a50c3a5caf33cc9b9eb6705f13fc.tar.bz2
This time (I hope) I've fixed largefile
support on Linux (and Solaris, I expect) for real. The necessary symbols are defined once and for all, under the assumption that they won't harm elsewhere.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in46
1 files changed, 5 insertions, 41 deletions
diff --git a/configure.in b/configure.in
index eb57011..8f4b0b9 100644
--- a/configure.in
+++ b/configure.in
@@ -440,6 +440,11 @@ AC_MSG_CHECKING(for clock_t in time.h)
AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, AC_DEFINE(clock_t, long))
AC_MSG_RESULT($was_it_defined)
+# Two defines needed to enable largefile support on various platforms
+# These may affect some typedefs
+AC_DEFINE(_LARGEFILE_SOURCE)
+AC_DEFINE(_FILE_OFFSET_BITS, 64)
+
# Add some code to confdefs.h so that the test for off_t works on SCO
cat >> confdefs.h <<\EOF
#if defined(SCO_DS)
@@ -1276,47 +1281,6 @@ AC_CHECK_FUNCS(alarm chown clock confstr ctermid ctermid_r execv \
AC_CHECK_FUNCS(openpty,, AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"]))
AC_CHECK_FUNCS(forkpty,, AC_CHECK_LIB(util,forkpty, [AC_DEFINE(HAVE_FORKPTY)] [LIBS="$LIBS -lutil"]))
-# Try defining symbols to enable large file support.
-# The particular combination of symbols used here is known to work
-# on Linux and Solaris [2.]7.
-AC_MSG_CHECKING(for CFLAGS to enable large files)
-OLD_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <stdio.h>
-main() {
- FILE *fp;
- off_t seek = 0x80000000ul;
- off_t tell = 0;
- fp = fopen("conftestval", "wb");
- if (fp == NULL) {
- perror("conftestval");
- exit(1);
- }
- if (fseeko(fp, seek, 0) < 0)
- perror("fseeko");
- else
- tell = ftello(fp);
- fclose(fp);
- unlink("conftestval");
- if (tell == seek) {
- fprintf(stderr, "seek to 2**31 worked\n");
- exit(0);
- }
- else {
- exit(1);
- fprintf(stderr, "seek to 2**31 didn't work\n");
- }
-}
-],
-AC_MSG_RESULT(yes)
-AC_DEFINE(_LARGEFILE_SOURCE)
-AC_DEFINE(_FILE_OFFSET_BITS,64),
-AC_MSG_RESULT(no),
-AC_MSG_RESULT(no (cross-compiling)))
-CFLAGS="$OLD_CFLAGS"
-
# check for long file support functions
AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs)