bpo-40280: Move hard-coded feature checks to configure (GH-29789)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
This commit is contained in:
Christian Heimes 2021-11-26 20:36:48 +02:00 committed by GitHub
parent b0b10e146b
commit 4ebde73b8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 88 additions and 70 deletions

View File

@ -0,0 +1,3 @@
``configure`` now checks for functions ``fork1, getegid,
geteuid, getgid, getppid, getuid, opendir, pipe, system, wait,
ttyname``.

View File

@ -320,26 +320,6 @@ corresponding Unix manual entries for more information on calls.");
# define HAVE_CWAIT 1 # define HAVE_CWAIT 1
# define HAVE_FSYNC 1 # define HAVE_FSYNC 1
# define fsync _commit # define fsync _commit
# else
/* Unix functions that the configure script doesn't check for */
# ifndef __VXWORKS__
# define HAVE_EXECV 1
# define HAVE_FORK 1
# if defined(__USLC__) && defined(__SCO_VERSION__) /* SCO UDK Compiler */
# define HAVE_FORK1 1
# endif
# endif
# define HAVE_GETEGID 1
# define HAVE_GETEUID 1
# define HAVE_GETGID 1
# define HAVE_GETPPID 1
# define HAVE_GETUID 1
# define HAVE_KILL 1
# define HAVE_OPENDIR 1
# define HAVE_PIPE 1
# define HAVE_SYSTEM 1
# define HAVE_WAIT 1
# define HAVE_TTYNAME 1
# endif /* _MSC_VER */ # endif /* _MSC_VER */
#endif /* ! __WATCOMC__ || __QNX__ */ #endif /* ! __WATCOMC__ || __QNX__ */

51
configure vendored
View File

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

View File

@ -3937,31 +3937,32 @@ else
fi fi
# checks for library functions # checks for library functions
AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \ AC_CHECK_FUNCS([ \
clock confstr close_range copy_file_range ctermid dup3 execv explicit_bzero \ accept4 alarm bind_textdomain_codeset chown clock close_range confstr \
explicit_memset faccessat fchmod fchmodat fchown fchownat \ copy_file_range ctermid dup3 execv explicit_bzero explicit_memset \
fdwalk fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \ faccessat fchmod fchmodat fchown fchownat fdopendir fdwalk fexecve \
futimens futimes gai_strerror getentropy \ fork fork1 fpathconf fstatat ftime ftruncate futimens futimes futimesat \
getgrgid getgrgid_r getgrnam_r \ gai_strerror getegid getentropy geteuid getgid getgrgid getgrgid_r \
getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \ getgrnam_r getgrouplist getgroups getitimer getloadavg getlogin \
getpriority getresuid getresgid getpwent getpwnam_r getpwuid_r getspnam getspent getsid getwd \ getpeername getpgid getpid getppid getpriority _getpty \
if_nameindex \ getpwent getpwnam_r getpwuid_r getresgid getresuid getsid getspent \
initgroups kill killpg lchown lockf linkat lstat lutimes mmap \ getspnam getuid getwd if_nameindex initgroups kill killpg lchown linkat \
memrchr mbrtowc mkdirat mkfifo \ lockf lstat lutimes madvise mbrtowc memrchr mkdirat mkfifo mkfifoat \
madvise mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \ mknod mknodat mktime mmap mremap nice openat opendir pathconf pause pipe \
posix_fallocate posix_fadvise posix_spawn posix_spawnp pread preadv preadv2 \ pipe2 plock poll posix_fadvise posix_fallocate posix_spawn posix_spawnp \
pthread_condattr_setclock pthread_init pthread_kill pwrite pwritev pwritev2 \ pread preadv preadv2 pthread_condattr_setclock pthread_init pthread_kill \
readlink readlinkat readv realpath renameat \ pwrite pwritev pwritev2 readlink readlinkat readv realpath renameat \
sem_open sem_timedwait sem_clockwait sem_getvalue sem_unlink sendfile setegid seteuid \ rtpSpawn sched_get_priority_max sched_rr_get_interval sched_setaffinity \
setgid sethostname \ sched_setparam sched_setscheduler sem_clockwait sem_getvalue sem_open \
setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setpriority setuid setvbuf \ sem_timedwait sem_unlink sendfile setegid seteuid setgid sethostname \
sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \ setitimer setlocale setpgid setpgrp setpriority setregid setresgid \
sched_rr_get_interval shutdown \ setresuid setreuid setsid setuid setvbuf shutdown sigaction sigaltstack \
sigaction sigaltstack sigfillset siginterrupt sigpending sigrelse \ sigfillset siginterrupt sigpending sigrelse sigtimedwait sigwait \
sigtimedwait sigwait sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \ sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \
sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ sysconf system tcgetpgrp tcsetpgrp tempnam timegm times tmpfile \
truncate uname unlinkat utimensat utimes vfork waitid waitpid wait3 wait4 \ tmpnam tmpnam_r truncate ttyname uname unlinkat utimensat utimes vfork \
wcscoll wcsftime wcsxfrm wmemcmp writev _getpty rtpSpawn) wait wait3 wait4 waitid waitpid wcscoll wcsftime wcsxfrm wmemcmp writev \
])
# Force lchmod off for Linux. Linux disallows changing the mode of symbolic # Force lchmod off for Linux. Linux disallows changing the mode of symbolic
# links. Some libc implementations have a stub lchmod implementation that always # links. Some libc implementations have a stub lchmod implementation that always

View File

@ -362,6 +362,9 @@
/* Define to 1 if you have the `fork' function. */ /* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK #undef HAVE_FORK
/* Define to 1 if you have the `fork1' function. */
#undef HAVE_FORK1
/* Define to 1 if you have the `forkpty' function. */ /* Define to 1 if you have the `forkpty' function. */
#undef HAVE_FORKPTY #undef HAVE_FORKPTY
@ -435,9 +438,18 @@
/* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */ /* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
#undef HAVE_GETC_UNLOCKED #undef HAVE_GETC_UNLOCKED
/* Define to 1 if you have the `getegid' function. */
#undef HAVE_GETEGID
/* Define to 1 if you have the `getentropy' function. */ /* Define to 1 if you have the `getentropy' function. */
#undef HAVE_GETENTROPY #undef HAVE_GETENTROPY
/* Define to 1 if you have the `geteuid' function. */
#undef HAVE_GETEUID
/* Define to 1 if you have the `getgid' function. */
#undef HAVE_GETGID
/* Define to 1 if you have the `getgrgid' function. */ /* Define to 1 if you have the `getgrgid' function. */
#undef HAVE_GETGRGID #undef HAVE_GETGRGID
@ -495,6 +507,9 @@
/* Define to 1 if you have the `getpid' function. */ /* Define to 1 if you have the `getpid' function. */
#undef HAVE_GETPID #undef HAVE_GETPID
/* Define to 1 if you have the `getppid' function. */
#undef HAVE_GETPPID
/* Define to 1 if you have the `getpriority' function. */ /* Define to 1 if you have the `getpriority' function. */
#undef HAVE_GETPRIORITY #undef HAVE_GETPRIORITY
@ -528,6 +543,9 @@
/* Define to 1 if you have the `getspnam' function. */ /* Define to 1 if you have the `getspnam' function. */
#undef HAVE_GETSPNAM #undef HAVE_GETSPNAM
/* Define to 1 if you have the `getuid' function. */
#undef HAVE_GETUID
/* Define to 1 if you have the `getwd' function. */ /* Define to 1 if you have the `getwd' function. */
#undef HAVE_GETWD #undef HAVE_GETWD
@ -767,6 +785,9 @@
/* Define to 1 if you have the `openat' function. */ /* Define to 1 if you have the `openat' function. */
#undef HAVE_OPENAT #undef HAVE_OPENAT
/* Define to 1 if you have the `opendir' function. */
#undef HAVE_OPENDIR
/* Define to 1 if you have the `openpty' function. */ /* Define to 1 if you have the `openpty' function. */
#undef HAVE_OPENPTY #undef HAVE_OPENPTY
@ -776,6 +797,9 @@
/* Define to 1 if you have the `pause' function. */ /* Define to 1 if you have the `pause' function. */
#undef HAVE_PAUSE #undef HAVE_PAUSE
/* Define to 1 if you have the `pipe' function. */
#undef HAVE_PIPE
/* Define to 1 if you have the `pipe2' function. */ /* Define to 1 if you have the `pipe2' function. */
#undef HAVE_PIPE2 #undef HAVE_PIPE2
@ -1137,6 +1161,9 @@
/* Define to 1 if you have the <syslog.h> header file. */ /* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H #undef HAVE_SYSLOG_H
/* Define to 1 if you have the `system' function. */
#undef HAVE_SYSTEM
/* Define to 1 if you have the <sys/audioio.h> header file. */ /* Define to 1 if you have the <sys/audioio.h> header file. */
#undef HAVE_SYS_AUDIOIO_H #undef HAVE_SYS_AUDIOIO_H
@ -1296,6 +1323,9 @@
/* Define to 1 if you have the `truncate' function. */ /* Define to 1 if you have the `truncate' function. */
#undef HAVE_TRUNCATE #undef HAVE_TRUNCATE
/* Define to 1 if you have the `ttyname' function. */
#undef HAVE_TTYNAME
/* Define to 1 if you don't have `tm_zone' but do have the external array /* Define to 1 if you don't have `tm_zone' but do have the external array
`tzname'. */ `tzname'. */
#undef HAVE_TZNAME #undef HAVE_TZNAME
@ -1347,6 +1377,9 @@
/* Define to 1 if you have the `vfork' function. */ /* Define to 1 if you have the `vfork' function. */
#undef HAVE_VFORK #undef HAVE_VFORK
/* Define to 1 if you have the `wait' function. */
#undef HAVE_WAIT
/* Define to 1 if you have the `wait3' function. */ /* Define to 1 if you have the `wait3' function. */
#undef HAVE_WAIT3 #undef HAVE_WAIT3