diff options
author | Victor Stinner <vstinner@python.org> | 2021-09-25 12:36:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-25 12:36:26 (GMT) |
commit | 7834ff26cbcd4d8394d64d80d9f51a364d38b1c6 (patch) | |
tree | e7c785c78db85d08be01a0f081589ea6d1a48614 /configure | |
parent | 71f8ff45c62bd6b792919ac7c3804a8628ae12cb (diff) | |
download | cpython-7834ff26cbcd4d8394d64d80d9f51a364d38b1c6.zip cpython-7834ff26cbcd4d8394d64d80d9f51a364d38b1c6.tar.gz cpython-7834ff26cbcd4d8394d64d80d9f51a364d38b1c6.tar.bz2 |
bpo-21302: Add nanosleep() implementation for time.sleep() in Unix (GH-28545)
Co-authored-by: Livius <egyszeregy@freemail.hu>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 58 |
1 files changed, 58 insertions, 0 deletions
@@ -13310,6 +13310,64 @@ fi done +for ac_func in nanosleep +do : + ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" +if test "x$ac_cv_func_nanosleep" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NANOSLEEP 1 +_ACEOF + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nanosleep in -lrt" >&5 +$as_echo_n "checking for nanosleep in -lrt... " >&6; } +if ${ac_cv_lib_rt_nanosleep+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char nanosleep (); +int +main () +{ +return nanosleep (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_nanosleep=yes +else + ac_cv_lib_rt_nanosleep=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_nanosleep" >&5 +$as_echo "$ac_cv_lib_rt_nanosleep" >&6; } +if test "x$ac_cv_lib_rt_nanosleep" = xyes; then : + + $as_echo "#define HAVE_NANOSLEEP 1" >>confdefs.h + + +fi + + +fi +done + + for ac_func in clock_getres do : ac_fn_c_check_func "$LINENO" "clock_getres" "ac_cv_func_clock_getres" |