The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #13705 from MisterDA/configure-caches

Cache test results of custom Autoconf tests from `aclocal.m4`

authored by

David Allsopp and committed by
GitHub
9c1ed0f4 0e8a8eb6

+348 -431
+3
Changes
··· 474 474 475 475 ### Build system: 476 476 477 + - #13705: Cache test results of custom Autoconf tests from aclocal.m4. 478 + (Antonin Décimo, review by David Allsopp and Miod Vallat) 479 + 477 480 - #13810: Support build of cross compilers to native freestanding targets 478 481 (Samuel Hym, review by Antonin Décimo and Romain Calascibetta) 479 482
+1 -1
Makefile.config.in
··· 67 67 CC=@CC@ 68 68 69 69 CC_HAS_DEBUG_PREFIX_MAP=@cc_has_debug_prefix_map@ 70 - AS_HAS_DEBUG_PREFIX_MAP=@as_has_debug_prefix_map@ 70 + AS_HAS_DEBUG_PREFIX_MAP=@ocaml_cv_prog_as_debug_prefix_map@ 71 71 72 72 LDFLAGS?=@LDFLAGS@ 73 73
+114 -96
aclocal.m4
··· 97 97 ) 98 98 ]) 99 99 100 - dnl $1: extra CFLAGS 101 100 AC_DEFUN([OCAML_CC_SUPPORTS_TREE_VECTORIZE], [ 102 - AC_MSG_CHECKING( 103 - [whether the C compiler supports __attribute__((optimize("tree-vectorize")))]) 104 - saved_CFLAGS="$CFLAGS" 105 - CFLAGS="$1 $CFLAGS" 106 - AC_COMPILE_IFELSE( 107 - [AC_LANG_PROGRAM( 108 - [[__attribute__((optimize("tree-vectorize"))) void f(void) {}]], 109 - [[f();]])], 110 - [AC_DEFINE([SUPPORTS_TREE_VECTORIZE], [1]) 111 - AC_MSG_RESULT([yes])], 112 - [AC_MSG_RESULT([no])]) 113 - CFLAGS="$saved_CFLAGS" 101 + AC_CACHE_CHECK(m4_normalize([whether the C compiler supports 102 + __attribute__((optimize("tree-vectorize")))]), 103 + [ocaml_cv_prog_cc_optimize_tree_vectorize], 104 + [saved_CFLAGS="$CFLAGS" 105 + CFLAGS="$warn_error_flag $CFLAGS" 106 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( 107 + [[__attribute__((optimize("tree-vectorize"))) void f(void) {}]], 108 + [[f();]])], 109 + [ocaml_cv_prog_cc_optimize_tree_vectorize=yes], 110 + [ocaml_cv_prog_cc_optimize_tree_vectorize=no]) 111 + CFLAGS="$saved_CFLAGS"]) 112 + AS_IF([test "x$ocaml_cv_prog_cc_optimize_tree_vectorize" = xyes], 113 + [AC_DEFINE([SUPPORTS_TREE_VECTORIZE], [1])]) 114 114 ]) 115 115 116 116 # Save C compiler related variables ··· 140 140 ]) 141 141 142 142 AC_DEFUN([OCAML_AS_HAS_DEBUG_PREFIX_MAP], [ 143 - AC_MSG_CHECKING([whether the assembler supports --debug-prefix-map]) 143 + AC_CACHE_CHECK([whether the assembler supports --debug-prefix-map], 144 + [ocaml_cv_prog_as_debug_prefix_map], 145 + [OCAML_CC_SAVE_VARIABLES 144 146 145 - OCAML_CC_SAVE_VARIABLES 146 - 147 - # Modify C-compiler variables to use the assembler 148 - CC="$AS" 149 - CFLAGS="--debug-prefix-map old=new -o conftest.$ac_objext" 150 - CPPFLAGS="" 151 - ac_ext="S" 152 - ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 147 + # Modify C-compiler variables to use the assembler 148 + CC="$AS" 149 + CFLAGS="--debug-prefix-map old=new -o conftest.$ac_objext" 150 + CPPFLAGS="" 151 + ac_ext="S" 152 + ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 153 153 154 - AC_COMPILE_IFELSE( 155 - [AC_LANG_SOURCE([ 154 + AC_COMPILE_IFELSE([AC_LANG_SOURCE([ 156 155 camlPervasives__loop_1128: 157 156 .file 1 "pervasives.ml" 158 157 .loc 1 193 159 158 ])], 160 - [as_has_debug_prefix_map=true 161 - AC_MSG_RESULT([yes])], 162 - [as_has_debug_prefix_map=false 163 - AC_MSG_RESULT([no])]) 159 + [ocaml_cv_prog_as_debug_prefix_map=true], 160 + [ocaml_cv_prog_as_debug_prefix_map=false]) 164 161 165 - OCAML_CC_RESTORE_VARIABLES 162 + OCAML_CC_RESTORE_VARIABLES]) 166 163 ]) 167 164 168 165 AC_DEFUN([OCAML_AS_HAS_CFI_DIRECTIVES], [ 169 166 AC_MSG_CHECKING([whether the assembler supports CFI directives]) 170 - 171 - AS_IF([test x"$enable_cfi" = "xno"], 172 - [AC_MSG_RESULT([disabled])], 173 - [OCAML_CC_SAVE_VARIABLES 174 - 175 - # Modify C-compiler variables to use the assembler 176 - CC="$ASPP" 177 - CFLAGS="-o conftest.$ac_objext" 178 - CPPFLAGS="" 179 - ac_ext="S" 180 - ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 167 + AS_IF([test "x$enable_cfi" != xno], 168 + [AC_CACHE_VAL([ocaml_cv_prog_as_cfi_directives], 169 + [ocaml_cv_prog_as_cfi_directives=no 170 + OCAML_CC_SAVE_VARIABLES 171 + # Modify C-compiler variables to use the assembler 172 + CC="$ASPP" 173 + CFLAGS="-o conftest.$ac_objext" 174 + CPPFLAGS="" 175 + ac_ext="S" 176 + ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 181 177 182 - AC_COMPILE_IFELSE( 183 - [AC_LANG_SOURCE([ 184 - camlPervasives__loop_1128: 185 - .file 1 "pervasives.ml" 186 - .loc 1 193 187 - .cfi_startproc 188 - .cfi_adjust_cfa_offset 8 189 - .cfi_endproc 190 - ])], 191 - [aspp_ok=true], 192 - [aspp_ok=false]) 178 + AC_COMPILE_IFELSE( 179 + [AC_LANG_SOURCE([ 180 + camlPervasives__loop_1128: 181 + .file 1 "pervasives.ml" 182 + .loc 1 193 183 + .cfi_startproc 184 + .cfi_adjust_cfa_offset 8 185 + .cfi_endproc 186 + ])], 187 + [prog_aspp_ok=true], 188 + [prog_aspp_ok=false]) 193 189 194 - AS_IF([test "$AS" = "$ASPP"], 195 - [as_ok="$aspp_ok"], 196 - [CC="$AS" 197 - ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 198 - AC_COMPILE_IFELSE( 199 - [AC_LANG_SOURCE([ 190 + AS_IF([test "$AS" = "$ASPP"], 191 + [prog_as_ok="$prog_aspp_ok"], 192 + [CC="$AS" 193 + ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 194 + AC_COMPILE_IFELSE( 195 + [AC_LANG_SOURCE([ 200 196 camlPervasives__loop_1128: 201 197 .file 1 "pervasives.ml" 202 198 .loc 1 193 203 199 .cfi_startproc 204 200 .cfi_adjust_cfa_offset 8 205 201 .cfi_endproc 206 - ])], 207 - [as_ok=true], 208 - [as_ok=false])]) 202 + ])], 203 + [prog_as_ok=true], 204 + [prog_as_ok=false])]) 209 205 210 - OCAML_CC_RESTORE_VARIABLES 206 + OCAML_CC_RESTORE_VARIABLES 211 207 212 - AS_IF([$aspp_ok && $as_ok], 208 + AS_IF([$prog_aspp_ok && $prog_as_ok], 209 + [ocaml_cv_prog_as_cfi_directives=yes])]) 210 + AS_IF([test "x$ocaml_cv_prog_as_cfi_directives" = xyes], 213 211 [asm_cfi_supported=true 214 212 AC_DEFINE([ASM_CFI_SUPPORTED], [1]) 215 213 AC_MSG_RESULT([yes])], 216 - [AS_IF([test x"$enable_cfi" = "xyes"], 217 - [AC_MSG_RESULT([requested but not available 218 - AC_MSG_ERROR([exiting])])], 219 - [asm_cfi_supported=false 220 - AC_MSG_RESULT([no])])]) 221 - ])]) 214 + [AC_MSG_RESULT([requested but not available 215 + AC_MSG_ERROR([exiting])])])], 216 + [asm_cfi_supported=false 217 + AC_MSG_RESULT([disabled])]) 218 + ]) 222 219 223 220 AC_DEFUN([OCAML_MMAP_SUPPORTS_MAP_STACK], [ 224 221 AC_MSG_CHECKING([whether mmap supports MAP_STACK]) 225 - AC_RUN_IFELSE( 226 - [AC_LANG_PROGRAM([[ 222 + AC_CACHE_VAL([ocaml_cv_func_mmap_MAP_STACK], 223 + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ 227 224 #include <sys/mman.h> 228 225 #include <stdio.h> 229 226 #include <stdlib.h> ··· 235 232 if (block == MAP_FAILED) 236 233 return 1; 237 234 ]])], 238 - [has_mmap_map_stack=true 239 - AC_MSG_RESULT([yes])], 240 - [AC_MSG_RESULT([no])], 241 - [AC_MSG_RESULT([no assumed])]) 235 + [ocaml_cv_func_mmap_MAP_STACK=yes], 236 + [ocaml_cv_func_mmap_MAP_STACK=no], 237 + [ocaml_cv_func_mmap_MAP_STACK=no])]) 238 + AS_IF([test $cross_compiling = yes && \ 239 + test "x$ocaml_cv_func_mmap_MAP_STACK" = xno], 240 + [AC_MSG_RESULT([no assumed])], 241 + [AC_MSG_RESULT([$ocaml_cv_func_mmap_MAP_STACK])]) 242 242 ]) 243 243 244 244 AC_DEFUN([OCAML_MMAP_SUPPORTS_HUGE_PAGES], [ 245 245 AC_MSG_CHECKING([whether mmap supports huge pages]) 246 - AC_RUN_IFELSE( 247 - [AC_LANG_PROGRAM([[ 246 + AC_CACHE_VAL([ocaml_cv_func_mmap_huge_pages], 247 + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ 248 248 #include <sys/mman.h> 249 249 #include <stdio.h> 250 250 #include <stdlib.h> ··· 279 279 p[i] = (char) i; 280 280 } 281 281 ]])], 282 + [ocaml_cv_func_mmap_huge_pages=yes], 283 + [ocaml_cv_func_mmap_huge_pages=no], 284 + [ocaml_cv_func_mmap_huge_pages=no])]) 285 + AS_IF([test x"$ocaml_cv_func_mmap_huge_pages" = "xyes"], 282 286 [AC_DEFINE([HAS_HUGE_PAGES], [1]) 283 287 AC_DEFINE_UNQUOTED([HUGE_PAGE_SIZE], [(4 * 1024 * 1024)]) 284 288 AC_MSG_RESULT([yes])], 285 - [AC_MSG_RESULT([no])], 286 - [AC_MSG_RESULT([no assumed])]) 289 + [AS_IF([test $cross_compiling = yes], 290 + [AC_MSG_RESULT([no assumed])], 291 + [AC_MSG_RESULT([no])])]) 287 292 ]) 288 293 289 294 AC_DEFUN([OCAML_CHECK_LIBUNWIND], [ ··· 490 495 done 491 496 ]) 492 497 493 - AC_DEFUN([OCAML_CC_SUPPORTS_ATOMIC], [ 494 - OCAML_CC_SAVE_VARIABLES 495 - 496 - opts="" 497 - AS_IF([test -n "$1"],[CFLAGS="$CFLAGS $1"; opts="$1"]) 498 - AS_IF([test -n "$2"],[LIBS="$LIBS $2"; opts="${opts:+$opts }$2"]) 499 - AC_MSG_CHECKING(m4_normalize([if $CC supports _Atomic types with 500 - ${opts:-no additional options}])) 501 - 502 - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 498 + # OCAML_CC_C11_ATOMIC_CFLAGS([LIBS]) 499 + AC_DEFUN([OCAML_CC_C11_ATOMIC_CFLAGS], [ 500 + AC_MSG_CHECKING([for options needed to enable C11 atomic support]) 501 + AC_CACHE_VAL([ocaml_cv_prog_cc_c11_atomic_cflags], 502 + [ocaml_cv_prog_cc_c11_atomic_cflags=no 503 + for ocaml_arg in dnl 504 + ''dnl 505 + '-experimental:c11atomics'dnl 506 + '-std:c11'dnl remove with Autoconf 2.73 as cl will default to C11 507 + '-std:c11 -experimental:c11atomics'dnl same 508 + ; do 509 + OCAML_CC_SAVE_VARIABLES 510 + CFLAGS="$CFLAGS $ocaml_arg" 511 + AS_IF([test -n "$1"], [LIBS="$LIBS $1"]) 512 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 503 513 #include <stdint.h> 504 514 #include <stdatomic.h> 505 - ]],[[ 515 + ]],[[ 506 516 _Atomic int64_t n; 507 517 int m; 508 518 int * _Atomic p = &m; ··· 510 520 * atomic_exchange(&p, 0) = 45; 511 521 if (atomic_load_explicit(&n, memory_order_acquire)) 512 522 return 1; 513 - ]])], 514 - [cc_supports_atomic=true 515 - AC_MSG_RESULT([yes])], 516 - [cc_supports_atomic=false 517 - AC_MSG_RESULT([no])]) 518 - 519 - OCAML_CC_RESTORE_VARIABLES 523 + ]])], 524 + [AS_IF([test x"$ocaml_arg" = x], 525 + [ocaml_cv_prog_cc_c11_atomic_cflags=''], 526 + [ocaml_cv_prog_cc_c11_atomic_cflags="$ocaml_arg"]) 527 + OCAML_CC_RESTORE_VARIABLES 528 + break]) 529 + OCAML_CC_RESTORE_VARIABLES 530 + done]) 531 + AS_IF([test "x$ocaml_cv_prog_cc_c11_atomic_cflags" = xno], 532 + [AC_MSG_FAILURE(m4_normalize( 533 + [C11 atomic support is required, use another C compiler]))], 534 + [AS_IF([test "x$ocaml_cv_prog_cc_c11_atomic_cflags" = x], 535 + [AC_MSG_RESULT([none needed])], 536 + [AC_MSG_RESULT([$ocaml_cv_prog_cc_c11_atomic_cflags]) 537 + common_cflags="$common_cflags $ocaml_cv_prog_cc_c11_atomic_cflags"])]) 520 538 ]) 521 539 522 540 # Detects whether the C compiler generates an explicit .note.GNU-stack section
+191 -281
configure
··· 717 717 ac_header_c_list= 718 718 ac_subst_vars='LTLIBOBJS 719 719 LIBOBJS 720 + DIFF_FLAGS 720 721 DIFF 721 722 PTHREAD_CFLAGS 722 723 PTHREAD_LIBS ··· 863 864 build_ocamldebug 864 865 with_debugger 865 866 as_is_cc 866 - as_has_debug_prefix_map 867 + ocaml_cv_prog_as_debug_prefix_map 867 868 cc_has_debug_prefix_map 868 869 unix_directory 869 870 unix_library ··· 945 946 ac_tool_prefix 946 947 CSCFLAGS 947 948 CSC 948 - diff_supports_color 949 - DIFF_FLAGS 949 + ocaml_cv_prog_diff_supports_color 950 950 encode_C_literal 951 951 SAK 952 952 SAK_BUILD ··· 3397 3397 ocamltest_unix_impl="dummy" 3398 3398 unix_library="" 3399 3399 unix_directory="" 3400 - diff_supports_color=false 3401 3400 target_libdir_is_relative=false 3402 3401 srcdir_abs='' 3403 3402 srcdir_abs_real='' ··· 3465 3464 CMT_MAGIC_NUMBER=Caml1999T037 3466 3465 3467 3466 LINEAR_MAGIC_NUMBER=Caml1999L037 3468 - 3469 3467 3470 3468 3471 3469 ··· 18475 18473 # Support for C11 atomic types 18476 18474 18477 18475 18478 - 18479 - saved_CC="$CC" 18480 - saved_CFLAGS="$CFLAGS" 18481 - saved_CPPFLAGS="$CPPFLAGS" 18482 - saved_LIBS="$LIBS" 18483 - saved_ac_ext="$ac_ext" 18484 - saved_ac_compile="$ac_compile" 18485 - # Move the content of confdefs.h to another file so it does not 18486 - # get included 18487 - mv confdefs.h confdefs.h.bak 18488 - touch confdefs.h 18489 - 18490 - 18491 - opts="" 18492 - if test -n "" 18493 - then : 18494 - CFLAGS="$CFLAGS "; opts="" 18495 - fi 18496 - if test -n "$cclibs" 18476 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for options needed to enable C11 atomic support" >&5 18477 + printf %s "checking for options needed to enable C11 atomic support... " >&6; } 18478 + if test ${ocaml_cv_prog_cc_c11_atomic_cflags+y} 18497 18479 then : 18498 - LIBS="$LIBS $cclibs"; opts="${opts:+$opts }$cclibs" 18499 - fi 18500 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports _Atomic types with ${opts:-no additional options}" >&5 18501 - printf %s "checking if $CC supports _Atomic types with ${opts:-no additional options}... " >&6; } 18502 - 18503 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext 18504 - /* end confdefs.h. */ 18505 - 18506 - #include <stdint.h> 18507 - #include <stdatomic.h> 18508 - 18509 - int 18510 - main (void) 18511 - { 18512 - 18513 - _Atomic int64_t n; 18514 - int m; 18515 - int * _Atomic p = &m; 18516 - atomic_store_explicit(&n, 123, memory_order_release); 18517 - * atomic_exchange(&p, 0) = 45; 18518 - if (atomic_load_explicit(&n, memory_order_acquire)) 18519 - return 1; 18520 - 18521 - ; 18522 - return 0; 18523 - } 18524 - _ACEOF 18525 - if ac_fn_c_try_link "$LINENO" 18526 - then : 18527 - cc_supports_atomic=true 18528 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 18529 - printf "%s\n" "yes" >&6; } 18480 + printf %s "(cached) " >&6 18530 18481 else $as_nop 18531 - cc_supports_atomic=false 18532 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 18533 - printf "%s\n" "no" >&6; } 18534 - fi 18535 - rm -f core conftest.err conftest.$ac_objext conftest.beam \ 18536 - conftest$ac_exeext conftest.$ac_ext 18537 - 18538 - 18539 - # Restore the content of confdefs.h 18540 - mv confdefs.h.bak confdefs.h 18541 - ac_compile="$saved_ac_compile" 18542 - ac_ext="$saved_ac_ext" 18543 - CPPFLAGS="$saved_CPPFLAGS" 18544 - CFLAGS="$saved_CFLAGS" 18545 - CC="$saved_CC" 18546 - LIBS="$saved_LIBS" 18547 - 18548 - 18549 - case $cc_supports_atomic,$ocaml_cc_vendor in #( 18550 - false,msvc-*) : 18551 - 18482 + ocaml_cv_prog_cc_c11_atomic_cflags=no 18483 + for ocaml_arg in '' '-experimental:c11atomics' '-std:c11' '-std:c11 -experimental:c11atomics' ; do 18552 18484 18553 18485 saved_CC="$CC" 18554 18486 saved_CFLAGS="$CFLAGS" ··· 18561 18493 mv confdefs.h confdefs.h.bak 18562 18494 touch confdefs.h 18563 18495 18564 - 18565 - opts="" 18566 - if test -n "-std:c11" 18496 + CFLAGS="$CFLAGS $ocaml_arg" 18497 + if test -n "$cclibs" 18567 18498 then : 18568 - CFLAGS="$CFLAGS -std:c11"; opts="-std:c11" 18499 + LIBS="$LIBS $cclibs" 18569 18500 fi 18570 - if test -n "" 18571 - then : 18572 - LIBS="$LIBS "; opts="${opts:+$opts }" 18573 - fi 18574 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports _Atomic types with ${opts:-no additional options}" >&5 18575 - printf %s "checking if $CC supports _Atomic types with ${opts:-no additional options}... " >&6; } 18576 - 18577 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext 18501 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 18578 18502 /* end confdefs.h. */ 18579 18503 18580 18504 #include <stdint.h> ··· 18598 18522 _ACEOF 18599 18523 if ac_fn_c_try_link "$LINENO" 18600 18524 then : 18601 - cc_supports_atomic=true 18602 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 18603 - printf "%s\n" "yes" >&6; } 18525 + if test x"$ocaml_arg" = x 18526 + then : 18527 + ocaml_cv_prog_cc_c11_atomic_cflags='' 18604 18528 else $as_nop 18605 - cc_supports_atomic=false 18606 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 18607 - printf "%s\n" "no" >&6; } 18529 + ocaml_cv_prog_cc_c11_atomic_cflags="$ocaml_arg" 18608 18530 fi 18609 - rm -f core conftest.err conftest.$ac_objext conftest.beam \ 18610 - conftest$ac_exeext conftest.$ac_ext 18611 - 18612 18531 18613 18532 # Restore the content of confdefs.h 18614 18533 mv confdefs.h.bak confdefs.h ··· 18619 18538 CC="$saved_CC" 18620 18539 LIBS="$saved_LIBS" 18621 18540 18622 - 18623 - if $cc_supports_atomic 18624 - then : 18625 - common_cflags="$common_cflags -std:c11" 18626 - else $as_nop 18627 - 18628 - 18629 - saved_CC="$CC" 18630 - saved_CFLAGS="$CFLAGS" 18631 - saved_CPPFLAGS="$CPPFLAGS" 18632 - saved_LIBS="$LIBS" 18633 - saved_ac_ext="$ac_ext" 18634 - saved_ac_compile="$ac_compile" 18635 - # Move the content of confdefs.h to another file so it does not 18636 - # get included 18637 - mv confdefs.h confdefs.h.bak 18638 - touch confdefs.h 18639 - 18640 - 18641 - opts="" 18642 - if test -n "-std:c11 -experimental:c11atomics" 18643 - then : 18644 - CFLAGS="$CFLAGS -std:c11 -experimental:c11atomics"; opts="-std:c11 -experimental:c11atomics" 18645 - fi 18646 - if test -n "" 18647 - then : 18648 - LIBS="$LIBS "; opts="${opts:+$opts }" 18649 - fi 18650 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports _Atomic types with ${opts:-no additional options}" >&5 18651 - printf %s "checking if $CC supports _Atomic types with ${opts:-no additional options}... " >&6; } 18652 - 18653 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext 18654 - /* end confdefs.h. */ 18655 - 18656 - #include <stdint.h> 18657 - #include <stdatomic.h> 18658 - 18659 - int 18660 - main (void) 18661 - { 18662 - 18663 - _Atomic int64_t n; 18664 - int m; 18665 - int * _Atomic p = &m; 18666 - atomic_store_explicit(&n, 123, memory_order_release); 18667 - * atomic_exchange(&p, 0) = 45; 18668 - if (atomic_load_explicit(&n, memory_order_acquire)) 18669 - return 1; 18670 - 18671 - ; 18672 - return 0; 18673 - } 18674 - _ACEOF 18675 - if ac_fn_c_try_link "$LINENO" 18676 - then : 18677 - cc_supports_atomic=true 18678 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 18679 - printf "%s\n" "yes" >&6; } 18680 - else $as_nop 18681 - cc_supports_atomic=false 18682 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 18683 - printf "%s\n" "no" >&6; } 18541 + break 18684 18542 fi 18685 18543 rm -f core conftest.err conftest.$ac_objext conftest.beam \ 18686 18544 conftest$ac_exeext conftest.$ac_ext 18687 - 18688 18545 18689 18546 # Restore the content of confdefs.h 18690 18547 mv confdefs.h.bak confdefs.h ··· 18695 18552 CC="$saved_CC" 18696 18553 LIBS="$saved_LIBS" 18697 18554 18698 - 18699 - if $cc_supports_atomic 18700 - then : 18701 - common_cflags="$common_cflags -std:c11 -experimental:c11atomics" 18555 + done 18702 18556 fi 18703 18557 18704 - fi ;; #( 18705 - *) : 18706 - ;; 18707 - esac 18708 - if ! $cc_supports_atomic 18558 + if test "x$ocaml_cv_prog_cc_c11_atomic_cflags" = xno 18709 18559 then : 18710 18560 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 18711 18561 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} 18712 18562 as_fn_error $? "C11 atomic support is required, use another C compiler 18713 18563 See \`config.log' for more details" "$LINENO" 5; } 18564 + else $as_nop 18565 + if test "x$ocaml_cv_prog_cc_c11_atomic_cflags" = x 18566 + then : 18567 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 18568 + printf "%s\n" "none needed" >&6; } 18569 + else $as_nop 18570 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_prog_cc_c11_atomic_cflags" >&5 18571 + printf "%s\n" "$ocaml_cv_prog_cc_c11_atomic_cflags" >&6; } 18572 + common_cflags="$common_cflags $ocaml_cv_prog_cc_c11_atomic_cflags" 18714 18573 fi 18574 + fi 18575 + 18715 18576 18716 18577 # Full support for thread local storage 18717 18578 # macOS and MinGW-w64 have problems with thread local storage accessed from DLLs ··· 18952 18813 18953 18814 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler supports __attribute__((optimize(\"tree-vectorize\")))" >&5 18954 18815 printf %s "checking whether the C compiler supports __attribute__((optimize(\"tree-vectorize\")))... " >&6; } 18816 + if test ${ocaml_cv_prog_cc_optimize_tree_vectorize+y} 18817 + then : 18818 + printf %s "(cached) " >&6 18819 + else $as_nop 18955 18820 saved_CFLAGS="$CFLAGS" 18956 - CFLAGS="$warn_error_flag $CFLAGS" 18957 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext 18821 + CFLAGS="$warn_error_flag $CFLAGS" 18822 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 18958 18823 /* end confdefs.h. */ 18959 18824 __attribute__((optimize("tree-vectorize"))) void f(void) {} 18960 18825 int ··· 18967 18832 _ACEOF 18968 18833 if ac_fn_c_try_compile "$LINENO" 18969 18834 then : 18970 - printf "%s\n" "#define SUPPORTS_TREE_VECTORIZE 1" >>confdefs.h 18971 - 18972 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 18973 - printf "%s\n" "yes" >&6; } 18835 + ocaml_cv_prog_cc_optimize_tree_vectorize=yes 18974 18836 else $as_nop 18975 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 18976 - printf "%s\n" "no" >&6; } 18837 + ocaml_cv_prog_cc_optimize_tree_vectorize=no 18977 18838 fi 18978 18839 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext 18979 - CFLAGS="$saved_CFLAGS" 18840 + CFLAGS="$saved_CFLAGS" 18841 + fi 18842 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_prog_cc_optimize_tree_vectorize" >&5 18843 + printf "%s\n" "$ocaml_cv_prog_cc_optimize_tree_vectorize" >&6; } 18844 + if test "x$ocaml_cv_prog_cc_optimize_tree_vectorize" = xyes 18845 + then : 18846 + printf "%s\n" "#define SUPPORTS_TREE_VECTORIZE 1" >>confdefs.h 18847 + 18848 + fi 18980 18849 18981 18850 18982 18851 # Check whether the C compiler supports the labels as values extension. ··· 23615 23484 esac 23616 23485 23617 23486 ## Does the assembler support debug prefix map and CFI directives 23618 - as_has_debug_prefix_map=false 23619 - asm_cfi_supported=false 23620 23487 if $native_compiler 23621 23488 then : 23622 23489 case $target in #( ··· 23626 23493 23627 23494 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the assembler supports --debug-prefix-map" >&5 23628 23495 printf %s "checking whether the assembler supports --debug-prefix-map... " >&6; } 23629 - 23496 + if test ${ocaml_cv_prog_as_debug_prefix_map+y} 23497 + then : 23498 + printf %s "(cached) " >&6 23499 + else $as_nop 23630 23500 23631 23501 saved_CC="$CC" 23632 23502 saved_CFLAGS="$CFLAGS" ··· 23640 23510 touch confdefs.h 23641 23511 23642 23512 23643 - # Modify C-compiler variables to use the assembler 23644 - CC="$AS" 23645 - CFLAGS="--debug-prefix-map old=new -o conftest.$ac_objext" 23646 - CPPFLAGS="" 23647 - ac_ext="S" 23648 - ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 23513 + # Modify C-compiler variables to use the assembler 23514 + CC="$AS" 23515 + CFLAGS="--debug-prefix-map old=new -o conftest.$ac_objext" 23516 + CPPFLAGS="" 23517 + ac_ext="S" 23518 + ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 23649 23519 23650 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext 23520 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 23651 23521 /* end confdefs.h. */ 23652 23522 23653 23523 camlPervasives__loop_1128: ··· 23657 23527 _ACEOF 23658 23528 if ac_fn_c_try_compile "$LINENO" 23659 23529 then : 23660 - as_has_debug_prefix_map=true 23661 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 23662 - printf "%s\n" "yes" >&6; } 23530 + ocaml_cv_prog_as_debug_prefix_map=true 23663 23531 else $as_nop 23664 - as_has_debug_prefix_map=false 23665 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 23666 - printf "%s\n" "no" >&6; } 23532 + ocaml_cv_prog_as_debug_prefix_map=false 23667 23533 fi 23668 23534 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext 23669 23535 ··· 23677 23543 CC="$saved_CC" 23678 23544 LIBS="$saved_LIBS" 23679 23545 23546 + fi 23547 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_prog_as_debug_prefix_map" >&5 23548 + printf "%s\n" "$ocaml_cv_prog_as_debug_prefix_map" >&6; } 23680 23549 23681 23550 23682 23551 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the assembler supports CFI directives" >&5 23683 23552 printf %s "checking whether the assembler supports CFI directives... " >&6; } 23684 - 23685 - if test x"$enable_cfi" = "xno" 23553 + if test "x$enable_cfi" != xno 23686 23554 then : 23687 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 23688 - printf "%s\n" "disabled" >&6; } 23555 + if test ${ocaml_cv_prog_as_cfi_directives+y} 23556 + then : 23557 + printf %s "(cached) " >&6 23689 23558 else $as_nop 23559 + ocaml_cv_prog_as_cfi_directives=no 23690 23560 23691 23561 saved_CC="$CC" 23692 23562 saved_CFLAGS="$CFLAGS" ··· 23699 23569 mv confdefs.h confdefs.h.bak 23700 23570 touch confdefs.h 23701 23571 23572 + # Modify C-compiler variables to use the assembler 23573 + CC="$ASPP" 23574 + CFLAGS="-o conftest.$ac_objext" 23575 + CPPFLAGS="" 23576 + ac_ext="S" 23577 + ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 23702 23578 23703 - # Modify C-compiler variables to use the assembler 23704 - CC="$ASPP" 23705 - CFLAGS="-o conftest.$ac_objext" 23706 - CPPFLAGS="" 23707 - ac_ext="S" 23708 - ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 23709 - 23710 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext 23579 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 23711 23580 /* end confdefs.h. */ 23712 23581 23713 - camlPervasives__loop_1128: 23714 - .file 1 "pervasives.ml" 23715 - .loc 1 193 23716 - .cfi_startproc 23717 - .cfi_adjust_cfa_offset 8 23718 - .cfi_endproc 23582 + camlPervasives__loop_1128: 23583 + .file 1 "pervasives.ml" 23584 + .loc 1 193 23585 + .cfi_startproc 23586 + .cfi_adjust_cfa_offset 8 23587 + .cfi_endproc 23719 23588 23720 23589 _ACEOF 23721 23590 if ac_fn_c_try_compile "$LINENO" 23722 23591 then : 23723 - aspp_ok=true 23592 + prog_aspp_ok=true 23724 23593 else $as_nop 23725 - aspp_ok=false 23594 + prog_aspp_ok=false 23726 23595 fi 23727 23596 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext 23728 23597 23729 - if test "$AS" = "$ASPP" 23598 + if test "$AS" = "$ASPP" 23730 23599 then : 23731 - as_ok="$aspp_ok" 23600 + prog_as_ok="$prog_aspp_ok" 23732 23601 else $as_nop 23733 23602 CC="$AS" 23734 - ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 23735 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext 23603 + ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 23604 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 23736 23605 /* end confdefs.h. */ 23737 23606 23738 23607 camlPervasives__loop_1128: ··· 23745 23614 _ACEOF 23746 23615 if ac_fn_c_try_compile "$LINENO" 23747 23616 then : 23748 - as_ok=true 23617 + prog_as_ok=true 23749 23618 else $as_nop 23750 - as_ok=false 23619 + prog_as_ok=false 23751 23620 fi 23752 23621 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext 23753 23622 fi ··· 23763 23632 LIBS="$saved_LIBS" 23764 23633 23765 23634 23766 - if $aspp_ok && $as_ok 23635 + if $prog_aspp_ok && $prog_as_ok 23636 + then : 23637 + ocaml_cv_prog_as_cfi_directives=yes 23638 + fi 23639 + fi 23640 + 23641 + if test "x$ocaml_cv_prog_as_cfi_directives" = xyes 23767 23642 then : 23768 23643 asm_cfi_supported=true 23769 23644 printf "%s\n" "#define ASM_CFI_SUPPORTED 1" >>confdefs.h ··· 23771 23646 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 23772 23647 printf "%s\n" "yes" >&6; } 23773 23648 else $as_nop 23774 - if test x"$enable_cfi" = "xyes" 23775 - then : 23776 23649 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: requested but not available 23777 - as_fn_error $? "exiting" "$LINENO" 5" >&5 23650 + as_fn_error $? "exiting" "$LINENO" 5" >&5 23778 23651 printf "%s\n" "requested but not available 23779 - as_fn_error $? "exiting" "$LINENO" 5" >&6; } 23652 + as_fn_error $? "exiting" "$LINENO" 5" >&6; } 23653 + fi 23780 23654 else $as_nop 23781 23655 asm_cfi_supported=false 23782 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 23783 - printf "%s\n" "no" >&6; } 23656 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 23657 + printf "%s\n" "disabled" >&6; } 23784 23658 fi 23785 - fi 23786 - 23787 - fi ;; 23659 + ;; 23788 23660 esac 23789 23661 fi 23662 + # Always assign a valid default OCaml value 23663 + : ${ocaml_cv_prog_as_debug_prefix_map:=false} 23664 + : ${asm_cfi_supported:=false} 23790 23665 23791 23666 ## Frame pointers 23792 23667 ··· 23820 23695 23821 23696 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mmap supports huge pages" >&5 23822 23697 printf %s "checking whether mmap supports huge pages... " >&6; } 23698 + if test ${ocaml_cv_func_mmap_huge_pages+y} 23699 + then : 23700 + printf %s "(cached) " >&6 23701 + else $as_nop 23823 23702 if test "$cross_compiling" = yes 23824 23703 then : 23825 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no assumed" >&5 23826 - printf "%s\n" "no assumed" >&6; } 23704 + ocaml_cv_func_mmap_huge_pages=no 23827 23705 else $as_nop 23828 23706 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 23829 23707 /* end confdefs.h. */ ··· 23872 23750 _ACEOF 23873 23751 if ac_fn_c_try_run "$LINENO" 23874 23752 then : 23753 + ocaml_cv_func_mmap_huge_pages=yes 23754 + else $as_nop 23755 + ocaml_cv_func_mmap_huge_pages=no 23756 + fi 23757 + rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ 23758 + conftest.$ac_objext conftest.beam conftest.$ac_ext 23759 + fi 23760 + 23761 + fi 23762 + 23763 + if test x"$ocaml_cv_func_mmap_huge_pages" = "xyes" 23764 + then : 23875 23765 printf "%s\n" "#define HAS_HUGE_PAGES 1" >>confdefs.h 23876 23766 23877 23767 printf "%s\n" "#define HUGE_PAGE_SIZE (4 * 1024 * 1024)" >>confdefs.h ··· 23879 23769 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 23880 23770 printf "%s\n" "yes" >&6; } 23881 23771 else $as_nop 23772 + if test $cross_compiling = yes 23773 + then : 23774 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no assumed" >&5 23775 + printf "%s\n" "no assumed" >&6; } 23776 + else $as_nop 23882 23777 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 23883 23778 printf "%s\n" "no" >&6; } 23884 23779 fi 23885 - rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ 23886 - conftest.$ac_objext conftest.beam conftest.$ac_ext 23887 23780 fi 23888 - 23889 23781 23890 23782 23891 23783 printf "%s\n" "#define HEADER_RESERVED_BITS $reserved_header_bits" >>confdefs.h ··· 24023 23915 24024 23916 test -n "$DIFF" && break 24025 23917 done 24026 - test -n "$DIFF" || DIFF="none" 23918 + test -n "$DIFF" || DIFF="as_fn_error $? "ocamltest requires a diff tool" "$LINENO" 5" 24027 23919 24028 - DIFF_FLAGS="" 24029 - flags="" 24030 23920 case $DIFF in #( 24031 23921 diff) : 24032 - flags="--strip-trailing-cr -u" ;; #( 24033 - none) : 24034 - as_fn_error $? "ocamltest requires a diff tool" "$LINENO" 5 ;; #( 23922 + flags_to_test='--strip-trailing-cr -u' ;; #( 24035 23923 *) : 24036 23924 ;; 24037 23925 esac 23926 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for extra $DIFF flags" >&5 23927 + printf %s "checking for extra $DIFF flags... " >&6; } 23928 + if test ${ocaml_cv_prog_diff_flags+y} 23929 + then : 23930 + printf %s "(cached) " >&6 23931 + else $as_nop 23932 + flags="" 23933 + for flag in ${flags_to_test}; do 23934 + "$DIFF" $flag /dev/zero /dev/zero >/dev/null 2>&1 && \ 23935 + flags="${flags:+$flags }$flag" 23936 + done 23937 + ocaml_cv_prog_diff_flags="$flags" 23938 + fi 23939 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_prog_diff_flags" >&5 23940 + printf "%s\n" "$ocaml_cv_prog_diff_flags" >&6; } 24038 23941 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $DIFF supports --color={auto,always,never}" >&5 24039 23942 printf %s "checking whether $DIFF supports --color={auto,always,never}... " >&6; } 24040 - if $DIFF --color=auto $0 $0 > /dev/null 2>&1 23943 + if test ${ocaml_cv_prog_diff_supports_color+y} 24041 23944 then : 24042 - diff_supports_color=true; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 24043 - printf "%s\n" "yes" >&6; } 23945 + printf %s "(cached) " >&6 24044 23946 else $as_nop 24045 - diff_supports_color=false; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 24046 - printf "%s\n" "no" >&6; } 23947 + if $DIFF --color=auto $0 $0 > /dev/null 2>&1 23948 + then : 23949 + ocaml_cv_prog_diff_supports_color=true 24047 23950 fi 24048 - for flag in ${flags}; do 24049 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $DIFF supports $flag" >&5 24050 - printf %s "checking whether $DIFF supports $flag... " >&6; }; 24051 - if $DIFF $DIFF_FLAGS $flag $0 $0 > /dev/null 2>&1 24052 - then : 24053 - DIFF_FLAGS="$DIFF_FLAGS $flag" 24054 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 24055 - printf "%s\n" "yes" >&6; } 24056 - else $as_nop 24057 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 24058 - printf "%s\n" "no" >&6; } 24059 23951 fi 24060 - done 23952 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_prog_diff_supports_color" >&5 23953 + printf "%s\n" "$ocaml_cv_prog_diff_supports_color" >&6; } 24061 23954 fi 23955 + DIFF_FLAGS=$ocaml_cv_prog_diff_flags 23956 + 23957 + # Always assign a valid default OCaml value 23958 + : ${ocaml_cv_prog_diff_supports_color:=false} 24062 23959 24063 23960 if test x"$enable_flambda" = "xyes" 24064 23961 then : ··· 24102 23999 24103 24000 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mmap supports MAP_STACK" >&5 24104 24001 printf %s "checking whether mmap supports MAP_STACK... " >&6; } 24002 + if test ${ocaml_cv_func_mmap_MAP_STACK+y} 24003 + then : 24004 + printf %s "(cached) " >&6 24005 + else $as_nop 24105 24006 if test "$cross_compiling" = yes 24106 24007 then : 24107 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no assumed" >&5 24108 - printf "%s\n" "no assumed" >&6; } 24008 + ocaml_cv_func_mmap_MAP_STACK=no 24109 24009 else $as_nop 24110 24010 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 24111 24011 /* end confdefs.h. */ ··· 24131 24031 _ACEOF 24132 24032 if ac_fn_c_try_run "$LINENO" 24133 24033 then : 24134 - has_mmap_map_stack=true 24135 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 24136 - printf "%s\n" "yes" >&6; } 24034 + ocaml_cv_func_mmap_MAP_STACK=yes 24137 24035 else $as_nop 24138 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 24139 - printf "%s\n" "no" >&6; } 24036 + ocaml_cv_func_mmap_MAP_STACK=no 24140 24037 fi 24141 24038 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ 24142 24039 conftest.$ac_objext conftest.beam conftest.$ac_ext 24143 24040 fi 24144 24041 24042 + fi 24145 24043 24146 - if test x"$enable_mmap_map_stack" = "xyes" 24044 + if test $cross_compiling = yes && \ 24045 + test "x$ocaml_cv_func_mmap_MAP_STACK" = xno 24046 + then : 24047 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no assumed" >&5 24048 + printf "%s\n" "no assumed" >&6; } 24049 + else $as_nop 24050 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_func_mmap_MAP_STACK" >&5 24051 + printf "%s\n" "$ocaml_cv_func_mmap_MAP_STACK" >&6; } 24052 + fi 24053 + 24054 + if test "x$enable_mmap_map_stack" = xyes 24147 24055 then : 24148 - if test x"$has_mmap_map_stack" = "xtrue" 24056 + if test "x$ocaml_cv_func_mmap_MAP_STACK" = xyes 24149 24057 then : 24150 24058 case $target in #( 24151 24059 *-freebsd*) : 24152 - as_fn_error $? "mmap MAP_STACK not supported on FreeBSD" "$LINENO" 5 ;; #( 24060 + as_fn_error $? "mmap MAP_STACK is not supported on FreeBSD" "$LINENO" 5 ;; #( 24153 24061 *) : 24154 - with_mmap_map_stack=true; 24155 - printf "%s\n" "#define USE_MMAP_MAP_STACK 1" >>confdefs.h 24156 - ;; 24062 + ;; 24157 24063 esac 24158 24064 else $as_nop 24159 24065 as_fn_error $? "mmap MAP_STACK requested but not found on $target" "$LINENO" 5 24160 24066 fi 24161 - 24162 24067 else $as_nop 24163 - case $target in #( 24164 - *-openbsd*) : 24165 - with_mmap_map_stack=true; 24166 - printf "%s\n" "#define USE_MMAP_MAP_STACK 1" >>confdefs.h 24167 - 24168 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using MAP_STACK on OpenBSD due to stack checking" >&5 24169 - printf "%s\n" "$as_me: using MAP_STACK on OpenBSD due to stack checking" >&6;} ;; #( 24068 + case $target,$ocaml_cv_func_mmap_MAP_STACK,$enable_mmap_map_stack in #( 24069 + *-openbsd*,no,*|*-openbsd-*,*,no) : 24070 + as_fn_error $? "mmap MAP_STACK is required on OpenBSD" "$LINENO" 5 ;; #( 24071 + *-openbsd*,*,*) : 24072 + enable_mmap_map_stack=yes 24073 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Using MAP_STACK on OpenBSD due to stack checking" >&5 24074 + printf "%s\n" "$as_me: Using MAP_STACK on OpenBSD due to stack checking" >&6;} ;; #( 24170 24075 *) : 24171 - with_mmap_map_stack=false ;; 24076 + ;; 24172 24077 esac 24078 + fi 24079 + if test x"$ocaml_cv_func_mmap_MAP_STACK$enable_mmap_map_stack" = xyesyes 24080 + then : 24081 + 24082 + printf "%s\n" "#define USE_MMAP_MAP_STACK 1" >>confdefs.h 24173 24083 24174 24084 fi 24175 24085
+37 -51
configure.ac
··· 83 83 ocamltest_unix_impl="dummy" 84 84 unix_library="" 85 85 unix_directory="" 86 - diff_supports_color=false 87 86 target_libdir_is_relative=false 88 87 srcdir_abs='' 89 88 srcdir_abs_real='' ··· 137 136 AC_SUBST([SAK_BUILD]) 138 137 AC_SUBST([SAK]) 139 138 AC_SUBST([encode_C_literal]) 140 - AC_SUBST([DIFF_FLAGS]) 141 - AC_SUBST([diff_supports_color]) 139 + AC_SUBST([ocaml_cv_prog_diff_supports_color]) 142 140 AC_SUBST([CSC]) 143 141 AC_SUBST([CSCFLAGS]) 144 142 # Note: This is present for the flexdll bootstrap where it exposed as the old ··· 225 223 AC_SUBST([unix_library]) 226 224 AC_SUBST([unix_directory]) 227 225 AC_SUBST([cc_has_debug_prefix_map]) 228 - AC_SUBST([as_has_debug_prefix_map]) 226 + AC_SUBST([ocaml_cv_prog_as_debug_prefix_map]) 229 227 AC_SUBST([as_is_cc]) 230 228 AC_SUBST([with_debugger]) # TODO: rename this variable 231 229 AC_SUBST([build_ocamldebug]) ··· 1463 1461 1464 1462 # Support for C11 atomic types 1465 1463 1466 - OCAML_CC_SUPPORTS_ATOMIC([], [$cclibs]) 1467 - AS_CASE([$cc_supports_atomic,$ocaml_cc_vendor], 1468 - [false,msvc-*], 1469 - [OCAML_CC_SUPPORTS_ATOMIC([-std:c11]) 1470 - AS_IF([$cc_supports_atomic], 1471 - [common_cflags="$common_cflags -std:c11"], 1472 - [OCAML_CC_SUPPORTS_ATOMIC([-std:c11 -experimental:c11atomics]) 1473 - AS_IF([$cc_supports_atomic], 1474 - [common_cflags="$common_cflags -std:c11 -experimental:c11atomics"]) 1475 - ])]) 1476 - AS_IF([! $cc_supports_atomic], 1477 - [AC_MSG_FAILURE([C11 atomic support is required, use another C compiler])]) 1464 + OCAML_CC_C11_ATOMIC_CFLAGS([$cclibs]) 1478 1465 1479 1466 # Full support for thread local storage 1480 1467 # macOS and MinGW-w64 have problems with thread local storage accessed from DLLs ··· 1610 1597 [$warn_error_flag])]) 1611 1598 1612 1599 ## Check whether __attribute__((optimize("tree-vectorize")))) is supported 1613 - OCAML_CC_SUPPORTS_TREE_VECTORIZE([$warn_error_flag]) 1600 + OCAML_CC_SUPPORTS_TREE_VECTORIZE 1614 1601 1615 1602 # Check whether the C compiler supports the labels as values extension. 1616 1603 OCAML_CC_SUPPORTS_LABELS_AS_VALUES ··· 2769 2756 AC_MSG_NOTICE([the threads library is supported])]) 2770 2757 2771 2758 ## Does the assembler support debug prefix map and CFI directives 2772 - as_has_debug_prefix_map=false 2773 - asm_cfi_supported=false 2774 2759 AS_IF([$native_compiler], 2775 2760 [AS_CASE([$target], 2776 2761 [*-w64-mingw32*|*-pc-windows], [], 2777 2762 [OCAML_AS_HAS_DEBUG_PREFIX_MAP 2778 2763 OCAML_AS_HAS_CFI_DIRECTIVES])]) 2764 + # Always assign a valid default OCaml value 2765 + : ${ocaml_cv_prog_as_debug_prefix_map:=false} 2766 + : ${asm_cfi_supported:=false} 2779 2767 2780 2768 ## Frame pointers 2781 2769 ··· 2856 2844 AC_CONFIG_LINKS([ 2857 2845 ocamltest/ocamltest_unix.ml:${ocamltest_unix_mod} 2858 2846 ]) 2859 - AC_CHECK_PROGS([DIFF], [patdiff diff], [none]) 2860 - DIFF_FLAGS="" 2861 - flags="" 2862 - AS_CASE([$DIFF], 2863 - [diff], [flags="--strip-trailing-cr -u"], 2864 - [none], 2865 - [AC_MSG_ERROR([ocamltest requires a diff tool])]) 2866 - AC_MSG_CHECKING([whether $DIFF supports --color={auto,always,never}]) 2867 - AS_IF([$DIFF --color=auto $0 $0 > /dev/null 2>&1], 2868 - [diff_supports_color=true; AC_MSG_RESULT([yes])], 2869 - [diff_supports_color=false; AC_MSG_RESULT([no])]) 2870 - for flag in ${flags}; do 2871 - AC_MSG_CHECKING([whether $DIFF supports $flag]); 2872 - AS_IF([$DIFF $DIFF_FLAGS $flag $0 $0 > /dev/null 2>&1], 2873 - [DIFF_FLAGS="$DIFF_FLAGS $flag" 2874 - AC_MSG_RESULT([yes])], 2875 - [AC_MSG_RESULT([no])]) 2876 - done]) 2847 + AC_CHECK_PROGS([DIFF], [patdiff diff], 2848 + [AC_MSG_ERROR([ocamltest requires a diff tool])]) 2849 + AS_CASE([$DIFF], [diff], [flags_to_test='--strip-trailing-cr -u']) 2850 + AC_CACHE_CHECK([for extra $DIFF flags], 2851 + [ocaml_cv_prog_diff_flags], 2852 + [flags="" 2853 + for flag in ${flags_to_test}; do 2854 + "$DIFF" $flag /dev/zero /dev/zero >/dev/null 2>&1 && \ 2855 + flags="${flags:+$flags }$flag" 2856 + done 2857 + ocaml_cv_prog_diff_flags="$flags"]) 2858 + AC_CACHE_CHECK([whether $DIFF supports --color={auto,always,never}], 2859 + [ocaml_cv_prog_diff_supports_color], 2860 + [AS_IF([$DIFF --color=auto $0 $0 > /dev/null 2>&1], 2861 + [ocaml_cv_prog_diff_supports_color=true])])]) 2862 + AC_SUBST([DIFF_FLAGS], [$ocaml_cv_prog_diff_flags]) 2863 + # Always assign a valid default OCaml value 2864 + : ${ocaml_cv_prog_diff_supports_color:=false} 2877 2865 2878 2866 AS_IF([test x"$enable_flambda" = "xyes"], 2879 2867 [flambda=true ··· 2899 2887 flat_float_array=true]) 2900 2888 2901 2889 OCAML_MMAP_SUPPORTS_MAP_STACK 2902 - AS_IF([test x"$enable_mmap_map_stack" = "xyes"], 2903 - [AS_IF([test x"$has_mmap_map_stack" = "xtrue"], 2890 + AS_IF([test "x$enable_mmap_map_stack" = xyes], 2891 + [AS_IF([test "x$ocaml_cv_func_mmap_MAP_STACK" = xyes], 2904 2892 [AS_CASE([$target], 2905 2893 [*-freebsd*], 2906 - [AC_MSG_ERROR([mmap MAP_STACK not supported on FreeBSD])], 2907 - [with_mmap_map_stack=true; 2908 - AC_DEFINE([USE_MMAP_MAP_STACK], [1])])], 2909 - [AC_MSG_ERROR([mmap MAP_STACK requested but not found on $target])]) 2910 - ], 2911 - [AS_CASE([$target], 2912 - [*-openbsd*], 2913 - [with_mmap_map_stack=true; 2914 - AC_DEFINE([USE_MMAP_MAP_STACK], [1]) 2915 - AC_MSG_NOTICE([using MAP_STACK on OpenBSD due to stack checking])], 2916 - [with_mmap_map_stack=false]) 2917 - ]) 2894 + [AC_MSG_ERROR([mmap MAP_STACK is not supported on FreeBSD])])], 2895 + [AC_MSG_ERROR([mmap MAP_STACK requested but not found on $target])])], 2896 + [AS_CASE([$target,$ocaml_cv_func_mmap_MAP_STACK,$enable_mmap_map_stack], 2897 + [*-openbsd*,no,*|*-openbsd-*,*,no], 2898 + [AC_MSG_ERROR([mmap MAP_STACK is required on OpenBSD])], 2899 + [*-openbsd*,*,*], 2900 + [enable_mmap_map_stack=yes 2901 + AC_MSG_NOTICE([Using MAP_STACK on OpenBSD due to stack checking])])]) 2902 + AS_IF([test x"$ocaml_cv_func_mmap_MAP_STACK$enable_mmap_map_stack" = xyesyes], 2903 + [AC_DEFINE([USE_MMAP_MAP_STACK], [1], [Define to use mmap MAP_STACK.])]) 2918 2904 2919 2905 oc_native_compflags='' 2920 2906
+1 -1
ocamltest/ocamltest_config.ml.in
··· 39 39 40 40 let diff = {@QS@|@DIFF@|@QS@} 41 41 let diff_flags = {@QS@|@DIFF_FLAGS@|@QS@} 42 - let diff_supports_color = @diff_supports_color@ 42 + let diff_supports_color = @ocaml_cv_prog_diff_supports_color@ 43 43 44 44 let shared_libraries = @supports_shared_libraries@ 45 45
+1 -1
utils/config.generated.ml.in
··· 26 26 let c_compiler_vendor = {@QS@|@ocaml_cc_vendor@|@QS@} 27 27 let c_output_obj = {@QS@|@outputobj@|@QS@} 28 28 let c_has_debug_prefix_map = @cc_has_debug_prefix_map@ 29 - let as_has_debug_prefix_map = @as_has_debug_prefix_map@ 29 + let as_has_debug_prefix_map = @ocaml_cv_prog_as_debug_prefix_map@ 30 30 let as_is_cc = @as_is_cc@ 31 31 let bytecode_cflags = {@QS@|@bytecode_cflags@|@QS@} 32 32 let bytecode_cppflags = {@QS@|@bytecode_cppflags@|@QS@}