From cd9a3bbc0f34f9b3c8391fd8baa1400ca3d34814 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Tue, 16 May 2006 07:06:33 +0000 Subject: [PATCH] Backport of 46010 - Test for sys/statvfs.h before including it, as statvfs is present on some OSX installations, but its header file is not. --- Misc/NEWS | 3 +++ Modules/posixmodule.c | 10 +++++----- configure | 7 ++++--- configure.in | 4 ++-- pyconfig.h.in | 3 +++ 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index 7df1bb0e33c5..392e37f5922d 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -60,6 +60,9 @@ Tools/Demos Build ----- +- Test for sys/statvfs.h before including it, as statvfs is present + on some OSX installation, but its header file is not. + - Fix test_long failure on Tru64 with gcc by using -mieee gcc option. Documentation diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index cec6b3b06cad..1e6640e42cd7 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -6041,7 +6041,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 */ @@ -6108,10 +6108,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__, @@ -7593,10 +7593,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 fdc65debcc2f..8c7467195868 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 43537 . +# From configure.in Revision: 43618 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for python 2.4. # @@ -4562,6 +4562,7 @@ done + for ac_header in curses.h dlfcn.h fcntl.h grp.h langinfo.h \ @@ -4570,8 +4571,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 do diff --git a/configure.in b/configure.in index b6196e92d41c..30284b468627 100644 --- a/configure.in +++ b/configure.in @@ -990,8 +990,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 34501f4de127..db2543de1c72 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -543,6 +543,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 -- 2.47.3