--- Python-3.3.0b1/configure.ac 2012-06-26 21:19:58.000000000 +0100 +++ Python-3.3.0b1-utimes/configure.ac 2012-07-24 17:44:52.000000000 +0100 @@ -2672,12 +2672,11 @@ # checks for library functions AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \ clock confstr ctermid execv faccessat fchmod fchmodat fchown fchownat \ - fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \ - futimens futimes gai_strerror \ + fexecve fdopendir fork fpathconf fstatat ftime ftruncate gai_strerror \ getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \ getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \ if_nameindex \ - initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \ + initgroups kill killpg lchmod lchown lockf linkat lstat mmap \ memrchr mbrtowc mkdirat mkfifo \ mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \ posix_fallocate posix_fadvise pread \ @@ -2690,9 +2689,47 @@ sigaction sigaltstack siginterrupt sigpending sigrelse \ sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ - truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \ + truncate uname unlinkat unsetenv waitid waitpid wait3 wait4 \ wcscoll wcsftime wcsxfrm writev _getpty) +# Check for the real existance of the utimes functions which may be provided by the +# C runtime library but actually invoking them causes an error of ENOSYS ('Function +# not implemented') and Python exits. +py_utimes='futimesat futimens futimes lutimes utimensat utimes' +AH_TEMPLATE([HAVE_FUTIMESAT],[Define to 1 if you have a working 'futimesat' function]) +AH_TEMPLATE([HAVE_FUTIMENS],[Define to 1 if you have a working 'futimens' function]) +AH_TEMPLATE([HAVE_FUTIMES],[Define to 1 if you have a working 'futimes' function]) +AH_TEMPLATE([HAVE_LUTIMES],[Define to 1 if you have a working 'lutimes' function]) +AH_TEMPLATE([HAVE_UTIMENSAT],[Define to 1 if you have a working 'utimensat' function]) +AH_TEMPLATE([HAVE_UTIMES],[Define to 1 if you have a working 'utimes' function]) +for py_func in $py_utimes; do + AC_MSG_CHECKING(for non-stub version of $py_func) + case $py_func in + futimesat) py_callargs='0,"",0' ;; + futimens|futimes) py_callargs='0,0' ;; + lutimes|utimes) py_callargs='"",0' ;; + utimensat) py_callargs='0,"",0,0' ;; + esac + AC_RUN_IFELSE([AC_LANG_SOURCE([ +#define $py_func innocuous_$py_func +#ifdef __STDC__ +#include +#else +#include +#endif +#include +#undef $py_func +char $py_func(); +int main(void) { + return ($py_func($py_callargs) < 0 && errno == ENOSYS) ? 1 : 0; +}])],[ + AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]$py_func)) + AC_MSG_RESULT(yes) +],[ + AC_MSG_RESULT(no) +]) +done + AC_CHECK_DECL(dirfd, AC_DEFINE(HAVE_DIRFD, 1, Define if you have the 'dirfd' function or macro.), ,