Skip to content

Commit 4ebde73

Browse files
tiranErlend Egeberg Aasland
and
Erlend Egeberg Aasland
authored
bpo-40280: Move hard-coded feature checks to configure (GH-29789)
Co-authored-by: Erlend Egeberg Aasland <[email protected]>
1 parent b0b10e1 commit 4ebde73

File tree

5 files changed

+88
-70
lines changed

5 files changed

+88
-70
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``configure`` now checks for functions ``fork1, getegid,
2+
geteuid, getgid, getppid, getuid, opendir, pipe, system, wait,
3+
ttyname``.

Modules/posixmodule.c

-20
Original file line numberDiff line numberDiff line change
@@ -320,26 +320,6 @@ corresponding Unix manual entries for more information on calls.");
320320
# define HAVE_CWAIT 1
321321
# define HAVE_FSYNC 1
322322
# define fsync _commit
323-
# else
324-
/* Unix functions that the configure script doesn't check for */
325-
# ifndef __VXWORKS__
326-
# define HAVE_EXECV 1
327-
# define HAVE_FORK 1
328-
# if defined(__USLC__) && defined(__SCO_VERSION__) /* SCO UDK Compiler */
329-
# define HAVE_FORK1 1
330-
# endif
331-
# endif
332-
# define HAVE_GETEGID 1
333-
# define HAVE_GETEUID 1
334-
# define HAVE_GETGID 1
335-
# define HAVE_GETPPID 1
336-
# define HAVE_GETUID 1
337-
# define HAVE_KILL 1
338-
# define HAVE_OPENDIR 1
339-
# define HAVE_PIPE 1
340-
# define HAVE_SYSTEM 1
341-
# define HAVE_WAIT 1
342-
# define HAVE_TTYNAME 1
343323
# endif /* _MSC_VER */
344324
#endif /* ! __WATCOMC__ || __QNX__ */
345325

configure

+26-25
Original file line numberDiff line numberDiff line change
@@ -13376,31 +13376,32 @@ $as_echo "$MACHDEP_OBJS" >&6; }
1337613376
fi
1337713377

1337813378
# checks for library functions
13379-
for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
13380-
clock confstr close_range copy_file_range ctermid dup3 execv explicit_bzero \
13381-
explicit_memset faccessat fchmod fchmodat fchown fchownat \
13382-
fdwalk fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
13383-
futimens futimes gai_strerror getentropy \
13384-
getgrgid getgrgid_r getgrnam_r \
13385-
getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
13386-
getpriority getresuid getresgid getpwent getpwnam_r getpwuid_r getspnam getspent getsid getwd \
13387-
if_nameindex \
13388-
initgroups kill killpg lchown lockf linkat lstat lutimes mmap \
13389-
memrchr mbrtowc mkdirat mkfifo \
13390-
madvise mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
13391-
posix_fallocate posix_fadvise posix_spawn posix_spawnp pread preadv preadv2 \
13392-
pthread_condattr_setclock pthread_init pthread_kill pwrite pwritev pwritev2 \
13393-
readlink readlinkat readv realpath renameat \
13394-
sem_open sem_timedwait sem_clockwait sem_getvalue sem_unlink sendfile setegid seteuid \
13395-
setgid sethostname \
13396-
setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setpriority setuid setvbuf \
13397-
sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \
13398-
sched_rr_get_interval shutdown \
13399-
sigaction sigaltstack sigfillset siginterrupt sigpending sigrelse \
13400-
sigtimedwait sigwait sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \
13401-
sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
13402-
truncate uname unlinkat utimensat utimes vfork waitid waitpid wait3 wait4 \
13403-
wcscoll wcsftime wcsxfrm wmemcmp writev _getpty rtpSpawn
13379+
for ac_func in \
13380+
accept4 alarm bind_textdomain_codeset chown clock close_range confstr \
13381+
copy_file_range ctermid dup3 execv explicit_bzero explicit_memset \
13382+
faccessat fchmod fchmodat fchown fchownat fdopendir fdwalk fexecve \
13383+
fork fork1 fpathconf fstatat ftime ftruncate futimens futimes futimesat \
13384+
gai_strerror getegid getentropy geteuid getgid getgrgid getgrgid_r \
13385+
getgrnam_r getgrouplist getgroups getitimer getloadavg getlogin \
13386+
getpeername getpgid getpid getppid getpriority _getpty \
13387+
getpwent getpwnam_r getpwuid_r getresgid getresuid getsid getspent \
13388+
getspnam getuid getwd if_nameindex initgroups kill killpg lchown linkat \
13389+
lockf lstat lutimes madvise mbrtowc memrchr mkdirat mkfifo mkfifoat \
13390+
mknod mknodat mktime mmap mremap nice openat opendir pathconf pause pipe \
13391+
pipe2 plock poll posix_fadvise posix_fallocate posix_spawn posix_spawnp \
13392+
pread preadv preadv2 pthread_condattr_setclock pthread_init pthread_kill \
13393+
pwrite pwritev pwritev2 readlink readlinkat readv realpath renameat \
13394+
rtpSpawn sched_get_priority_max sched_rr_get_interval sched_setaffinity \
13395+
sched_setparam sched_setscheduler sem_clockwait sem_getvalue sem_open \
13396+
sem_timedwait sem_unlink sendfile setegid seteuid setgid sethostname \
13397+
setitimer setlocale setpgid setpgrp setpriority setregid setresgid \
13398+
setresuid setreuid setsid setuid setvbuf shutdown sigaction sigaltstack \
13399+
sigfillset siginterrupt sigpending sigrelse sigtimedwait sigwait \
13400+
sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \
13401+
sysconf system tcgetpgrp tcsetpgrp tempnam timegm times tmpfile \
13402+
tmpnam tmpnam_r truncate ttyname uname unlinkat utimensat utimes vfork \
13403+
wait wait3 wait4 waitid waitpid wcscoll wcsftime wcsxfrm wmemcmp writev \
13404+
1340413405
do :
1340513406
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
1340613407
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"

configure.ac

+26-25
Original file line numberDiff line numberDiff line change
@@ -3937,31 +3937,32 @@ else
39373937
fi
39383938

39393939
# checks for library functions
3940-
AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
3941-
clock confstr close_range copy_file_range ctermid dup3 execv explicit_bzero \
3942-
explicit_memset faccessat fchmod fchmodat fchown fchownat \
3943-
fdwalk fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
3944-
futimens futimes gai_strerror getentropy \
3945-
getgrgid getgrgid_r getgrnam_r \
3946-
getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
3947-
getpriority getresuid getresgid getpwent getpwnam_r getpwuid_r getspnam getspent getsid getwd \
3948-
if_nameindex \
3949-
initgroups kill killpg lchown lockf linkat lstat lutimes mmap \
3950-
memrchr mbrtowc mkdirat mkfifo \
3951-
madvise mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
3952-
posix_fallocate posix_fadvise posix_spawn posix_spawnp pread preadv preadv2 \
3953-
pthread_condattr_setclock pthread_init pthread_kill pwrite pwritev pwritev2 \
3954-
readlink readlinkat readv realpath renameat \
3955-
sem_open sem_timedwait sem_clockwait sem_getvalue sem_unlink sendfile setegid seteuid \
3956-
setgid sethostname \
3957-
setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setpriority setuid setvbuf \
3958-
sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \
3959-
sched_rr_get_interval shutdown \
3960-
sigaction sigaltstack sigfillset siginterrupt sigpending sigrelse \
3961-
sigtimedwait sigwait sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \
3962-
sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
3963-
truncate uname unlinkat utimensat utimes vfork waitid waitpid wait3 wait4 \
3964-
wcscoll wcsftime wcsxfrm wmemcmp writev _getpty rtpSpawn)
3940+
AC_CHECK_FUNCS([ \
3941+
accept4 alarm bind_textdomain_codeset chown clock close_range confstr \
3942+
copy_file_range ctermid dup3 execv explicit_bzero explicit_memset \
3943+
faccessat fchmod fchmodat fchown fchownat fdopendir fdwalk fexecve \
3944+
fork fork1 fpathconf fstatat ftime ftruncate futimens futimes futimesat \
3945+
gai_strerror getegid getentropy geteuid getgid getgrgid getgrgid_r \
3946+
getgrnam_r getgrouplist getgroups getitimer getloadavg getlogin \
3947+
getpeername getpgid getpid getppid getpriority _getpty \
3948+
getpwent getpwnam_r getpwuid_r getresgid getresuid getsid getspent \
3949+
getspnam getuid getwd if_nameindex initgroups kill killpg lchown linkat \
3950+
lockf lstat lutimes madvise mbrtowc memrchr mkdirat mkfifo mkfifoat \
3951+
mknod mknodat mktime mmap mremap nice openat opendir pathconf pause pipe \
3952+
pipe2 plock poll posix_fadvise posix_fallocate posix_spawn posix_spawnp \
3953+
pread preadv preadv2 pthread_condattr_setclock pthread_init pthread_kill \
3954+
pwrite pwritev pwritev2 readlink readlinkat readv realpath renameat \
3955+
rtpSpawn sched_get_priority_max sched_rr_get_interval sched_setaffinity \
3956+
sched_setparam sched_setscheduler sem_clockwait sem_getvalue sem_open \
3957+
sem_timedwait sem_unlink sendfile setegid seteuid setgid sethostname \
3958+
setitimer setlocale setpgid setpgrp setpriority setregid setresgid \
3959+
setresuid setreuid setsid setuid setvbuf shutdown sigaction sigaltstack \
3960+
sigfillset siginterrupt sigpending sigrelse sigtimedwait sigwait \
3961+
sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \
3962+
sysconf system tcgetpgrp tcsetpgrp tempnam timegm times tmpfile \
3963+
tmpnam tmpnam_r truncate ttyname uname unlinkat utimensat utimes vfork \
3964+
wait wait3 wait4 waitid waitpid wcscoll wcsftime wcsxfrm wmemcmp writev \
3965+
])
39653966

39663967
# Force lchmod off for Linux. Linux disallows changing the mode of symbolic
39673968
# links. Some libc implementations have a stub lchmod implementation that always

pyconfig.h.in

+33
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@
362362
/* Define to 1 if you have the `fork' function. */
363363
#undef HAVE_FORK
364364

365+
/* Define to 1 if you have the `fork1' function. */
366+
#undef HAVE_FORK1
367+
365368
/* Define to 1 if you have the `forkpty' function. */
366369
#undef HAVE_FORKPTY
367370

@@ -435,9 +438,18 @@
435438
/* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
436439
#undef HAVE_GETC_UNLOCKED
437440

441+
/* Define to 1 if you have the `getegid' function. */
442+
#undef HAVE_GETEGID
443+
438444
/* Define to 1 if you have the `getentropy' function. */
439445
#undef HAVE_GETENTROPY
440446

447+
/* Define to 1 if you have the `geteuid' function. */
448+
#undef HAVE_GETEUID
449+
450+
/* Define to 1 if you have the `getgid' function. */
451+
#undef HAVE_GETGID
452+
441453
/* Define to 1 if you have the `getgrgid' function. */
442454
#undef HAVE_GETGRGID
443455

@@ -495,6 +507,9 @@
495507
/* Define to 1 if you have the `getpid' function. */
496508
#undef HAVE_GETPID
497509

510+
/* Define to 1 if you have the `getppid' function. */
511+
#undef HAVE_GETPPID
512+
498513
/* Define to 1 if you have the `getpriority' function. */
499514
#undef HAVE_GETPRIORITY
500515

@@ -528,6 +543,9 @@
528543
/* Define to 1 if you have the `getspnam' function. */
529544
#undef HAVE_GETSPNAM
530545

546+
/* Define to 1 if you have the `getuid' function. */
547+
#undef HAVE_GETUID
548+
531549
/* Define to 1 if you have the `getwd' function. */
532550
#undef HAVE_GETWD
533551

@@ -767,6 +785,9 @@
767785
/* Define to 1 if you have the `openat' function. */
768786
#undef HAVE_OPENAT
769787

788+
/* Define to 1 if you have the `opendir' function. */
789+
#undef HAVE_OPENDIR
790+
770791
/* Define to 1 if you have the `openpty' function. */
771792
#undef HAVE_OPENPTY
772793

@@ -776,6 +797,9 @@
776797
/* Define to 1 if you have the `pause' function. */
777798
#undef HAVE_PAUSE
778799

800+
/* Define to 1 if you have the `pipe' function. */
801+
#undef HAVE_PIPE
802+
779803
/* Define to 1 if you have the `pipe2' function. */
780804
#undef HAVE_PIPE2
781805

@@ -1137,6 +1161,9 @@
11371161
/* Define to 1 if you have the <syslog.h> header file. */
11381162
#undef HAVE_SYSLOG_H
11391163

1164+
/* Define to 1 if you have the `system' function. */
1165+
#undef HAVE_SYSTEM
1166+
11401167
/* Define to 1 if you have the <sys/audioio.h> header file. */
11411168
#undef HAVE_SYS_AUDIOIO_H
11421169

@@ -1296,6 +1323,9 @@
12961323
/* Define to 1 if you have the `truncate' function. */
12971324
#undef HAVE_TRUNCATE
12981325

1326+
/* Define to 1 if you have the `ttyname' function. */
1327+
#undef HAVE_TTYNAME
1328+
12991329
/* Define to 1 if you don't have `tm_zone' but do have the external array
13001330
`tzname'. */
13011331
#undef HAVE_TZNAME
@@ -1347,6 +1377,9 @@
13471377
/* Define to 1 if you have the `vfork' function. */
13481378
#undef HAVE_VFORK
13491379

1380+
/* Define to 1 if you have the `wait' function. */
1381+
#undef HAVE_WAIT
1382+
13501383
/* Define to 1 if you have the `wait3' function. */
13511384
#undef HAVE_WAIT3
13521385

0 commit comments

Comments
 (0)