diff options
author | Rickard Green <rickard@erlang.org> | 2022-03-26 17:06:13 +0100 |
---|---|---|
committer | Rickard Green <rickard@erlang.org> | 2022-03-26 17:06:13 +0100 |
commit | b039f70ce7374862041401ac36461f1657cf2869 (patch) | |
tree | 86cfa823dfaaa69987aa927f0a4e566db60992e6 | |
parent | 6bac5ba903c5ed4b49c5259ba1444a9856baf206 (diff) | |
download | erlang-b039f70ce7374862041401ac36461f1657cf2869.tar.gz |
Update configure scripts
-rwxr-xr-x | erts/configure | 181 |
1 files changed, 143 insertions, 38 deletions
diff --git a/erts/configure b/erts/configure index e1907b292e..85e38d5d14 100755 --- a/erts/configure +++ b/erts/configure @@ -8164,14 +8164,30 @@ fi + # CLOCK_MONOTONIC is buggy on MacOS (darwin), or at least on Big Sur + # and Monterey, since it may step backwards. if test "no" = "yes"; then - default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_BOOTTIME CLOCK_MONOTONIC" - low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST" - high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_PRECISE" + case $host_os in + darwin*) + default_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW_APPROX" + high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW";; + *) + default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_BOOTTIME CLOCK_MONOTONIC" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST" + high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_PRECISE";; + esac else - default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME CLOCK_MONOTONIC" - low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_UPTIME_FAST" - high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_PRECISE" + case $host_os in + darwin*) + default_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW" + low_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW_APPROX" + high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW";; + *) + default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME CLOCK_MONOTONIC" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_UPTIME_FAST" + high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_PRECISE";; + esac fi case "try_find_pthread_compatible" in @@ -8185,11 +8201,11 @@ fi ;; custom_resolution) check_msg="custom resolution " - prefer_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_MONOTONIC" + prefer_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME_RAW CLOCK_MONOTONIC" ;; *) check_msg="custom " - prefer_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_MONOTONIC" + prefer_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME_RAW CLOCK_MONOTONIC" ;; esac @@ -19502,6 +19518,15 @@ case "$with_clock_gettime_monotonic_id" in CLOCK_REALTIME*|CLOCK_TAI*) as_fn_error $? "Invalid clock_gettime() monotonic clock id: Refusing to use the realtime clock id $with_clock_gettime_monotonic_id as monotonic clock id" "$LINENO" 5 ;; + CLOCK_MONOTONIC) + case $host_os in + darwin*) + # CLOCK_MONOTONIC is buggy on MacOS (darwin), or at least on Big Sur + # and Monterey, since it may step backwards. + as_fn_error $? "Invalid clock_gettime() monotonic clock id: Refusing to use $with_clock_gettime_monotonic_id as monotonic clock id since it is buggy on MacOS" "$LINENO" 5;; + *) + ;; + esac;; CLOCK_*) ;; *) @@ -19512,14 +19537,30 @@ esac case "$with_clock_resolution-$with_clock_gettime_monotonic_id" in high-no) + # CLOCK_MONOTONIC is buggy on MacOS (darwin), or at least on Big Sur + # and Monterey, since it may step backwards. if test "$prefer_elapsed_monotonic_time_during_suspend" = "yes"; then - default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_BOOTTIME CLOCK_MONOTONIC" - low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST" - high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_PRECISE" + case $host_os in + darwin*) + default_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW_APPROX" + high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW";; + *) + default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_BOOTTIME CLOCK_MONOTONIC" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST" + high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_PRECISE";; + esac else - default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME CLOCK_MONOTONIC" - low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_UPTIME_FAST" - high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_PRECISE" + case $host_os in + darwin*) + default_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW" + low_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW_APPROX" + high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW";; + *) + default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME CLOCK_MONOTONIC" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_UPTIME_FAST" + high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_PRECISE";; + esac fi case "high_resolution" in @@ -19804,14 +19845,30 @@ $as_echo "$erl_cv_mach_clock_get_time_monotonic" >&6; } ;; low-no) + # CLOCK_MONOTONIC is buggy on MacOS (darwin), or at least on Big Sur + # and Monterey, since it may step backwards. if test "$prefer_elapsed_monotonic_time_during_suspend" = "yes"; then - default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_BOOTTIME CLOCK_MONOTONIC" - low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST" - high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_PRECISE" + case $host_os in + darwin*) + default_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW_APPROX" + high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW";; + *) + default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_BOOTTIME CLOCK_MONOTONIC" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST" + high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_PRECISE";; + esac else - default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME CLOCK_MONOTONIC" - low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_UPTIME_FAST" - high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_PRECISE" + case $host_os in + darwin*) + default_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW" + low_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW_APPROX" + high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW";; + *) + default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME CLOCK_MONOTONIC" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_UPTIME_FAST" + high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_PRECISE";; + esac fi case "low_resolution" in @@ -20096,14 +20153,30 @@ $as_echo "$erl_cv_mach_clock_get_time_monotonic" >&6; } ;; default-no) + # CLOCK_MONOTONIC is buggy on MacOS (darwin), or at least on Big Sur + # and Monterey, since it may step backwards. if test "$prefer_elapsed_monotonic_time_during_suspend" = "yes"; then - default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_BOOTTIME CLOCK_MONOTONIC" - low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST" - high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_PRECISE" + case $host_os in + darwin*) + default_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW_APPROX" + high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW";; + *) + default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_BOOTTIME CLOCK_MONOTONIC" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST" + high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_PRECISE";; + esac else - default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME CLOCK_MONOTONIC" - low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_UPTIME_FAST" - high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_PRECISE" + case $host_os in + darwin*) + default_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW" + low_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW_APPROX" + high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW";; + *) + default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME CLOCK_MONOTONIC" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_UPTIME_FAST" + high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_PRECISE";; + esac fi case "default_resolution" in @@ -20388,14 +20461,30 @@ $as_echo "$erl_cv_mach_clock_get_time_monotonic" >&6; } ;; *) + # CLOCK_MONOTONIC is buggy on MacOS (darwin), or at least on Big Sur + # and Monterey, since it may step backwards. if test "$prefer_elapsed_monotonic_time_during_suspend" = "yes"; then - default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_BOOTTIME CLOCK_MONOTONIC" - low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST" - high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_PRECISE" + case $host_os in + darwin*) + default_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW_APPROX" + high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW";; + *) + default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_BOOTTIME CLOCK_MONOTONIC" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST" + high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_PRECISE";; + esac else - default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME CLOCK_MONOTONIC" - low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_UPTIME_FAST" - high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_PRECISE" + case $host_os in + darwin*) + default_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW" + low_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW_APPROX" + high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW";; + *) + default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME CLOCK_MONOTONIC" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_UPTIME_FAST" + high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_PRECISE";; + esac fi case "custom_resolution" in @@ -20754,14 +20843,30 @@ $as_echo "#define HAVE_CLOCK_GETTIME_MONOTONIC_RAW 1" >>confdefs.h fi + # CLOCK_MONOTONIC is buggy on MacOS (darwin), or at least on Big Sur + # and Monterey, since it may step backwards. if test "no" = "yes"; then - default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_BOOTTIME CLOCK_MONOTONIC" - low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST" - high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_PRECISE" + case $host_os in + darwin*) + default_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW_APPROX" + high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_RAW";; + *) + default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_BOOTTIME CLOCK_MONOTONIC" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST" + high_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_PRECISE";; + esac else - default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME CLOCK_MONOTONIC" - low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_UPTIME_FAST" - high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_PRECISE" + case $host_os in + darwin*) + default_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW" + low_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW_APPROX" + high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_RAW";; + *) + default_resolution_clock_gettime_monotonic="CLOCK_HIGHRES CLOCK_UPTIME CLOCK_MONOTONIC" + low_resolution_clock_gettime_monotonic="CLOCK_MONOTONIC_COARSE CLOCK_UPTIME_FAST" + high_resolution_clock_gettime_monotonic="CLOCK_UPTIME_PRECISE";; + esac fi case "high_resolution" in |