From 5f5d99c21521972baee65c99ae8b02e9339b8ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Tue, 16 May 2006 07:05:37 +0000 Subject: - Test for sys/statvfs.h before including it, as statvfs is present on some OSX installation, but its header file is not. Will backport to 2.4 --- Modules/posixmodule.c | 10 +++++----- configure | 7 ++++--- configure.in | 4 ++-- pyconfig.h.in | 3 +++ 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 03fae25..68d8809 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -6518,7 +6518,7 @@ posix_WSTOPSIG(PyObject *self, PyObject *args) #endif /* HAVE_SYS_WAIT_H */ -#if defined(HAVE_FSTATVFS) +#if defined(HAVE_FSTATVFS) && defined(HAVE_SYS_STATVFS_H) #ifdef _SCO_DS /* SCO OpenServer 5.0 and later requires _SVID3 before it reveals the needed definitions in sys/statvfs.h */ @@ -6585,10 +6585,10 @@ posix_fstatvfs(PyObject *self, PyObject *args) return _pystatvfs_fromstructstatvfs(st); } -#endif /* HAVE_FSTATVFS */ +#endif /* HAVE_FSTATVFS && HAVE_SYS_STATVFS_H */ -#if defined(HAVE_STATVFS) +#if defined(HAVE_STATVFS) && defined(HAVE_SYS_STATVFS_H) #include PyDoc_STRVAR(posix_statvfs__doc__, @@ -8126,10 +8126,10 @@ static PyMethodDef posix_methods[] = { {"WSTOPSIG", posix_WSTOPSIG, METH_VARARGS, posix_WSTOPSIG__doc__}, #endif /* WSTOPSIG */ #endif /* HAVE_SYS_WAIT_H */ -#ifdef HAVE_FSTATVFS +#if defined(HAVE_FSTATVFS) && defined(HAVE_SYS_STATVFS_H) {"fstatvfs", posix_fstatvfs, METH_VARARGS, posix_fstatvfs__doc__}, #endif -#ifdef HAVE_STATVFS +#if defined(HAVE_STATVFS) && defined(HAVE_SYS_STATVFS_H) {"statvfs", posix_statvfs, METH_VARARGS, posix_statvfs__doc__}, #endif #ifdef HAVE_TMPFILE diff --git a/configure b/configure index c1ad419..f829580 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 45800 . +# From configure.in Revision: 45995 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for python 2.5. # @@ -4583,14 +4583,15 @@ done + for ac_header in asm/types.h curses.h dlfcn.h fcntl.h grp.h \ shadow.h langinfo.h libintl.h ncurses.h poll.h pthread.h \ stropts.h termios.h thread.h \ unistd.h utime.h \ sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h sys/lock.h sys/mkdev.h \ sys/modem.h \ -sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ -sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ +sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/time.h \ +sys/times.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ bluetooth/bluetooth.h do diff --git a/configure.in b/configure.in index 8b82841..26c881f 100644 --- a/configure.in +++ b/configure.in @@ -1033,8 +1033,8 @@ stropts.h termios.h thread.h \ unistd.h utime.h \ sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h sys/lock.h sys/mkdev.h \ sys/modem.h \ -sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ -sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ +sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/time.h \ +sys/times.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ bluetooth/bluetooth.h) AC_HEADER_DIRENT diff --git a/pyconfig.h.in b/pyconfig.h.in index acbbd8d..df3c1cd 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -579,6 +579,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STATVFS_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H -- cgit v0.12