diff --git a/.gitignore b/.gitignore index 5cec38960f9f..95c63af2b020 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ META /config.log /config.status /configure~ +/runtime/caml/config.h.in~ /flexlink.opt /libtool /ocamlc.opt @@ -235,8 +236,7 @@ META /runtime/domain_state.inc /runtime/caml/jumptbl.h -/runtime/caml/m.h -/runtime/caml/s.h +/runtime/caml/config.h /runtime/primitives /runtime/primitives*.new /runtime/prims.c diff --git a/INSTALL.adoc b/INSTALL.adoc index 69435c8e5e4b..fdc54b17ec37 100644 --- a/INSTALL.adoc +++ b/INSTALL.adoc @@ -55,8 +55,8 @@ From the top directory, do: ./configure -This generates the three configuration files `Makefile.config`, -`runtime/caml/m.h` and `runtime/caml/s.h`. +This generates the two configuration files `Makefile.config`, +`runtime/caml/config.h`. The `configure` script accepts options that can be discovered by running: @@ -95,8 +95,7 @@ files cause errors later on, then look at the template files: Makefile.config.in Makefile.build_config.in - runtime/caml/m.h.in - runtime/caml/s.h.in + runtime/caml/config.h.in + for guidance on how to edit the generated files by hand. diff --git a/Makefile b/Makefile index 47f9b90d98e0..30dbf15ee6e8 100644 --- a/Makefile +++ b/Makefile @@ -1260,7 +1260,7 @@ runtime_NATIVE_C_SOURCES = \ ## Header files generated by configure runtime_CONFIGURED_HEADERS = \ - $(addprefix runtime/caml/, exec.h m.h s.h version.h) + $(addprefix runtime/caml/, exec.h config.h version.h) ## Header files generated by make runtime_BUILT_HEADERS = $(addprefix runtime/, \ diff --git a/Makefile.config.in b/Makefile.config.in index bdac1cf47bcb..35ac9c7d8606 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -120,9 +120,6 @@ ARCH=@arch@ # Whether the architecture has 64 bits ARCH64=@arch64@ -# Endianness for this architecture -ENDIANNESS=@endianness@ - ### Name of architecture model for the native-code compiler. ### Some architectures come in several slightly different flavors ### that share a common code generator. This variable tailors the diff --git a/aclocal.m4 b/aclocal.m4 index 3d9cd79bfaef..dcf69fabfe93 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -88,7 +88,7 @@ AC_DEFUN([OCAML_SIGNAL_HANDLERS_SEMANTICS], [ AC_CHECK_FUNC([sigaction], [has_sigaction=true], [has_sigaction=false]) AC_CHECK_FUNC([sigprocmask], [has_sigprocmask=true], [has_sigprocmask=false]) AS_IF([$has_sigaction && $has_sigprocmask], - [AC_DEFINE([POSIX_SIGNALS], [1]) + [AC_DEFINE([POSIX_SIGNALS], [1], [TODO]) AC_MSG_NOTICE([POSIX signal handling found.])], [AC_MSG_NOTICE([assuming signals have the System V semantics.]) ] @@ -97,18 +97,22 @@ AC_DEFUN([OCAML_SIGNAL_HANDLERS_SEMANTICS], [ dnl $1: extra CFLAGS AC_DEFUN([OCAML_CC_SUPPORTS_TREE_VECTORIZE], [ - AC_MSG_CHECKING( - [whether the C compiler supports __attribute__((optimize("tree-vectorize")))]) - saved_CFLAGS="$CFLAGS" - CFLAGS="$1 $CFLAGS" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[__attribute__((optimize("tree-vectorize"))) void f(void) {}]], - [[f();]])], - [AC_DEFINE([SUPPORTS_TREE_VECTORIZE], [1]) - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - CFLAGS="$saved_CFLAGS" + AC_CACHE_CHECK(m4_normalize([whether the C compiler supports + __attribute__((optimize("tree-vectorize")))]), + [ocaml_cv_prog_cc_optimize_tree_vectorize], [ + + saved_CFLAGS="$CFLAGS" + CFLAGS="$warn_error_flag $CFLAGS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[__attribute__((optimize("tree-vectorize"))) void f(void) {}]], + [[f();]])], + [ocaml_cv_prog_cc_optimize_tree_vectorize=yes], + [ocaml_cv_prog_cc_optimize_tree_vectorize=no]) + CFLAGS="$saved_CFLAGS" + ]) + ]) + AS_IF([test "x$ocaml_cv_prog_cc_tree_vectorize" = xyes], + [AC_DEFINE([SUPPORTS_TREE_VECTORIZE], [1], [TODO])]) ]) # Save C compiler related variables @@ -138,90 +142,90 @@ AC_DEFUN([OCAML_CC_RESTORE_VARIABLES], [ ]) AC_DEFUN([OCAML_AS_HAS_DEBUG_PREFIX_MAP], [ - AC_MSG_CHECKING([whether the assembler supports --debug-prefix-map]) - - OCAML_CC_SAVE_VARIABLES - - # Modify C-compiler variables to use the assembler - CC="$AS" - CFLAGS="--debug-prefix-map old=new -o conftest.$ac_objext" - CPPFLAGS="" - ac_ext="S" - ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([ -camlPervasives__loop_1128: - .file 1 "pervasives.ml" - .loc 1 193 - ])], - [as_has_debug_prefix_map=true - AC_MSG_RESULT([yes])], - [as_has_debug_prefix_map=false - AC_MSG_RESULT([no])]) - - OCAML_CC_RESTORE_VARIABLES -]) - -AC_DEFUN([OCAML_AS_HAS_CFI_DIRECTIVES], [ - AC_MSG_CHECKING([whether the assembler supports CFI directives]) - - AS_IF([test x"$enable_cfi" = "xno"], - [AC_MSG_RESULT([disabled])], + AC_CACHE_CHECK([whether the assembler supports --debug-prefix-map], + [ocaml_cv_prog_as_debug_prefix_map], [OCAML_CC_SAVE_VARIABLES # Modify C-compiler variables to use the assembler - CC="$ASPP" - CFLAGS="-o conftest.$ac_objext" + CC="$AS" + CFLAGS="--debug-prefix-map old=new -o conftest.$ac_objext" CPPFLAGS="" ac_ext="S" ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([ + AC_COMPILE_IFELSE([AC_LANG_SOURCE([ camlPervasives__loop_1128: .file 1 "pervasives.ml" .loc 1 193 - .cfi_startproc - .cfi_adjust_cfa_offset 8 - .cfi_endproc - ])], - [aspp_ok=true], - [aspp_ok=false]) + ])], + [ocaml_cv_prog_as_debug_prefix_map=true], + [ocaml_cv_prog_as_debug_prefix_map=false]) - AS_IF([test "$AS" = "$ASPP"], - [as_ok="$aspp_ok"], - [CC="$AS" + OCAML_CC_RESTORE_VARIABLES]) + as_has_debug_prefix_map=$ocaml_cv_prog_as_debug_prefix_map +]) + +AC_DEFUN([OCAML_AS_HAS_CFI_DIRECTIVES], [ + AC_CACHE_CHECK([whether the assembler supports CFI directives], + [ocaml_cv_prog_as_cfi_directives], + [AS_IF([test x"$enable_cfi" = "xno"], + [ocaml_cv_prog_as_cfi_directives='disabled'], + [OCAML_CC_SAVE_VARIABLES + + # Modify C-compiler variables to use the assembler + CC="$ASPP" + CFLAGS="-o conftest.$ac_objext" + CPPFLAGS="" + ac_ext="S" ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([ + + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([ + camlPervasives__loop_1128: + .file 1 "pervasives.ml" + .loc 1 193 + .cfi_startproc + .cfi_adjust_cfa_offset 8 + .cfi_endproc + ])], + [aspp_ok=true], + [aspp_ok=false]) + + AS_IF([test "$AS" = "$ASPP"], + [as_ok="$aspp_ok"], + [CC="$AS" + ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([ camlPervasives__loop_1128: .file 1 "pervasives.ml" .loc 1 193 .cfi_startproc .cfi_adjust_cfa_offset 8 .cfi_endproc - ])], - [as_ok=true], - [as_ok=false])]) - - OCAML_CC_RESTORE_VARIABLES - - AS_IF([$aspp_ok && $as_ok], + ])], + [as_ok=true], + [as_ok=false])]) + + OCAML_CC_RESTORE_VARIABLES + + AS_IF([$aspp_ok && $as_ok], + [ocaml_cv_prog_as_cfi_directives='yes'], + [AS_IF([test x"$enable_cfi" = "xyes"], + [ocaml_cv_prog_as_cfi_directives='requested but not available'], + [ocaml_cv_prog_as_cfi_directives='no'])])])]) + AS_CASE([$ocaml_cv_prog_as_cfi_directives], + [yes], [asm_cfi_supported=true - AC_DEFINE([ASM_CFI_SUPPORTED], [1]) - AC_MSG_RESULT([yes])], - [AS_IF([test x"$enable_cfi" = "xyes"], - [AC_MSG_RESULT([requested but not available - AC_MSG_ERROR([exiting])])], - [asm_cfi_supported=false - AC_MSG_RESULT([no])])]) - ])]) + AC_DEFINE([ASM_CFI_SUPPORTED], [1], [TODO])], + [no|disabled], [asm_cfi_supported=false], + [AC_MSG_ERROR([exiting])]) +]) AC_DEFUN([OCAML_MMAP_SUPPORTS_MAP_STACK], [ - AC_MSG_CHECKING([whether mmap supports MAP_STACK]) - AC_RUN_IFELSE( - [AC_LANG_PROGRAM([[ + AC_CACHE_CHECK([whether mmap supports MAP_STACK], + [ocaml_cv_func_mmap_MAP_STACK], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include #include #include @@ -233,16 +237,15 @@ AC_DEFUN([OCAML_MMAP_SUPPORTS_MAP_STACK], [ if (block == MAP_FAILED) return 1; ]])], - [has_mmap_map_stack=true - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])], - [AC_MSG_RESULT([no assumed])]) + [ocaml_cv_func_mmap_MAP_STACK=yes], + [ocaml_cv_func_mmap_MAP_STACK=no], + [ocaml_cv_func_mmap_MAP_STACK='no assumed'])]) ]) AC_DEFUN([OCAML_MMAP_SUPPORTS_HUGE_PAGES], [ - AC_MSG_CHECKING([whether mmap supports huge pages]) - AC_RUN_IFELSE( - [AC_LANG_PROGRAM([[ + AC_CACHE_CHECK([whether mmap supports huge pages], + [ocaml_cv_func_mmap_huge_pages], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include #include #include @@ -277,11 +280,12 @@ AC_DEFUN([OCAML_MMAP_SUPPORTS_HUGE_PAGES], [ p[i] = (char) i; } ]])], - [AC_DEFINE([HAS_HUGE_PAGES], [1]) - AC_DEFINE_UNQUOTED([HUGE_PAGE_SIZE], [(4 * 1024 * 1024)]) - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])], - [AC_MSG_RESULT([no assumed])]) + [ocaml_cv_func_mmap_huge_pages=yes], + [ocaml_cv_func_mmap_huge_pages=no], + [ocaml_cv_func_mmap_huge_pages='no assumed'])]) + AS_IF([test "x$ocaml_cv_prog_cc_func_mmap_huge_pages" = xyes], + [AC_DEFINE([HAS_HUGE_PAGES], [1], [TODO]) + AC_DEFINE_UNQUOTED([HUGE_PAGE_SIZE], [(4 * 1024 * 1024)], [TODO])]) ]) AC_DEFUN([OCAML_CHECK_LIBUNWIND], [ @@ -290,7 +294,7 @@ AC_DEFUN([OCAML_CHECK_LIBUNWIND], [ CPPFLAGS="$CPPFLAGS $libunwind_cppflags" LDFLAGS="$LDFLAGS $libunwind_ldflags" AC_CHECK_HEADER([libunwind.h], - [AC_DEFINE([HAS_LIBUNWIND], [1]) + [AC_DEFINE([HAS_LIBUNWIND], [1], [TODO]) libunwind_available=true], [libunwind_available=false]) LDFLAGS="$SAVED_LDFLAGS" @@ -396,36 +400,50 @@ AC_DEFUN([OCAML_RUN_IFELSE], [ cross_compiling="$old_cross_compiling" ]) +# OCAML_C99_CHECK_FLOAT_OPS(FUNCTION, INPUT, [TARGETS], [DESCRIPTION]) +# -------------------------------------------------------------------- +# TARGETS: space-separated list of target triplets on which the function is +# known not to work +AC_DEFUN([OCAML_C99_CHECK_FLOAT_OPS], [ + AS_VAR_PUSHDEF([CACHEVAR], [ocaml_cv_func_$1_works])dnl + AC_CACHE_CHECK([whether $1 works], CACHEVAR, [ + OCAML_RUN_IFELSE([$2], + [AS_VAR_SET(CACHEVAR, [yes])], + [AS_CASE([$enable_imprecise_c99_float_ops,$target], + [no,*], [AS_VAR_SET(CACHEVAR, [no-with-hard-error])], + [yes,*m4_ifnblank([$3], [|*,m4_bpatsubst([$3], [ ], [|*,])])], + [AS_VAR_SET(CACHEVAR, [no])], + [AS_VAR_SET(CACHEVAR, [no-with-hard-error])])], + [AS_CASE([$target], + [m4_bpatsubst([$3], [ ], [|])], + [AS_VAR_SET(CACHEVAR, [no-cross-compiling])], + [AS_VAR_SET(CACHEVAR, [yes-cross-compiling])])])]) + AS_CASE([$CACHEVAR], + [yes*], + [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_WORKING_$1]), [1], + [Define to 1 if '$1' works. $4]) + AS_VAR_IF(CACHEVAR, [yes-cross-compiling], + [AC_MSG_RESULT([cross-compiling; assume yes])])], + [no-with-hard-error], + [AC_MSG_ERROR(m4_normalize([$1 does not work, enable emulation with + --enable-imprecise-c99-float-ops]))], + [no], [AC_MSG_WARN([$1 does not work; emulation enabled])], + [no-cross-compiling], [AC_MSG_RESULT([cross-compiling; assume not])]) + AS_VAR_POPDEF([CACHEVAR])dnl +])dnl + AC_DEFUN([OCAML_C99_CHECK_ROUND], [ - AC_MSG_CHECKING([whether round works]) - OCAML_RUN_IFELSE( + OCAML_C99_CHECK_FLOAT_OPS([round], [AC_LANG_PROGRAM([[#include ]],[[ static volatile double d = 0.49999999999999994449; if (fpclassify(round(d)) != FP_ZERO) return 1; ]])], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAS_WORKING_ROUND], [1])], - [AC_MSG_RESULT([no]) - AS_CASE([$enable_imprecise_c99_float_ops,$target], - [no,*], [hard_error=true], - [yes,*], [hard_error=false], - [*,x86_64-w64-mingw32*], [hard_error=false], - [hard_error=true]) - AS_IF([test x"$hard_error" = "xtrue"], - [AC_MSG_ERROR(m4_normalize([ - round does not work, enable emulation with - --enable-imprecise-c99-float-ops]))], - [AC_MSG_WARN(m4_normalize([ - round does not work; emulation enabled]))])], - [AS_CASE([$target], - [x86_64-w64-mingw32*],[AC_MSG_RESULT([cross-compiling; assume not])], - [AC_MSG_RESULT([cross-compiling; assume yes]) - AC_DEFINE([HAS_WORKING_ROUND], [1])])]) -]) + [x86_64-w64-mingw32*], + [This workaround exists primarily for + https://sourceforge.net/p/mingw-w64/bugs/573/])]) AC_DEFUN([OCAML_C99_CHECK_FMA], [ - AC_MSG_CHECKING([whether fma works]) - OCAML_RUN_IFELSE( + OCAML_C99_CHECK_FLOAT_OPS([fma], [AC_LANG_PROGRAM([[#include ]],[[ /* Tests 264-266 from testsuite/tests/fma/fma.ml. These tests trigger the broken implementations of Cygwin64 and mingw-w64 (x86_64). @@ -453,26 +471,10 @@ AC_DEFUN([OCAML_C99_CHECK_FMA], [ || !(t266 == 0x8p-1076)) return 1; ]])], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAS_WORKING_FMA], [1])], - [AC_MSG_RESULT([no]) - AS_CASE([$enable_imprecise_c99_float_ops,$target], - [no,*], [hard_error=true], - [yes,*], [hard_error=false], - [*,x86_64-w64-mingw32*|*,x86_64-*-cygwin], [hard_error=false], - [hard_error=true]) - AS_IF([test x"$hard_error" = "xtrue"], - [AC_MSG_ERROR(m4_normalize([ - fma does not work, enable emulation with - --enable-imprecise-c99-float-ops]))], - [AC_MSG_WARN(m4_normalize([ - fma does not work; emulation enabled]))])], - [AS_CASE([$target], - [x86_64-w64-mingw32*|x86_64-*-cygwin], - [AC_MSG_RESULT([cross-compiling; assume not])], - [AC_MSG_RESULT([cross-compiling; assume yes]) - AC_DEFINE([HAS_WORKING_FMA], [1])])]) -]) + [x86_64-w64-mingw32* x86_64-*-cygwin*], + [The newlib library (intentionally) simply contains return x * y + z. + This workaround is also used for + https://sourceforge.net/p/mingw-w64/bugs/848/])]) # Computes a suitable id to insert in quoted strings to ensure that all OCaml # quoted strings generated by configure cannot be "escaped". The ID takes the @@ -498,19 +500,24 @@ AC_DEFUN([OCAML_QUOTED_STRING_ID], [ done ]) -AC_DEFUN([OCAML_CC_SUPPORTS_ATOMIC], [ - OCAML_CC_SAVE_VARIABLES - - opts="" - AS_IF([test -n "$1"],[CFLAGS="$CFLAGS $1"; opts="$1"]) - AS_IF([test -n "$2"],[LIBS="$LIBS $2"; opts="${opts:+$opts }$2"]) - AC_MSG_CHECKING(m4_normalize([if $CC supports _Atomic types with - ${opts:-no additional options}])) - - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +# OCAML_CC_C11_ATOMIC_CFLAGS([LIBS]) +AC_DEFUN([OCAML_CC_C11_ATOMIC_CFLAGS], [ + AC_CACHE_CHECK([for options needed to enable C11 atomic support], + [ocaml_cv_prog_cc_c11_atomic_cflags], + [ocaml_cv_prog_cc_c11_atomic_cflags='cannot detect' + for ocaml_arg in dnl + ''dnl + '-experimental:c11atomics'dnl + '-std:c11'dnl remove with Autoconf 2.73 as cl will default to C11 + '-std:c11 -experimental:c11atomics'dnl same + ; do + OCAML_CC_SAVE_VARIABLES + CFLAGS="$CFLAGS $ocaml_arg" + AS_IF([test -n "$1"], [LIBS="$LIBS $1"]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include - ]],[[ + ]],[[ _Atomic int64_t n; int m; int * _Atomic p = &m; @@ -518,13 +525,20 @@ AC_DEFUN([OCAML_CC_SUPPORTS_ATOMIC], [ * atomic_exchange(&p, 0) = 45; if (atomic_load_explicit(&n, memory_order_acquire)) return 1; - ]])], - [cc_supports_atomic=true - AC_MSG_RESULT([yes])], - [cc_supports_atomic=false - AC_MSG_RESULT([no])]) - - OCAML_CC_RESTORE_VARIABLES + ]])], + [AS_IF([test x"$ocaml_arg" = x], + [ocaml_cv_prog_cc_c11_atomic_cflags='none needed'], + [ocaml_cv_prog_cc_c11_atomic_cflags="$ocaml_arg"]) + OCAML_CC_RESTORE_VARIABLES + break]) + OCAML_CC_RESTORE_VARIABLES + done]) + AS_CASE([$ocaml_cv_prog_cc_c11_atomic_cflags], + ['cannot detect'], + [AC_MSG_FAILURE(m4_normalize([C11 atomic support is required, use another + C compiler]))], + ['none needed'], [:], + [common_cflags="$common_cflags $ocaml_cv_prog_cc_c11_atomic_cflags"]) ]) # Detects whether the C compiler generates an explicit .note.GNU-stack section @@ -641,3 +655,35 @@ AC_DEFUN([OCAML_CHECK_WINDOWS_TRIPLET], [ [*-pc-windows*], [AC_MSG_ERROR([unknown MSVC variant])]) ]) + +# OCAML_CL_SEARCH_LIBS(FUNCTION, SEARCH-LIBS, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], +# [OTHER-LIBRARIES]) +# -------------------------------------------------------------- +# Search for a library defining FUNC, if it's not already available. +AC_DEFUN([OCAML_CL_SEARCH_LIBS], +[AS_VAR_PUSHDEF([ocaml_Search], [ocaml_cv_search_$1])dnl +AC_CACHE_CHECK([for library containing $1], [ocaml_Search], +[ocaml_func_search_save_LIBS=$LIBS +AC_LANG_CONFTEST([AC_LANG_CALL([], [$1])]) +for ocaml_lib in '' $2 +do + if test -z "$ocaml_lib"; then + ocaml_res="none required" + else + ocaml_res=${ocaml_lib}.lib + LIBS="${ocaml_lib}.lib $5 $ocaml_func_search_save_LIBS" + fi + AC_LINK_IFELSE([], [AS_VAR_SET([ocaml_Search], [$ocaml_res])]) + AS_VAR_SET_IF([ocaml_Search], [break]) +done +AS_VAR_SET_IF([ocaml_Search], , [AS_VAR_SET([ocaml_Search], [no])]) +rm conftest.$ac_ext +LIBS=$ocaml_func_search_save_LIBS]) +AS_VAR_COPY([ocaml_res], [ocaml_Search]) +AS_IF([test "$ocaml_res" != no], + [test "$ocaml_res" = "none required" || LIBS="$ocaml_res $LIBS" + $3], + [$4]) +AS_VAR_POPDEF([ocaml_Search])dnl +]) diff --git a/configure b/configure index 724e6962ce3a..09d8f47168c4 100755 --- a/configure +++ b/configure @@ -715,8 +715,10 @@ ac_includes_default="\ #endif" ac_header_c_list= +ac_func_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS +DIFF_FLAGS DIFF PTHREAD_CFLAGS PTHREAD_LIBS @@ -729,14 +731,6 @@ DIRECT_LD INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM -LDFLAGS_FOR_BUILD -CPPFLAGS_FOR_BUILD -CFLAGS_FOR_BUILD -BUILD_OBJEXT -BUILD_EXEEXT -CPP_FOR_BUILD -ac_ct_CC_FOR_BUILD -CC_FOR_BUILD flexlink CPP ac_ct_DEP_CC @@ -830,7 +824,6 @@ sharedlib_cflags asm_size_type_directives asm_cfi_supported AS -endianness ASPP ocamltest_opt_target ocamltest_target @@ -928,7 +921,6 @@ libext ac_tool_prefix CSCFLAGS CSC -DIFF_FLAGS encode_C_literal SAK SAK_BUILD @@ -3122,6 +3114,43 @@ as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_header_c_list " pthread_np.h pthread_np_h HAVE_PTHREAD_NP_H" +as_fn_append ac_header_c_list " sys/mman.h sys_mman_h HAVE_SYS_MMAN_H" +as_fn_append ac_func_c_list " accept4 HAVE_ACCEPT4" +as_fn_append ac_func_c_list " dup3 HAVE_DUP3" +as_fn_append ac_func_c_list " execvpe HAVE_EXECVPE" +as_fn_append ac_func_c_list " getauxval HAVE_GETAUXVAL" +as_fn_append ac_func_c_list " getcwd HAVE_GETCWD" +as_fn_append ac_func_c_list " getentropy HAVE_GETENTROPY" +as_fn_append ac_func_c_list " getgroups HAVE_GETGROUPS" +as_fn_append ac_func_c_list " getrusage HAVE_GETRUSAGE" +as_fn_append ac_func_c_list " gettimeofday HAVE_GETTIMEOFDAY" +as_fn_append ac_func_c_list " inet_aton HAVE_INET_ATON" +as_fn_append ac_func_c_list " initgroups HAVE_INITGROUPS" +as_fn_append ac_func_c_list " issetugid HAVE_ISSETUGID" +as_fn_append ac_func_c_list " lockf HAVE_LOCKF" +as_fn_append ac_func_c_list " mkfifo HAVE_MKFIFO" +as_fn_append ac_func_c_list " mkstemp HAVE_MKSTEMP" +as_fn_append ac_func_c_list " mktime HAVE_MKTIME" +as_fn_append ac_func_c_list " nanosleep HAVE_NANOSLEEP" +as_fn_append ac_func_c_list " nice HAVE_NICE" +as_fn_append ac_func_c_list " pipe2 HAVE_PIPE2" +as_fn_append ac_func_c_list " prctl HAVE_PRCTL" +as_fn_append ac_func_c_list " pthread_setname_np HAVE_PTHREAD_SETNAME_NP" +as_fn_append ac_func_c_list " pthread_set_name_np HAVE_PTHREAD_SET_NAME_NP" +as_fn_append ac_func_c_list " putenv HAVE_PUTENV" +as_fn_append ac_func_c_list " pwrite HAVE_PWRITE" +as_fn_append ac_func_c_list " realpath HAVE_REALPATH" +as_fn_append ac_func_c_list " rewinddir HAVE_REWINDDIR" +as_fn_append ac_func_c_list " secure_getenv HAVE_SECURE_GETENV" +as_fn_append ac_func_c_list " __secure_getenv HAVE___SECURE_GETENV" +as_fn_append ac_func_c_list " setgroups HAVE_SETGROUPS" +as_fn_append ac_func_c_list " setitimer HAVE_SETITIMER" +as_fn_append ac_func_c_list " system HAVE_SYSTEM" +as_fn_append ac_func_c_list " times HAVE_TIMES" +as_fn_append ac_func_c_list " utimes HAVE_UTIMES" +as_fn_append ac_func_c_list " waitpid HAVE_WAITPID" +as_fn_append ac_func_c_list " wait4 HAVE_WAIT4" # Auxiliary files required by this configure script. ac_aux_files="install-sh ltmain.sh config.guess config.sub" @@ -3381,14 +3410,18 @@ OCAML_VERSION_EXTRA=dev0-2024-08-25 OCAML_VERSION_SHORT=5.4 + printf "%s\n" "#define MAGIC_NUMBER_PREFIX \"Caml1999\"" >>confdefs.h + printf "%s\n" "#define MAGIC_NUMBER_VERSION \"035\"" >>confdefs.h + printf "%s\n" "#define EXEC_MAGIC_LENGTH 12" >>confdefs.h MAGIC_LENGTH=12 + printf "%s\n" "#define EXEC_FORMAT \"X\"" >>confdefs.h EXEC_MAGIC_NUMBER=Caml1999X035 @@ -3417,7 +3450,6 @@ LINEAR_MAGIC_NUMBER=Caml1999L035 - # Note: This is present for the flexdll bootstrap where it exposed as the old # TOOLPREF variable. It would be better if flexdll where updated to require # WINDRES instead. @@ -3551,7 +3583,6 @@ LINEAR_MAGIC_NUMBER=Caml1999L035 - ## Generated files @@ -3574,11 +3605,11 @@ ac_config_files="$ac_config_files utils/config.common.ml" ac_config_files="$ac_config_files utils/config.generated.ml" -ac_config_headers="$ac_config_headers runtime/caml/exec.h" +ac_config_headers="$ac_config_headers runtime/caml/config.h" + -ac_config_headers="$ac_config_headers runtime/caml/m.h" -ac_config_headers="$ac_config_headers runtime/caml/s.h" +ac_config_headers="$ac_config_headers runtime/caml/exec.h" ac_config_headers="$ac_config_headers runtime/caml/version.h" @@ -3592,18 +3623,25 @@ ac_config_files="$ac_config_files stdlib/META" # Definitions related to the version of OCaml + printf "%s\n" "#define OCAML_VERSION_MAJOR 5" >>confdefs.h + printf "%s\n" "#define OCAML_VERSION_MINOR 4" >>confdefs.h + printf "%s\n" "#define OCAML_VERSION_PATCHLEVEL 0" >>confdefs.h + printf "%s\n" "#define OCAML_VERSION_ADDITIONAL \"dev0-2024-08-25\"" >>confdefs.h - printf "%s\n" "#define OCAML_VERSION_EXTRA \"dev0-2024-08-25\"" >>confdefs.h + +printf "%s\n" "#define OCAML_VERSION_EXTRA \"dev0-2024-08-25\"" >>confdefs.h + printf "%s\n" "#define OCAML_VERSION 50400" >>confdefs.h + printf "%s\n" "#define OCAML_VERSION_STRING \"5.4.0+dev0-2024-08-25\"" >>confdefs.h @@ -15713,15 +15751,14 @@ esac mkexe_cmd_exp="$CC" +have_arch_code32=false case $ocaml_cc_vendor,$target in #( *,x86_64-*-darwin*) : oc_ldflags='-Wl,-no_compact_unwind'; - printf "%s\n" "#define HAS_ARCH_CODE32 1" >>confdefs.h - ;; #( + have_arch_code32=true ;; #( *,aarch64-*-darwin*|*,arm64-*-darwin*) : - printf "%s\n" "#define HAS_ARCH_CODE32 1" >>confdefs.h - ;; #( - *,*-*-cygwin) : + have_arch_code32=true ;; #( + *,*-*-cygwin*) : common_cppflags="$common_cppflags -U_WIN32" if $supports_shared_libraries then : @@ -15760,135 +15797,145 @@ esac mkexe_extra_flags="$mkexe_ldflags_prefix$oc_exe_ldflags" mkexedebugflag='' ;; #( *,x86_64-*-linux*) : - printf "%s\n" "#define HAS_ARCH_CODE32 1" >>confdefs.h - ;; #( + have_arch_code32=true ;; #( xlc-*,powerpc-ibm-aix*) : oc_ldflags='-brtl -bexpfull' - printf "%s\n" "#define HAS_ARCH_CODE32 1" >>confdefs.h - ;; #( + have_arch_code32=true ;; #( gcc-*,powerpc-*-linux*) : oc_ldflags="-mbss-plt" ;; #( *) : ;; esac -# How to build sak +if ${have_arch_code32} +then : + +printf "%s\n" "#define HAVE_ARCH_CODE32 1" >>confdefs.h -if test x"$build" = x"$target" -o x"$target_runnable" = xtrue +fi + +# Winpthreads emulation library for the MSVC port +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for winpthreads sources" >&5 +printf %s "checking for winpthreads sources... " >&6; } +if test x"$with_winpthreads_msvc" = "xno" then : + winpthreads_source_dir='' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +printf "%s\n" "disabled" >&6; } +else $as_nop + winpthreadmsg='' case $target in #( *-pc-windows) : - SAK_BUILD="\$(CC) \$(OC_CFLAGS) \$(CFLAGS) \$(OC_CPPFLAGS) \$(CPPFLAGS) \$(2) /link /out:\$(1) $oc_exe_ldflags \$(OC_LDFLAGS) \$(LDFLAGS)" ;; #( - *) : - SAK_BUILD='$(MKEXE_VIA_CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(CPPFLAGS)' ;; -esac - SAK="\$(ROOTDIR)/runtime/sak${EXEEXT}" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: detecting the C toolchain for build" >&5 -printf "%s\n" "$as_me: detecting the C toolchain for build" >&6;} - -ac_cv_host_exeext=$ac_cv_exeext -if test ${ac_cv_build_exeext+y} + if test x"$with_winpthreads_msvc" = 'x' || test x"$with_winpthreads_msvc" = x'winpthreads' then : - ac_cv_exeext=$ac_cv_build_exeext + if test -f 'winpthreads/src/winpthread_internal.h' +then : + winpthreads_source_dir=winpthreads else $as_nop - { ac_cv_exeext=; unset ac_cv_exeext;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: required but not available (uninitialized submodule?)" >&5 +printf "%s\n" "required but not available (uninitialized submodule?)" >&6; } + as_fn_error $? "exiting" "$LINENO" 5 fi -ac_cv_host_objext=$ac_cv_objext -if test ${ac_cv_build_objext+y} +else $as_nop + rm -rf winpthreads-sources + if test -f "$with_winpthreads_msvc/src/winpthread_internal.h" then : - ac_cv_objext=$ac_cv_build_objext + mkdir -p winpthreads-sources/src winpthreads-sources/include + cp "$with_winpthreads_msvc"/src/*.c winpthreads-sources/src + cp "$with_winpthreads_msvc"/src/*.h winpthreads-sources/src + cp "$with_winpthreads_msvc"/include/*.h winpthreads-sources/include + winpthreads_source_dir='winpthreads-sources' + winpthreadsmsg=" (from $with_winpthreads_msvc)" else $as_nop - { ac_cv_objext=; unset ac_cv_objext;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: requested but not available" >&5 +printf "%s\n" "requested but not available" >&6; } + as_fn_error $? "exiting" "$LINENO" 5 fi -ac_cv_host_c_compiler_gnu=$ac_cv_c_compiler_gnu -if test ${ac_cv_build_c_compiler_gnu+y} +fi + if test x"$winpthreads_source_dir" = 'x' then : - ac_cv_c_compiler_gnu=$ac_cv_build_c_compiler_gnu + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else $as_nop - { ac_cv_c_compiler_gnu=; unset ac_cv_c_compiler_gnu;} -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $winpthreads_source_dir$winpthreadsmsg" >&5 +printf "%s\n" "$winpthreads_source_dir$winpthreadsmsg" >&6; } + winpthreads_source_include_dir="$winpthreads_source_dir/include" + + + saved_CC="$CC" + saved_CFLAGS="$CFLAGS" + saved_CPPFLAGS="$CPPFLAGS" + saved_LIBS="$LIBS" + saved_ac_ext="$ac_ext" + saved_ac_compile="$ac_compile" + # Move the content of confdefs.h to another file so it does not + # get included + mv confdefs.h confdefs.h.bak + touch confdefs.h -cross_compiling_build=no -ac_build_tool_prefix= -if test -n "$build" + if test -n "$winpthreads_source_include_dir" then : - ac_build_tool_prefix="$build-" -elif test -n "$build_alias" + CPPFLAGS="-I $winpthreads_source_include_dir $CPPFLAGS" +fi + ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes then : - ac_build_tool_prefix="$build_alias-" + +else $as_nop + as_fn_error $? "cannot find or use pthread.h from winpthreads" "$LINENO" 5 fi -ac_ext=c -ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' -ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c -ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' -ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_build_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_build_tool_prefix}gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC_FOR_BUILD+y} + + # Restore the content of confdefs.h + mv confdefs.h.bak confdefs.h + ac_compile="$saved_ac_compile" + ac_ext="$saved_ac_ext" + CPPFLAGS="$saved_CPPFLAGS" + CFLAGS="$saved_CFLAGS" + CC="$saved_CC" + LIBS="$saved_LIBS" + + +fi ;; #( + *) : + if test x"$with_winpthreads_msvc" != 'x' then : - printf %s "(cached) " >&6 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: requested but not supported" >&5 +printf "%s\n" "requested but not supported" >&6; } + as_fn_error $? "exiting" "$LINENO" 5 else $as_nop - if test -n "$CC_FOR_BUILD"; then - ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC_FOR_BUILD="${ac_build_tool_prefix}gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD -if test -n "$CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 -printf "%s\n" "$CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: skipping on that platform" >&5 +printf "%s\n" "skipping on that platform" >&6; } +fi ;; +esac fi +## Program to use to install files -fi -if test -z "$ac_cv_prog_CC_FOR_BUILD"; then - ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$ac_ct_CC_FOR_BUILD"; then - ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -15897,1293 +15944,81 @@ do */) ;; *) as_dir=$as_dir/ ;; esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC_FOR_BUILD="gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + done IFS=$as_save_IFS -fi -fi -ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD -if test -n "$ac_ct_CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 -printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi +rm -rf conftest.one conftest.two conftest.dir - if test "x$ac_ct_CC_FOR_BUILD" = x; then - CC_FOR_BUILD="" +fi + if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install else - case $cross_compiling_build:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh fi -else - CC_FOR_BUILD="$ac_cv_prog_CC_FOR_BUILD" fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } -if test -z "$CC_FOR_BUILD"; then - if test -n "$ac_build_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_build_tool_prefix}cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then - ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC_FOR_BUILD="${ac_build_tool_prefix}cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD -if test -n "$CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 -printf "%s\n" "$CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - fi -fi -if test -z "$CC_FOR_BUILD"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then - ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC_FOR_BUILD="cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC_FOR_BUILD - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC_FOR_BUILD to just the basename; use the full file name. - shift - ac_cv_prog_CC_FOR_BUILD="$as_dir$ac_word${1+' '}$@" - fi -fi -fi -fi -CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD -if test -n "$CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 -printf "%s\n" "$CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$CC_FOR_BUILD"; then - if test -n "$ac_build_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_build_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then - ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC_FOR_BUILD="$ac_build_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD -if test -n "$CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 -printf "%s\n" "$CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$CC_FOR_BUILD" && break - done -fi -if test -z "$CC_FOR_BUILD"; then - ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC_FOR_BUILD"; then - ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD -if test -n "$ac_ct_CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 -printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_CC_FOR_BUILD" && break -done - - if test "x$ac_ct_CC_FOR_BUILD" = x; then - CC_FOR_BUILD="" - else - case $cross_compiling_build:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD - fi -fi - -fi -if test -z "$CC_FOR_BUILD"; then - if test -n "$ac_build_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. -set dummy ${ac_build_tool_prefix}clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then - ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC_FOR_BUILD="${ac_build_tool_prefix}clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD -if test -n "$CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 -printf "%s\n" "$CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC_FOR_BUILD"; then - ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD - # Extract the first word of "clang", so it can be a program name with args. -set dummy clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC_FOR_BUILD"; then - ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC_FOR_BUILD="clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD -if test -n "$ac_ct_CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 -printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC_FOR_BUILD" = x; then - CC_FOR_BUILD="" - else - case $cross_compiling_build:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD - fi -else - CC_FOR_BUILD="$ac_cv_prog_CC_FOR_BUILD" -fi - -fi - - -test -z "$CC_FOR_BUILD" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion -version; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 -printf %s "checking whether the compiler supports GNU C... " >&6; } -if test ${ac_cv_c_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GCC_FOR_BUILD=yes -else - GCC_FOR_BUILD= -fi -ac_test_CFLAGS=${CFLAGS_FOR_BUILD+y} -ac_save_CFLAGS=$CFLAGS_FOR_BUILD -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD accepts -g" >&5 -printf %s "checking whether $CC_FOR_BUILD accepts -g... " >&6; } -if test ${ac_cv_build_prog_cc_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_build_prog_cc_g=no - CFLAGS_FOR_BUILD="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_build_prog_cc_g=yes -else $as_nop - CFLAGS_FOR_BUILD="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS_FOR_BUILD="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_build_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_build_prog_cc_g" >&6; } -if test $ac_test_CFLAGS; then - CFLAGS_FOR_BUILD=$ac_save_CFLAGS -elif test $ac_cv_build_prog_cc_g = yes; then - if test "$GCC_FOR_BUILD" = yes; then - CFLAGS_FOR_BUILD="-g -O2" - else - CFLAGS_FOR_BUILD="-g" - fi -else - if test "$GCC_FOR_BUILD" = yes; then - CFLAGS_FOR_BUILD="-O2" - else - CFLAGS_FOR_BUILD= - fi -fi -ac_build_prog_cc_stdc=no -if test x$ac_build_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C11 features" >&5 -printf %s "checking for $CC_FOR_BUILD option to enable C11 features... " >&6; } -if test ${ac_cv_build_prog_cc_c11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_build_prog_cc_c11=no -ac_save_CC=$CC_FOR_BUILD -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c11_program -_ACEOF -for ac_arg in '' -std=gnu11 -do - CC_FOR_BUILD="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_build_prog_cc_c11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam - test "x$ac_cv_build_prog_cc_c11" != "xno" && break -done -rm -f conftest.$ac_ext -CC_FOR_BUILD=$ac_save_CC -fi - -if test "x$ac_cv_build_prog_cc_c11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_build_prog_cc_c11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_build_prog_cc_c11" >&6; } - CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_build_prog_cc_c11" -fi - ac_cv_build_prog_cc_stdc=$ac_cv_build_prog_cc_c11 - ac_build_prog_cc_stdc=c11 -fi -fi -if test x$ac_build_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C99 features" >&5 -printf %s "checking for $CC_FOR_BUILD option to enable C99 features... " >&6; } -if test ${ac_cv_build_prog_cc_c99+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_build_prog_cc_c99=no -ac_save_CC=$CC_FOR_BUILD -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c99_program -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= -do - CC_FOR_BUILD="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_build_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam - test "x$ac_cv_build_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC_FOR_BUILD=$ac_save_CC -fi - -if test "x$ac_cv_build_prog_cc_c99" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_build_prog_cc_c99" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_build_prog_cc_c99" >&6; } - CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_build_prog_cc_c99" -fi - ac_cv_build_prog_cc_stdc=$ac_cv_build_prog_cc_c99 - ac_build_prog_cc_stdc=c99 -fi -fi -if test x$ac_build_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C89 features" >&5 -printf %s "checking for $CC_FOR_BUILD option to enable C89 features... " >&6; } -if test ${ac_cv_build_prog_cc_c89+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_build_prog_cc_c89=no -ac_save_CC=$CC_FOR_BUILD -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c89_program -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC_FOR_BUILD="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_build_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam - test "x$ac_cv_build_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC_FOR_BUILD=$ac_save_CC -fi - -if test "x$ac_cv_build_prog_cc_c89" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_build_prog_cc_c89" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_build_prog_cc_c89" >&6; } - CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_build_prog_cc_c89" -fi - ac_cv_build_prog_cc_stdc=$ac_cv_build_prog_cc_c89 - ac_build_prog_cc_stdc=c89 -fi -fi - -ac_ext=c -ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' -ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -printf %s "checking whether the C compiler works... " >&6; } -ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else $as_nop - ac_file='' -fi -if test -z "$ac_file" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -printf %s "checking for C compiler default output file name... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -printf "%s\n" "$ac_file" >&6; } -ac_build_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -printf %s "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -printf "%s\n" "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_build_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -printf %s "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling_build" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling_build=no - else - if test "$cross_compiling_build" = maybe; then - cross_compiling_build=yes - else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--build'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling_build" >&5 -printf "%s\n" "$cross_compiling_build" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -printf %s "checking for suffix of object files... " >&6; } -if test ${ac_cv_objext+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -printf "%s\n" "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_build_objext=$OBJEXT - -ac_ext=c -ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' -ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -printf %s "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP_FOR_BUILD" && test -d "$CPP_FOR_BUILD"; then - CPP_FOR_BUILD= -fi -if test -z "$CPP_FOR_BUILD"; then - if test ${ac_cv_build_prog_CPP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded - for CPP_FOR_BUILD in "$CC_FOR_BUILD -E" "$CC_FOR_BUILD -E -traditional-cpp" cpp /lib/cpp - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - break -fi - - done - ac_cv_build_prog_CPP=$CPP_FOR_BUILD - -fi - CPP_FOR_BUILD=$ac_cv_build_prog_CPP -else - ac_cv_build_prog_CPP=$CPP_FOR_BUILD -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP_FOR_BUILD" >&5 -printf "%s\n" "$CPP_FOR_BUILD" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP_FOR_BUILD\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' -ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -BUILD_EXEEXT=$ac_cv_exeext -BUILD_OBJEXT=$ac_cv_objext - -ac_cv_exeext=$ac_cv_host_exeext -EXEEXT=$ac_cv_host_exeext -ac_cv_objext=$ac_cv_host_objext -OBJEXT=$ac_cv_host_objext -ac_cv_c_compiler_gnu=$ac_cv_host_c_compiler_gnu -ac_compiler_gnu=$ac_cv_host_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - # Note that *-pc-windows is not supported for _build_ so we can use '-o' - SAK_BUILD="$CC_FOR_BUILD $LDFLAGS_FOR_BUILD -o \$(1) \$(2) $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD" - SAK="\$(ROOTDIR)/runtime/sak${BUILD_EXEEXT}" -fi - -# sak command to use to encode C literal strings - -case $target in #( - *-w64-mingw32*|*-pc-windows) : - encode_C_literal="encode-C-utf16-literal" ;; #( - *) : - encode_C_literal="encode-C-utf8-literal" ;; -esac - -# Winpthreads emulation library for the MSVC port -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for winpthreads sources" >&5 -printf %s "checking for winpthreads sources... " >&6; } -if test x"$with_winpthreads_msvc" = "xno" -then : - winpthreads_source_dir='' - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -printf "%s\n" "disabled" >&6; } -else $as_nop - winpthreadmsg='' - case $target in #( - *-pc-windows) : - if test x"$with_winpthreads_msvc" = 'x' || test x"$with_winpthreads_msvc" = x'winpthreads' -then : - if test -f 'winpthreads/src/winpthread_internal.h' -then : - winpthreads_source_dir=winpthreads -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: required but not available (uninitialized submodule?)" >&5 -printf "%s\n" "required but not available (uninitialized submodule?)" >&6; } - as_fn_error $? "exiting" "$LINENO" 5 -fi -else $as_nop - rm -rf winpthreads-sources - if test -f "$with_winpthreads_msvc/src/winpthread_internal.h" -then : - mkdir -p winpthreads-sources/src winpthreads-sources/include - cp "$with_winpthreads_msvc"/src/*.c winpthreads-sources/src - cp "$with_winpthreads_msvc"/src/*.h winpthreads-sources/src - cp "$with_winpthreads_msvc"/include/*.h winpthreads-sources/include - winpthreads_source_dir='winpthreads-sources' - winpthreadsmsg=" (from $with_winpthreads_msvc)" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: requested but not available" >&5 -printf "%s\n" "requested but not available" >&6; } - as_fn_error $? "exiting" "$LINENO" 5 -fi -fi - if test x"$winpthreads_source_dir" = 'x' -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $winpthreads_source_dir$winpthreadsmsg" >&5 -printf "%s\n" "$winpthreads_source_dir$winpthreadsmsg" >&6; } - winpthreads_source_include_dir="$winpthreads_source_dir/include" - - - saved_CC="$CC" - saved_CFLAGS="$CFLAGS" - saved_CPPFLAGS="$CPPFLAGS" - saved_LIBS="$LIBS" - saved_ac_ext="$ac_ext" - saved_ac_compile="$ac_compile" - # Move the content of confdefs.h to another file so it does not - # get included - mv confdefs.h confdefs.h.bak - touch confdefs.h - - - if test -n "$winpthreads_source_include_dir" -then : - CPPFLAGS="-I $winpthreads_source_include_dir $CPPFLAGS" -fi - ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes -then : - -else $as_nop - as_fn_error $? "cannot find or use pthread.h from winpthreads" "$LINENO" 5 -fi - - - - # Restore the content of confdefs.h - mv confdefs.h.bak confdefs.h - ac_compile="$saved_ac_compile" - ac_ext="$saved_ac_ext" - CPPFLAGS="$saved_CPPFLAGS" - CFLAGS="$saved_CFLAGS" - CC="$saved_CC" - LIBS="$saved_LIBS" - - -fi ;; #( - *) : - if test x"$with_winpthreads_msvc" != 'x' -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: requested but not supported" >&5 -printf "%s\n" "requested but not supported" >&6; } - as_fn_error $? "exiting" "$LINENO" 5 -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: skipping on that platform" >&5 -printf "%s\n" "skipping on that platform" >&6; } -fi ;; -esac -fi - -## Program to use to install files - - # Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -printf %s "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test ${ac_cv_path_install+y} -then : - printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - # Account for fact that we put trailing slashes in our PATH walk. -case $as_dir in #(( - ./ | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test ${ac_cv_path_install+y}; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -printf "%s\n" "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -# Checks for libraries - -## Mathematical library -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing cos" >&5 -printf %s "checking for library containing cos... " >&6; } -if test ${ac_cv_search_cos+y} +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +# Checks for libraries + +## Mathematical library +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing cos" >&5 +printf %s "checking for library containing cos... " >&6; } +if test ${ac_cv_search_cos+y} then : printf %s "(cached) " >&6 else $as_nop @@ -17250,35 +16085,22 @@ fi # Checks for header files -ac_fn_c_check_header_compile "$LINENO" "pthread_np.h" "ac_cv_header_pthread_np_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_np_h" = xyes -then : - printf "%s\n" "#define HAS_PTHREAD_NP_H 1" >>confdefs.h -fi + + ac_fn_c_check_header_compile "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "#include " if test "x$ac_cv_header_dirent_h" = xyes then : - printf "%s\n" "#define HAS_DIRENT 1" >>confdefs.h + printf "%s\n" "#define HAVE_DIRENT_H 1" >>confdefs.h fi - - ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "#include " if test "x$ac_cv_header_sys_select_h" = xyes then : - printf "%s\n" "#define HAS_SYS_SELECT_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mman_h" = xyes -then : - printf "%s\n" "#define HAS_SYS_MMAN_H 1" >>confdefs.h + printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h fi @@ -17288,7 +16110,7 @@ case $target in #( ac_fn_c_check_header_compile "$LINENO" "linux/futex.h" "ac_cv_header_linux_futex_h" "$ac_includes_default" if test "x$ac_cv_header_linux_futex_h" = xyes then : - printf "%s\n" "#define HAS_LINUX_FUTEX_H 1" >>confdefs.h + printf "%s\n" "#define HAVE_LINUX_FUTEX_H 1" >>confdefs.h fi ;; #( @@ -17486,7 +16308,8 @@ then : elif test "x$ac_cv_sizeof_long_p" = "x8" then : bits=64; arch64=true - printf "%s\n" "#define ARCH_SIXTYFOUR 1" >>confdefs.h + +printf "%s\n" "#define ARCH_SIXTYFOUR 1" >>confdefs.h else $as_nop as_fn_error $? "Neither 32 nor 64 bits architecture." "$LINENO" 5 @@ -17507,11 +16330,6 @@ then : fi -printf "%s\n" "#define SIZEOF_PTR $ac_cv_sizeof_long_p" >>confdefs.h - -printf "%s\n" "#define SIZEOF_LONGLONG $ac_cv_sizeof_long_long" >>confdefs.h - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Target is a $bits bits architecture" >&5 printf "%s\n" "$as_me: Target is a $bits bits architecture" >&6;} @@ -17734,13 +16552,10 @@ fi printf "%s\n" "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) - - printf "%s\n" "#define ARCH_BIG_ENDIAN 1" >>confdefs.h - - endianness="be" - ;; #( + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( no) - endianness="le" ;; #( + ;; #( universal) as_fn_error $? "unable to handle universal endianness" "$LINENO" 5 @@ -17859,23 +16674,26 @@ then : if test "$ac_cv_alignof_double" -gt 4 then : align_double=true - printf "%s\n" "#define ARCH_ALIGN_DOUBLE 1" >>confdefs.h + +printf "%s\n" "#define ARCH_ALIGN_DOUBLE 1" >>confdefs.h fi if test "x$ac_cv_sizeof_long" = "x8" && test "$ac_cv_alignof_long" -gt 4 then : align_int64=true - printf "%s\n" "#define ARCH_ALIGN_INT64 1" >>confdefs.h - else $as_nop if test "x$ac_cv_sizeof_long_long" = "x8" && test "$ac_cv_alignof_long_long" -gt 4 then : align_int64=true - printf "%s\n" "#define ARCH_ALIGN_INT64 1" >>confdefs.h - fi +fi + if $align_int64 +then : + +printf "%s\n" "#define ARCH_ALIGN_INT64 1" >>confdefs.h + fi ;; esac @@ -17907,80 +16725,14 @@ fi # Support for C11 atomic types - - saved_CC="$CC" - saved_CFLAGS="$CFLAGS" - saved_CPPFLAGS="$CPPFLAGS" - saved_LIBS="$LIBS" - saved_ac_ext="$ac_ext" - saved_ac_compile="$ac_compile" - # Move the content of confdefs.h to another file so it does not - # get included - mv confdefs.h confdefs.h.bak - touch confdefs.h - - - opts="" - if test -n "" -then : - CFLAGS="$CFLAGS "; opts="" -fi - if test -n "$cclibs" -then : - LIBS="$LIBS $cclibs"; opts="${opts:+$opts }$cclibs" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports _Atomic types with ${opts:-no additional options}" >&5 -printf %s "checking if $CC supports _Atomic types with ${opts:-no additional options}... " >&6; } - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -int -main (void) -{ - - _Atomic int64_t n; - int m; - int * _Atomic p = &m; - atomic_store_explicit(&n, 123, memory_order_release); - * atomic_exchange(&p, 0) = 45; - if (atomic_load_explicit(&n, memory_order_acquire)) - return 1; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for options needed to enable C11 atomic support" >&5 +printf %s "checking for options needed to enable C11 atomic support... " >&6; } +if test ${ocaml_cv_prog_cc_c11_atomic_cflags+y} then : - cc_supports_atomic=true - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + printf %s "(cached) " >&6 else $as_nop - cc_supports_atomic=false - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - - - # Restore the content of confdefs.h - mv confdefs.h.bak confdefs.h - ac_compile="$saved_ac_compile" - ac_ext="$saved_ac_ext" - CPPFLAGS="$saved_CPPFLAGS" - CFLAGS="$saved_CFLAGS" - CC="$saved_CC" - LIBS="$saved_LIBS" - - -case $cc_supports_atomic,$ocaml_cc_vendor in #( - false,msvc-*) : - + ocaml_cv_prog_cc_c11_atomic_cflags='cannot detect' + for ocaml_arg in '' '-experimental:c11atomics' '-std:c11' '-std:c11 -experimental:c11atomics' ; do saved_CC="$CC" saved_CFLAGS="$CFLAGS" @@ -17993,20 +16745,12 @@ case $cc_supports_atomic,$ocaml_cc_vendor in #( mv confdefs.h confdefs.h.bak touch confdefs.h - - opts="" - if test -n "-std:c11" -then : - CFLAGS="$CFLAGS -std:c11"; opts="-std:c11" -fi - if test -n "" + CFLAGS="$CFLAGS $ocaml_arg" + if test -n "$cclibs" then : - LIBS="$LIBS "; opts="${opts:+$opts }" + LIBS="$LIBS $cclibs" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports _Atomic types with ${opts:-no additional options}" >&5 -printf %s "checking if $CC supports _Atomic types with ${opts:-no additional options}... " >&6; } - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -18030,17 +16774,12 @@ main (void) _ACEOF if ac_fn_c_try_link "$LINENO" then : - cc_supports_atomic=true - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + if test x"$ocaml_arg" = x +then : + ocaml_cv_prog_cc_c11_atomic_cflags='none needed' else $as_nop - cc_supports_atomic=false - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + ocaml_cv_prog_cc_c11_atomic_cflags="$ocaml_arg" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - # Restore the content of confdefs.h mv confdefs.h.bak confdefs.h @@ -18051,73 +16790,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ CC="$saved_CC" LIBS="$saved_LIBS" - - if $cc_supports_atomic -then : - common_cflags="$common_cflags -std:c11" -else $as_nop - - - saved_CC="$CC" - saved_CFLAGS="$CFLAGS" - saved_CPPFLAGS="$CPPFLAGS" - saved_LIBS="$LIBS" - saved_ac_ext="$ac_ext" - saved_ac_compile="$ac_compile" - # Move the content of confdefs.h to another file so it does not - # get included - mv confdefs.h confdefs.h.bak - touch confdefs.h - - - opts="" - if test -n "-std:c11 -experimental:c11atomics" -then : - CFLAGS="$CFLAGS -std:c11 -experimental:c11atomics"; opts="-std:c11 -experimental:c11atomics" -fi - if test -n "" -then : - LIBS="$LIBS "; opts="${opts:+$opts }" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports _Atomic types with ${opts:-no additional options}" >&5 -printf %s "checking if $CC supports _Atomic types with ${opts:-no additional options}... " >&6; } - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -int -main (void) -{ - - _Atomic int64_t n; - int m; - int * _Atomic p = &m; - atomic_store_explicit(&n, 123, memory_order_release); - * atomic_exchange(&p, 0) = 45; - if (atomic_load_explicit(&n, memory_order_acquire)) - return 1; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - cc_supports_atomic=true - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - cc_supports_atomic=false - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + break fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - # Restore the content of confdefs.h mv confdefs.h.bak confdefs.h ac_compile="$saved_ac_compile" @@ -18127,23 +16804,22 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ CC="$saved_CC" LIBS="$saved_LIBS" - - if $cc_supports_atomic -then : - common_cflags="$common_cflags -std:c11 -experimental:c11atomics" + done fi - -fi ;; #( - *) : - ;; -esac -if ! $cc_supports_atomic -then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_prog_cc_c11_atomic_cflags" >&5 +printf "%s\n" "$ocaml_cv_prog_cc_c11_atomic_cflags" >&6; } + case $ocaml_cv_prog_cc_c11_atomic_cflags in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C11 atomic support is required, use another C compiler -See \`config.log' for more details" "$LINENO" 5; } -fi +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + : ;; #( + *) : + common_cflags="$common_cflags $ocaml_cv_prog_cc_c11_atomic_cflags" ;; +esac + # Full support for thread local storage # macOS and MinGW-w64 have problems with thread local storage accessed from DLLs @@ -18152,7 +16828,8 @@ case $target in #( *-apple-darwin*|*-w64-mingw32*|*-pc-windows) : ;; #( *) : - printf "%s\n" "#define HAS_FULL_THREAD_VARIABLES 1" >>confdefs.h + +printf "%s\n" "#define HAS_FULL_THREAD_VARIABLES 1" >>confdefs.h ;; esac @@ -18384,9 +17061,15 @@ esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler supports __attribute__((optimize(\"tree-vectorize\")))" >&5 printf %s "checking whether the C compiler supports __attribute__((optimize(\"tree-vectorize\")))... " >&6; } - saved_CFLAGS="$CFLAGS" - CFLAGS="$warn_error_flag $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test ${ocaml_cv_prog_cc_optimize_tree_vectorize+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + + saved_CFLAGS="$CFLAGS" + CFLAGS="$warn_error_flag $CFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ __attribute__((optimize("tree-vectorize"))) void f(void) {} int @@ -18399,16 +17082,16 @@ f(); _ACEOF if ac_fn_c_try_compile "$LINENO" then : - printf "%s\n" "#define SUPPORTS_TREE_VECTORIZE 1" >>confdefs.h - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + ocaml_cv_prog_cc_optimize_tree_vectorize=yes else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + ocaml_cv_prog_cc_optimize_tree_vectorize=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS="$saved_CFLAGS" + CFLAGS="$saved_CFLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_prog_cc_optimize_tree_vectorize" >&5 +printf "%s\n" "$ocaml_cv_prog_cc_optimize_tree_vectorize" >&6; } # Check whether the C compiler supports the labels as values extension. @@ -18637,6 +17320,7 @@ case $enable_native_toplevel,$natdynlink in #( install_ocamlnat=false ;; esac + printf "%s\n" "#define OCAML_OS_TYPE \"$ostype\"" >>confdefs.h target_os_type="$ostype" @@ -18958,7 +17642,8 @@ esac if test "$with_pic" then : fpic=true - printf "%s\n" "#define CAML_WITH_FPIC 1" >>confdefs.h + +printf "%s\n" "#define CAML_WITH_FPIC 1" >>confdefs.h internal_cflags="$internal_cflags $sharedlib_cflags" default_aspp="$default_aspp $sharedlib_cflags" @@ -19029,6 +17714,55 @@ printf "%s\n" "$as_me: rlwrap doesn't work with native win32 - disabling" >&6;} esac # Checks for library functions + +ac_func= +for ac_item in $ac_func_c_list +do + if test $ac_func; then + ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func + if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then + echo "#define $ac_item 1" >> confdefs.h + fi + ac_func= + else + ac_func=$ac_item + fi +done + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ## Check the semantics of signal handlers @@ -19052,7 +17786,8 @@ fi if $has_sigaction && $has_sigprocmask then : - printf "%s\n" "#define POSIX_SIGNALS 1" >>confdefs.h + +printf "%s\n" "#define POSIX_SIGNALS 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: POSIX signal handling found." >&5 printf "%s\n" "$as_me: POSIX signal handling found." >&6;} @@ -19086,12 +17821,19 @@ done if $has_c99_float_ops then : - printf "%s\n" "#define HAS_C99_FLOAT_OPS 1" >>confdefs.h + +printf "%s\n" "#define HAS_C99_FLOAT_OPS 1" >>confdefs.h # Check whether round works (known bug in mingw-w64) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether round works" >&5 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether round works" >&5 printf %s "checking whether round works... " >&6; } +if test ${ocaml_cv_func_round_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + old_cross_compiling="$cross_compiling" if test "x$target_runnable" = 'xtrue' @@ -19102,13 +17844,9 @@ fi then : case $target in #( x86_64-w64-mingw32*) : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross-compiling; assume not" >&5 -printf "%s\n" "cross-compiling; assume not" >&6; } ;; #( + ocaml_cv_func_round_works=no-cross-compiling ;; #( *) : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross-compiling; assume yes" >&5 -printf "%s\n" "cross-compiling; assume yes" >&6; } - printf "%s\n" "#define HAS_WORKING_ROUND 1" >>confdefs.h - ;; + ocaml_cv_func_round_works=yes-cross-compiling ;; esac else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19127,30 +17865,16 @@ main (void) _ACEOF if ac_fn_c_try_run "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - printf "%s\n" "#define HAS_WORKING_ROUND 1" >>confdefs.h - + ocaml_cv_func_round_works=yes else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - case $enable_imprecise_c99_float_ops,$target in #( + case $enable_imprecise_c99_float_ops,$target in #( no,*) : - hard_error=true ;; #( - yes,*) : - hard_error=false ;; #( - *,x86_64-w64-mingw32*) : - hard_error=false ;; #( + ocaml_cv_func_round_works=no-with-hard-error ;; #( + yes,*|*,x86_64-w64-mingw32*) : + ocaml_cv_func_round_works=no ;; #( *) : - hard_error=true ;; + ocaml_cv_func_round_works=no-with-hard-error ;; esac - if test x"$hard_error" = "xtrue" -then : - as_fn_error $? "round does not work, enable emulation with --enable-imprecise-c99-float-ops" "$LINENO" 5 -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: round does not work; emulation enabled" >&5 -printf "%s\n" "$as_me: WARNING: round does not work; emulation enabled" >&2;} -fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -19158,12 +17882,42 @@ fi cross_compiling="$old_cross_compiling" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_func_round_works" >&5 +printf "%s\n" "$ocaml_cv_func_round_works" >&6; } + case $ocaml_cv_func_round_works in #( + yes*) : + +printf "%s\n" "#define HAVE_WORKING_ROUND 1" >>confdefs.h + + if test "x$ocaml_cv_func_round_works" = xyes-cross-compiling +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross-compiling; assume yes" >&5 +printf "%s\n" "cross-compiling; assume yes" >&6; } +fi ;; #( + no-with-hard-error) : + as_fn_error $? "round does not work, enable emulation with --enable-imprecise-c99-float-ops" "$LINENO" 5 ;; #( + no) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: round does not work; emulation enabled" >&5 +printf "%s\n" "$as_me: WARNING: round does not work; emulation enabled" >&2;} ;; #( + no-cross-compiling) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross-compiling; assume not" >&5 +printf "%s\n" "cross-compiling; assume not" >&6; } ;; #( + *) : + ;; +esac # Check whether fma works (regressed in mingw-w64 8.0.0; and present but # unimplemented in Cygwin64) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fma works" >&5 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fma works" >&5 printf %s "checking whether fma works... " >&6; } +if test ${ocaml_cv_func_fma_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + old_cross_compiling="$cross_compiling" if test "x$target_runnable" = 'xtrue' @@ -19173,14 +17927,10 @@ fi if test "$cross_compiling" = yes then : case $target in #( - x86_64-w64-mingw32*|x86_64-*-cygwin) : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross-compiling; assume not" >&5 -printf "%s\n" "cross-compiling; assume not" >&6; } ;; #( + x86_64-w64-mingw32*|x86_64-*-cygwin*) : + ocaml_cv_func_fma_works=no-cross-compiling ;; #( *) : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross-compiling; assume yes" >&5 -printf "%s\n" "cross-compiling; assume yes" >&6; } - printf "%s\n" "#define HAS_WORKING_FMA 1" >>confdefs.h - ;; + ocaml_cv_func_fma_works=yes-cross-compiling ;; esac else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19222,30 +17972,16 @@ main (void) _ACEOF if ac_fn_c_try_run "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - printf "%s\n" "#define HAS_WORKING_FMA 1" >>confdefs.h - + ocaml_cv_func_fma_works=yes else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - case $enable_imprecise_c99_float_ops,$target in #( + case $enable_imprecise_c99_float_ops,$target in #( no,*) : - hard_error=true ;; #( - yes,*) : - hard_error=false ;; #( - *,x86_64-w64-mingw32*|*,x86_64-*-cygwin) : - hard_error=false ;; #( + ocaml_cv_func_fma_works=no-with-hard-error ;; #( + yes,*|*,x86_64-w64-mingw32*|*,x86_64-*-cygwin*) : + ocaml_cv_func_fma_works=no ;; #( *) : - hard_error=true ;; + ocaml_cv_func_fma_works=no-with-hard-error ;; esac - if test x"$hard_error" = "xtrue" -then : - as_fn_error $? "fma does not work, enable emulation with --enable-imprecise-c99-float-ops" "$LINENO" 5 -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: fma does not work; emulation enabled" >&5 -printf "%s\n" "$as_me: WARNING: fma does not work; emulation enabled" >&2;} -fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -19253,74 +17989,38 @@ fi cross_compiling="$old_cross_compiling" - -else $as_nop - if test x"$enable_imprecise_c99_float_ops" != "xyes" -then : - as_fn_error $? "C99 float ops unavailable, enable replacements with --enable-imprecise-c99-float-ops" "$LINENO" 5 -fi -fi - -## getentropy -ac_fn_c_check_func "$LINENO" "getentropy" "ac_cv_func_getentropy" -if test "x$ac_cv_func_getentropy" = xyes -then : - printf "%s\n" "#define HAS_GETENTROPY 1" >>confdefs.h - -fi - - -## getrusage -ac_fn_c_check_func "$LINENO" "getrusage" "ac_cv_func_getrusage" -if test "x$ac_cv_func_getrusage" = xyes -then : - printf "%s\n" "#define HAS_GETRUSAGE 1" >>confdefs.h - -fi - - -## times -ac_fn_c_check_func "$LINENO" "times" "ac_cv_func_times" -if test "x$ac_cv_func_times" = xyes -then : - printf "%s\n" "#define HAS_TIMES 1" >>confdefs.h - fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_func_fma_works" >&5 +printf "%s\n" "$ocaml_cv_func_fma_works" >&6; } + case $ocaml_cv_func_fma_works in #( + yes*) : +printf "%s\n" "#define HAVE_WORKING_FMA 1" >>confdefs.h -## secure_getenv and __secure_getenv - -saved_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" - -ac_fn_c_check_func "$LINENO" "secure_getenv" "ac_cv_func_secure_getenv" -if test "x$ac_cv_func_secure_getenv" = xyes + if test "x$ocaml_cv_func_fma_works" = xyes-cross-compiling then : - printf "%s\n" "#define HAS_SECURE_GETENV 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross-compiling; assume yes" >&5 +printf "%s\n" "cross-compiling; assume yes" >&6; } +fi ;; #( + no-with-hard-error) : + as_fn_error $? "fma does not work, enable emulation with --enable-imprecise-c99-float-ops" "$LINENO" 5 ;; #( + no) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: fma does not work; emulation enabled" >&5 +printf "%s\n" "$as_me: WARNING: fma does not work; emulation enabled" >&2;} ;; #( + no-cross-compiling) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross-compiling; assume not" >&5 +printf "%s\n" "cross-compiling; assume not" >&6; } ;; #( + *) : + ;; +esac else $as_nop - ac_fn_c_check_func "$LINENO" "__secure_getenv" "ac_cv_func___secure_getenv" -if test "x$ac_cv_func___secure_getenv" = xyes + if test x"$enable_imprecise_c99_float_ops" != "xyes" then : - printf "%s\n" "#define HAS___SECURE_GETENV 1" >>confdefs.h - -fi - + as_fn_error $? "C99 float ops unavailable, enable replacements with --enable-imprecise-c99-float-ops" "$LINENO" 5 fi - - -CPPFLAGS="$saved_CPPFLAGS" - -## issetugid - -ac_fn_c_check_func "$LINENO" "issetugid" "ac_cv_func_issetugid" -if test "x$ac_cv_func_issetugid" = xyes -then : - printf "%s\n" "#define HAS_ISSETUGID 1" >>confdefs.h - fi - ## Checking for monotonic clock source ## On Windows MSVC, QueryPerformanceCounter and QueryPerformanceFrequency ## are always available. @@ -19341,7 +18041,8 @@ then : printf "%s\n" "#define HAVE_CLOCK_GETTIME_NSEC_NP 1" >>confdefs.h has_monotonic_clock=true - printf "%s\n" "#define HAS_CLOCK_GETTIME_NSEC_NP 1" >>confdefs.h + +printf "%s\n" "#define HAS_CLOCK_GETTIME_NSEC_NP 1" >>confdefs.h else $as_nop @@ -19372,7 +18073,8 @@ if ac_fn_c_try_cpp "$LINENO" then : has_monotonic_clock=true - printf "%s\n" "#define HAS_POSIX_MONOTONIC_CLOCK 1" >>confdefs.h + +printf "%s\n" "#define HAS_POSIX_MONOTONIC_CLOCK 1" >>confdefs.h else $as_nop @@ -19740,7 +18442,8 @@ fi ac_fn_c_check_header_compile "$LINENO" "libunwind.h" "ac_cv_header_libunwind_h" "$ac_includes_default" if test "x$ac_cv_header_libunwind_h" = xyes then : - printf "%s\n" "#define HAS_LIBUNWIND 1" >>confdefs.h + +printf "%s\n" "#define HAS_LIBUNWIND 1" >>confdefs.h libunwind_available=true else $as_nop @@ -19841,7 +18544,7 @@ fi ac_fn_c_check_func "$LINENO" "socketpair" "ac_cv_func_socketpair" if test "x$ac_cv_func_socketpair" = xyes then : - printf "%s\n" "#define HAS_SOCKETPAIR 1" >>confdefs.h + printf "%s\n" "#define HAVE_SOCKETPAIR 1" >>confdefs.h fi ;; #( @@ -19849,11 +18552,11 @@ fi cclibs="$cclibs ws2_32.lib" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 printf %s "checking for library containing socket... " >&6; } -if test ${ac_cv_search_socket+y} +if test ${ocaml_cv_search_socket+y} then : printf %s "(cached) " >&6 else $as_nop - ac_func_search_save_LIBS=$LIBS + ocaml_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19869,47 +18572,47 @@ return socket (); return 0; } _ACEOF -for ac_lib in '' ws2_32 +for ocaml_lib in '' ws2_32 do - if test -z "$ac_lib"; then - ac_res="none required" + if test -z "$ocaml_lib"; then + ocaml_res="none required" else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" + ocaml_res=${ocaml_lib}.lib + LIBS="${ocaml_lib}.lib $ocaml_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : - ac_cv_search_socket=$ac_res + ocaml_cv_search_socket=$ocaml_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if test ${ac_cv_search_socket+y} + if test ${ocaml_cv_search_socket+y} then : break fi done -if test ${ac_cv_search_socket+y} +if test ${ocaml_cv_search_socket+y} then : else $as_nop - ac_cv_search_socket=no + ocaml_cv_search_socket=no fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ocaml_func_search_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 -printf "%s\n" "$ac_cv_search_socket" >&6; } -ac_res=$ac_cv_search_socket -if test "$ac_res" != no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_search_socket" >&5 +printf "%s\n" "$ocaml_cv_search_socket" >&6; } +ocaml_res=$ocaml_cv_search_socket +if test "$ocaml_res" != no then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ocaml_res" = "none required" || LIBS="$ocaml_res $LIBS" fi ac_fn_c_check_func "$LINENO" "socketpair" "ac_cv_func_socketpair" if test "x$ac_cv_func_socketpair" = xyes then : - printf "%s\n" "#define HAS_SOCKETPAIR 1" >>confdefs.h + printf "%s\n" "#define HAVE_SOCKETPAIR 1" >>confdefs.h fi ;; #( @@ -20118,7 +18821,8 @@ esac if $sockets then : - printf "%s\n" "#define HAS_SOCKETS 1" >>confdefs.h + +printf "%s\n" "#define HAVE_SOCKETS 1" >>confdefs.h fi @@ -20130,7 +18834,9 @@ case $target in #( " if test "x$ac_cv_type_socklen_t" = xyes then : - printf "%s\n" "#define HAS_SOCKLEN_T 1" >>confdefs.h + +printf "%s\n" "#define HAVE_SOCKLEN_T 1" >>confdefs.h + fi ;; #( @@ -20139,43 +18845,33 @@ fi " if test "x$ac_cv_type_socklen_t" = xyes then : - printf "%s\n" "#define HAS_SOCKLEN_T 1" >>confdefs.h -fi - ;; -esac +printf "%s\n" "#define HAVE_SOCKLEN_T 1" >>confdefs.h -ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton" -if test "x$ac_cv_func_inet_aton" = xyes -then : - printf "%s\n" "#define HAS_INET_ATON 1" >>confdefs.h fi - + ;; +esac ## Unix domain sockets support on Windows case $target in #( *-w64-mingw32*|*-pc-windows) : - for ac_header in afunix.h -do : - ac_fn_c_check_header_compile "$LINENO" "afunix.h" "ac_cv_header_afunix_h" "#include + ac_fn_c_check_header_compile "$LINENO" "afunix.h" "ac_cv_header_afunix_h" "#include " if test "x$ac_cv_header_afunix_h" = xyes then : printf "%s\n" "#define HAVE_AFUNIX_H 1" >>confdefs.h - printf "%s\n" "#define HAS_AFUNIX_H 1" >>confdefs.h fi - -done ;; #( + ;; #( *) : ;; esac ## IPv6 support -ipv6=true +have_ipv6=true case $target in #( *-w64-mingw32*|*-pc-windows) : @@ -20185,7 +18881,7 @@ if test "x$ac_cv_type_struct_sockaddr_in6" = xyes then : else $as_nop - ipv6=false + have_ipv6=false fi ;; #( *) : @@ -20200,13 +18896,13 @@ if test "x$ac_cv_type_struct_sockaddr_in6" = xyes then : else $as_nop - ipv6=false + have_ipv6=false fi ;; esac -if $ipv6 +if $have_ipv6 then : for ac_func in getaddrinfo getnameinfo inet_pton inet_ntop @@ -20220,65 +18916,17 @@ then : _ACEOF else $as_nop - ipv6=false + $have_ipv6=false fi done fi -if $ipv6 -then : - printf "%s\n" "#define HAS_IPV6 1" >>confdefs.h - -fi - -ac_fn_c_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir" -if test "x$ac_cv_func_rewinddir" = xyes -then : - printf "%s\n" "#define HAS_REWINDDIR 1" >>confdefs.h - -fi - - -ac_fn_c_check_func "$LINENO" "lockf" "ac_cv_func_lockf" -if test "x$ac_cv_func_lockf" = xyes -then : - printf "%s\n" "#define HAS_LOCKF 1" >>confdefs.h - -fi - - -ac_fn_c_check_func "$LINENO" "mkfifo" "ac_cv_func_mkfifo" -if test "x$ac_cv_func_mkfifo" = xyes -then : - printf "%s\n" "#define HAS_MKFIFO 1" >>confdefs.h - -fi - - -ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" -if test "x$ac_cv_func_getcwd" = xyes -then : - printf "%s\n" "#define HAS_GETCWD 1" >>confdefs.h - -fi - - -ac_fn_c_check_func "$LINENO" "system" "ac_cv_func_system" -if test "x$ac_cv_func_system" = xyes -then : - printf "%s\n" "#define HAS_SYSTEM 1" >>confdefs.h - -fi - ## utime -## Note: this was defined in config/s-nt.h but the autoconf macros do not -# seem to detect it properly on Windows so we hardcode the definition -# of HAS_UTIME on Windows but this will probably need to be clarified case $target in #( + # SetFileTime is used instead of _utime, *-w64-mingw32*|*-pc-windows) : - printf "%s\n" "#define HAS_UTIME 1" >>confdefs.h - ;; #( + ;; #( *) : ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" if test "x$ac_cv_header_sys_types_h" = xyes @@ -20289,7 +18937,8 @@ then : ac_fn_c_check_func "$LINENO" "utime" "ac_cv_func_utime" if test "x$ac_cv_func_utime" = xyes then : - printf "%s\n" "#define HAS_UTIME 1" >>confdefs.h + +printf "%s\n" "#define HAS_UTIME 1" >>confdefs.h fi @@ -20299,21 +18948,14 @@ fi ;; esac -ac_fn_c_check_func "$LINENO" "utimes" "ac_cv_func_utimes" -if test "x$ac_cv_func_utimes" = xyes -then : - printf "%s\n" "#define HAS_UTIMES 1" >>confdefs.h - -fi - - ac_fn_c_check_func "$LINENO" "fchmod" "ac_cv_func_fchmod" if test "x$ac_cv_func_fchmod" = xyes then : ac_fn_c_check_func "$LINENO" "fchown" "ac_cv_func_fchown" if test "x$ac_cv_func_fchown" = xyes then : - printf "%s\n" "#define HAS_FCHMOD 1" >>confdefs.h + +printf "%s\n" "#define HAS_FCHMOD 1" >>confdefs.h fi @@ -20326,7 +18968,8 @@ then : ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate" if test "x$ac_cv_func_ftruncate" = xyes then : - printf "%s\n" "#define HAS_TRUNCATE 1" >>confdefs.h + +printf "%s\n" "#define HAS_TRUNCATE 1" >>confdefs.h fi @@ -20344,18 +18987,11 @@ then : " if test "x$ac_cv_type_fd_set" = xyes then : - printf "%s\n" "#define HAS_SELECT 1" >>confdefs.h -fi +printf "%s\n" "#define HAS_SELECT 1" >>confdefs.h fi - -ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" -if test "x$ac_cv_func_nanosleep" = xyes -then : - printf "%s\n" "#define HAS_NANOSLEEP 1" >>confdefs.h - fi @@ -20368,72 +19004,13 @@ then : ac_fn_c_check_func "$LINENO" "lstat" "ac_cv_func_lstat" if test "x$ac_cv_func_lstat" = xyes then : - printf "%s\n" "#define HAS_SYMLINK 1" >>confdefs.h - -fi - -fi - -fi - - -ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath" -if test "x$ac_cv_func_realpath" = xyes -then : - printf "%s\n" "#define HAS_REALPATH 1" >>confdefs.h - -fi - - -# wait -ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid" -if test "x$ac_cv_func_waitpid" = xyes -then : - - wait=true - printf "%s\n" "#define HAS_WAITPID 1" >>confdefs.h - - -else $as_nop - wait=false -fi - - -ac_fn_c_check_func "$LINENO" "wait4" "ac_cv_func_wait4" -if test "x$ac_cv_func_wait4" = xyes -then : - - has_wait=true - printf "%s\n" "#define HAS_WAIT4 1" >>confdefs.h - - -fi - -## getgroups -ac_fn_c_check_func "$LINENO" "getgroups" "ac_cv_func_getgroups" -if test "x$ac_cv_func_getgroups" = xyes -then : - printf "%s\n" "#define HAS_GETGROUPS 1" >>confdefs.h +printf "%s\n" "#define HAS_SYMLINK 1" >>confdefs.h fi - -## setgroups -ac_fn_c_check_func "$LINENO" "setgroups" "ac_cv_func_setgroups" -if test "x$ac_cv_func_setgroups" = xyes -then : - printf "%s\n" "#define HAS_SETGROUPS 1" >>confdefs.h - fi - -## initgroups -ac_fn_c_check_func "$LINENO" "initgroups" "ac_cv_func_initgroups" -if test "x$ac_cv_func_initgroups" = xyes -then : - printf "%s\n" "#define HAS_INITGROUPS 1" >>confdefs.h - fi @@ -20457,11 +19034,8 @@ then : ac_fn_c_check_func "$LINENO" "tcflow" "ac_cv_func_tcflow" if test "x$ac_cv_func_tcflow" = xyes then : - printf "%s\n" "#define HAS_TERMIOS 1" >>confdefs.h -fi - -fi +printf "%s\n" "#define HAS_TERMIOS 1" >>confdefs.h fi @@ -20471,38 +19045,19 @@ fi fi +fi -## setitimer - -ac_fn_c_check_func "$LINENO" "setitimer" "ac_cv_func_setitimer" -if test "x$ac_cv_func_setitimer" = xyes -then : - - setitimer=true - printf "%s\n" "#define HAS_SETITIMER 1" >>confdefs.h - - -else $as_nop - setitimer=false fi ## gethostname -# Note: detection fails on Windows so hardcoding the result -# (should be debugged later) -case $target in #( - *-w64-mingw32*|*-pc-windows) : - printf "%s\n" "#define HAS_GETHOSTNAME 1" >>confdefs.h - ;; #( - *) : - ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname" +ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname" if test "x$ac_cv_func_gethostname" = xyes then : - printf "%s\n" "#define HAS_GETHOSTNAME 1" >>confdefs.h + printf "%s\n" "#define HAVE_GETHOSTNAME 1" >>confdefs.h fi - ;; -esac + ## uname @@ -20512,35 +19067,10 @@ then : ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" if test "x$ac_cv_func_uname" = xyes then : - printf "%s\n" "#define HAS_UNAME 1" >>confdefs.h - -fi - -fi - - -## gettimeofday - -ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" -if test "x$ac_cv_func_gettimeofday" = xyes -then : - - gettimeofday=true - printf "%s\n" "#define HAS_GETTIMEOFDAY 1" >>confdefs.h - + printf "%s\n" "#define HAVE_UNAME 1" >>confdefs.h -else $as_nop - gettimeofday=false fi - -## mktime - -ac_fn_c_check_func "$LINENO" "mktime" "ac_cv_func_mktime" -if test "x$ac_cv_func_mktime" = xyes -then : - printf "%s\n" "#define HAS_MKTIME 1" >>confdefs.h - fi @@ -20553,22 +19083,12 @@ case $target in #( ac_fn_c_check_func "$LINENO" "setsid" "ac_cv_func_setsid" if test "x$ac_cv_func_setsid" = xyes then : - printf "%s\n" "#define HAS_SETSID 1" >>confdefs.h + printf "%s\n" "#define HAVE_SETSID 1" >>confdefs.h fi ;; esac -## putenv - -ac_fn_c_check_func "$LINENO" "putenv" "ac_cv_func_putenv" -if test "x$ac_cv_func_putenv" = xyes -then : - printf "%s\n" "#define HAS_PUTENV 1" >>confdefs.h - -fi - - ## setenv and unsetenv ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv" @@ -20577,7 +19097,8 @@ then : ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" if test "x$ac_cv_func_unsetenv" = xyes then : - printf "%s\n" "#define HAS_SETENV_UNSETENV 1" >>confdefs.h + +printf "%s\n" "#define HAS_SETENV_UNSETENV 1" >>confdefs.h fi @@ -20589,7 +19110,8 @@ fi # (should be debugged later) case $target in #( *-pc-windows) : - printf "%s\n" "#define HAS_LOCALE_H 1" >>confdefs.h + +printf "%s\n" "#define HAS_LOCALE_H 1" >>confdefs.h ;; #( *) : ac_fn_c_check_header_compile "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" @@ -20604,7 +19126,8 @@ then : ac_fn_c_check_func "$LINENO" "uselocale" "ac_cv_func_uselocale" if test "x$ac_cv_func_uselocale" = xyes then : - printf "%s\n" "#define HAS_LOCALE_H 1" >>confdefs.h + +printf "%s\n" "#define HAS_LOCALE_H 1" >>confdefs.h fi @@ -20628,7 +19151,8 @@ then : ac_fn_c_check_func "$LINENO" "uselocale" "ac_cv_func_uselocale" if test "x$ac_cv_func_uselocale" = xyes then : - printf "%s\n" "#define HAS_XLOCALE_H 1" >>confdefs.h + +printf "%s\n" "#define HAS_XLOCALE_H 1" >>confdefs.h fi @@ -20644,13 +19168,14 @@ fi # (should be debugged later) case $target in #( *-pc-windows) : - printf "%s\n" "#define HAS_STRTOD_L 1" >>confdefs.h + +printf "%s\n" "#define HAVE_STRTOD_L 1" >>confdefs.h ;; #( *) : ac_fn_c_check_func "$LINENO" "strtod_l" "ac_cv_func_strtod_l" if test "x$ac_cv_func_strtod_l" = xyes then : - printf "%s\n" "#define HAS_STRTOD_L 1" >>confdefs.h + printf "%s\n" "#define HAVE_STRTOD_L 1" >>confdefs.h fi ;; @@ -20721,7 +19246,8 @@ if $supports_shared_libraries then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Dynamic loading of shared libraries is supported." >&5 printf "%s\n" "$as_me: Dynamic loading of shared libraries is supported." >&6;} - printf "%s\n" "#define SUPPORT_DYNAMIC_LINKING 1" >>confdefs.h + +printf "%s\n" "#define SUPPORT_DYNAMIC_LINKING 1" >>confdefs.h else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Dynamic loading of shared libraries is not supported." >&5 @@ -20739,22 +19265,13 @@ then : ac_fn_c_check_func "$LINENO" "munmap" "ac_cv_func_munmap" if test "x$ac_cv_func_munmap" = xyes then : - printf "%s\n" "#define HAS_MMAP 1" >>confdefs.h -fi +printf "%s\n" "#define HAS_MMAP 1" >>confdefs.h fi fi - -## pwrite - -ac_fn_c_check_func "$LINENO" "pwrite" "ac_cv_func_pwrite" -if test "x$ac_cv_func_pwrite" = xyes -then : - printf "%s\n" "#define HAS_PWRITE 1" >>confdefs.h - fi @@ -21070,10 +19587,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu case $ac_cv_func_which_gethostbyname_r in #( six) : - printf "%s\n" "#define HAS_GETHOSTBYNAME_R 6" >>confdefs.h + +printf "%s\n" "#define HAS_GETHOSTBYNAME_R 6" >>confdefs.h ;; #( five) : - printf "%s\n" "#define HAS_GETHOSTBYNAME_R 5" >>confdefs.h + +printf "%s\n" "#define HAS_GETHOSTBYNAME_R 5" >>confdefs.h ;; #( three) : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: OCaml does not support this variant" >&5 @@ -21258,102 +19777,34 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu case $ac_cv_func_which_gethostbyaddr_r in #( eight) : - printf "%s\n" "#define HAS_GETHOSTBYADDR_R 8" >>confdefs.h + +printf "%s\n" "#define HAS_GETHOSTBYADDR_R 8" >>confdefs.h ;; #( seven) : - printf "%s\n" "#define HAS_GETHOSTBYADDR_R 7" >>confdefs.h + +printf "%s\n" "#define HAS_GETHOSTBYADDR_R 7" >>confdefs.h ;; #( *) : ;; esac -## mkstemp - -ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp" -if test "x$ac_cv_func_mkstemp" = xyes -then : - printf "%s\n" "#define HAS_MKSTEMP 1" >>confdefs.h - -fi - - -## nice - -ac_fn_c_check_func "$LINENO" "nice" "ac_cv_func_nice" -if test "x$ac_cv_func_nice" = xyes -then : - printf "%s\n" "#define HAS_NICE 1" >>confdefs.h - -fi - - -## dup3 - -ac_fn_c_check_func "$LINENO" "dup3" "ac_cv_func_dup3" -if test "x$ac_cv_func_dup3" = xyes -then : - printf "%s\n" "#define HAS_DUP3 1" >>confdefs.h - -fi - - -## pipe2 - -ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" -if test "x$ac_cv_func_pipe2" = xyes -then : - printf "%s\n" "#define HAS_PIPE2 1" >>confdefs.h - -fi - - -## accept4 - -ac_fn_c_check_func "$LINENO" "accept4" "ac_cv_func_accept4" -if test "x$ac_cv_func_accept4" = xyes -then : - printf "%s\n" "#define HAS_ACCEPT4 1" >>confdefs.h - -fi - - -## getauxval - -ac_fn_c_check_func "$LINENO" "getauxval" "ac_cv_func_getauxval" -if test "x$ac_cv_func_getauxval" = xyes -then : - printf "%s\n" "#define HAS_GETAUXVAL 1" >>confdefs.h - -fi - - ## shmat -ac_fn_c_check_header_compile "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "$ac_includes_default" + for ac_header in sys/shm.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "$ac_includes_default" if test "x$ac_cv_header_sys_shm_h" = xyes then : - - printf "%s\n" "#define HAS_SYS_SHM_H 1" >>confdefs.h - - ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" + printf "%s\n" "#define HAVE_SYS_SHM_H 1" >>confdefs.h + ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes then : - printf "%s\n" "#define HAS_SHMAT 1" >>confdefs.h - -fi - + printf "%s\n" "#define HAVE_SHMAT 1" >>confdefs.h fi - -## execvpe - -ac_fn_c_check_func "$LINENO" "execvpe" "ac_cv_func_execvpe" -if test "x$ac_cv_func_execvpe" = xyes -then : - printf "%s\n" "#define HAS_EXECVPE 1" >>confdefs.h - fi +done ## posix_spawn @@ -21366,7 +19817,8 @@ then : ac_fn_c_check_func "$LINENO" "posix_spawnp" "ac_cv_func_posix_spawnp" if test "x$ac_cv_func_posix_spawnp" = xyes then : - printf "%s\n" "#define HAS_POSIX_SPAWN 1" >>confdefs.h + +printf "%s\n" "#define HAS_POSIX_SPAWN 1" >>confdefs.h fi @@ -21834,7 +20286,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: compressed compilation artefacts supported" >&5 printf "%s\n" "$as_me: compressed compilation artefacts supported" >&6;} internal_cppflags="$internal_cppflags $zstd_flags" - printf "%s\n" "#define HAS_ZSTD 1" >>confdefs.h + +printf "%s\n" "#define HAS_ZSTD 1" >>confdefs.h else $as_nop case "$with_zstd" in #( @@ -22715,7 +21168,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _GNU_SOURCE #include - #ifdef HAS_PTHREAD_NP_H + #ifdef HAVE_PTHREAD_NP_H #include #endif #include @@ -22734,7 +21187,8 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: GNU" >&5 printf "%s\n" "GNU" >&6; } - printf "%s\n" "#define HAS_GNU_GETAFFINITY_NP 1" >>confdefs.h + +printf "%s\n" "#define HAS_GNU_GETAFFINITY_NP 1" >>confdefs.h else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22758,7 +21212,8 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: BSD" >&5 printf "%s\n" "BSD" >&6; } - printf "%s\n" "#define HAS_BSD_GETAFFINITY_NP 1" >>confdefs.h + +printf "%s\n" "#define HAS_BSD_GETAFFINITY_NP 1" >>confdefs.h else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: pthread_getaffinity_np not found" >&5 @@ -22770,49 +21225,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -## prctl - - for ac_func in prctl -do : - ac_fn_c_check_func "$LINENO" "prctl" "ac_cv_func_prctl" -if test "x$ac_cv_func_prctl" = xyes -then : - printf "%s\n" "#define HAVE_PRCTL 1" >>confdefs.h - printf "%s\n" "#define HAS_PRCTL 1" >>confdefs.h - -fi - -done - -## pthread_setname_np - - for ac_func in pthread_setname_np -do : - ac_fn_c_check_func "$LINENO" "pthread_setname_np" "ac_cv_func_pthread_setname_np" -if test "x$ac_cv_func_pthread_setname_np" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_SETNAME_NP 1" >>confdefs.h - printf "%s\n" "#define HAS_PTHREAD_SETNAME_NP 1" >>confdefs.h - -fi - -done - -## pthread_set_name_np - - for ac_func in pthread_set_name_np -do : - ac_fn_c_check_func "$LINENO" "pthread_set_name_np" "ac_cv_func_pthread_set_name_np" -if test "x$ac_cv_func_pthread_set_name_np" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_SET_NAME_NP 1" >>confdefs.h - printf "%s\n" "#define HAS_PTHREAD_SET_NAME_NP 1" >>confdefs.h - -fi - -done - ## SetThreadDescription +case $target in #( + *-mingw*|*-windows) : for ac_func in SetThreadDescription do : @@ -22820,20 +21235,24 @@ do : if test "x$ac_cv_func_SetThreadDescription" = xyes then : printf "%s\n" "#define HAVE_SETTHREADDESCRIPTION 1" >>confdefs.h - printf "%s\n" "#define HAS_SETTHREADDESCRIPTION 1" >>confdefs.h - - ac_fn_check_decl "$LINENO" "SetThreadDescription" "ac_cv_have_decl_SetThreadDescription" "#define WIN32_LEAN_AND_MEAN - #include - #include + ac_fn_check_decl "$LINENO" "SetThreadDescription" "ac_cv_have_decl_SetThreadDescription" "#define WIN32_LEAN_AND_MEAN +#include +#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_SetThreadDescription" = xyes then : - printf "%s\n" "#define HAS_DECL_SETTHREADDESCRIPTION 1" >>confdefs.h - + ac_have_decl=1 +else $as_nop + ac_have_decl=0 fi +printf "%s\n" "#define HAVE_DECL_SETTHREADDESCRIPTION $ac_have_decl" >>confdefs.h + fi -done +done ;; #( + *) : + ;; +esac ## Activate the systhread library @@ -22868,7 +21287,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the assembler supports --debug-prefix-map" >&5 printf %s "checking whether the assembler supports --debug-prefix-map... " >&6; } - +if test ${ocaml_cv_prog_as_debug_prefix_map+y} +then : + printf %s "(cached) " >&6 +else $as_nop saved_CC="$CC" saved_CFLAGS="$CFLAGS" @@ -22882,14 +21304,14 @@ printf %s "checking whether the assembler supports --debug-prefix-map... " >&6; touch confdefs.h - # Modify C-compiler variables to use the assembler - CC="$AS" - CFLAGS="--debug-prefix-map old=new -o conftest.$ac_objext" - CPPFLAGS="" - ac_ext="S" - ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + # Modify C-compiler variables to use the assembler + CC="$AS" + CFLAGS="--debug-prefix-map old=new -o conftest.$ac_objext" + CPPFLAGS="" + ac_ext="S" + ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ camlPervasives__loop_1128: @@ -22899,13 +21321,9 @@ camlPervasives__loop_1128: _ACEOF if ac_fn_c_try_compile "$LINENO" then : - as_has_debug_prefix_map=true - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + ocaml_cv_prog_as_debug_prefix_map=true else $as_nop - as_has_debug_prefix_map=false - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + ocaml_cv_prog_as_debug_prefix_map=false fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -22919,15 +21337,21 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CC="$saved_CC" LIBS="$saved_LIBS" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_prog_as_debug_prefix_map" >&5 +printf "%s\n" "$ocaml_cv_prog_as_debug_prefix_map" >&6; } + as_has_debug_prefix_map=$ocaml_cv_prog_as_debug_prefix_map { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the assembler supports CFI directives" >&5 printf %s "checking whether the assembler supports CFI directives... " >&6; } - +if test ${ocaml_cv_prog_as_cfi_directives+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test x"$enable_cfi" = "xno" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -printf "%s\n" "disabled" >&6; } + ocaml_cv_prog_as_cfi_directives='disabled' else $as_nop saved_CC="$CC" @@ -22942,22 +21366,22 @@ else $as_nop touch confdefs.h - # Modify C-compiler variables to use the assembler - CC="$ASPP" - CFLAGS="-o conftest.$ac_objext" - CPPFLAGS="" - ac_ext="S" - ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + # Modify C-compiler variables to use the assembler + CC="$ASPP" + CFLAGS="-o conftest.$ac_objext" + CPPFLAGS="" + ac_ext="S" + ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -camlPervasives__loop_1128: - .file 1 "pervasives.ml" - .loc 1 193 - .cfi_startproc - .cfi_adjust_cfa_offset 8 - .cfi_endproc + camlPervasives__loop_1128: + .file 1 "pervasives.ml" + .loc 1 193 + .cfi_startproc + .cfi_adjust_cfa_offset 8 + .cfi_endproc _ACEOF if ac_fn_c_try_compile "$LINENO" @@ -22968,13 +21392,13 @@ else $as_nop fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - if test "$AS" = "$ASPP" + if test "$AS" = "$ASPP" then : as_ok="$aspp_ok" else $as_nop CC="$AS" - ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ camlPervasives__loop_1128: @@ -23005,28 +21429,33 @@ fi LIBS="$saved_LIBS" - if $aspp_ok && $as_ok + if $aspp_ok && $as_ok then : - asm_cfi_supported=true - printf "%s\n" "#define ASM_CFI_SUPPORTED 1" >>confdefs.h - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + ocaml_cv_prog_as_cfi_directives='yes' else $as_nop if test x"$enable_cfi" = "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: requested but not available - as_fn_error $? "exiting" "$LINENO" 5" >&5 -printf "%s\n" "requested but not available - as_fn_error $? "exiting" "$LINENO" 5" >&6; } + ocaml_cv_prog_as_cfi_directives='requested but not available' else $as_nop - asm_cfi_supported=false - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + ocaml_cv_prog_as_cfi_directives='no' +fi fi fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_prog_as_cfi_directives" >&5 +printf "%s\n" "$ocaml_cv_prog_as_cfi_directives" >&6; } + case $ocaml_cv_prog_as_cfi_directives in #( + yes) : + asm_cfi_supported=true -fi ;; +printf "%s\n" "#define ASM_CFI_SUPPORTED 1" >>confdefs.h + ;; #( + no|disabled) : + asm_cfi_supported=false ;; #( + *) : + as_fn_error $? "exiting" "$LINENO" 5 ;; +esac + ;; esac fi @@ -23040,7 +21469,8 @@ then : clang-*|gcc-*) : common_cflags="$common_cflags -g -fno-omit-frame-pointer" frame_pointers=true - printf "%s\n" "#define WITH_FRAME_POINTERS 1" >>confdefs.h + +printf "%s\n" "#define WITH_FRAME_POINTERS 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using frame pointers" >&5 printf "%s\n" "$as_me: using frame pointers" >&6;} ;; #( @@ -23062,10 +21492,13 @@ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mmap supports huge pages" >&5 printf %s "checking whether mmap supports huge pages... " >&6; } +if test ${ocaml_cv_func_mmap_huge_pages+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "$cross_compiling" = yes then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no assumed" >&5 -printf "%s\n" "no assumed" >&6; } + ocaml_cv_func_mmap_huge_pages='no assumed' else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -23114,20 +21547,27 @@ main (void) _ACEOF if ac_fn_c_try_run "$LINENO" then : - printf "%s\n" "#define HAS_HUGE_PAGES 1" >>confdefs.h - - printf "%s\n" "#define HUGE_PAGE_SIZE (4 * 1024 * 1024)" >>confdefs.h - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + ocaml_cv_func_mmap_huge_pages=yes else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + ocaml_cv_func_mmap_huge_pages=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_func_mmap_huge_pages" >&5 +printf "%s\n" "$ocaml_cv_func_mmap_huge_pages" >&6; } + if test "x$ocaml_cv_prog_cc_func_mmap_huge_pages" = xyes +then : + +printf "%s\n" "#define HAS_HUGE_PAGES 1" >>confdefs.h + + +printf "%s\n" "#define HUGE_PAGE_SIZE (4 * 1024 * 1024)" >>confdefs.h + +fi + printf "%s\n" "#define HEADER_RESERVED_BITS $reserved_header_bits" >>confdefs.h @@ -23250,31 +21690,36 @@ fi test -n "$DIFF" && break done -test -n "$DIFF" || DIFF="none" +test -n "$DIFF" || DIFF="as_fn_error $? "ocamltest requires a diff tool" "$LINENO" 5" - DIFF_FLAGS="" - flags="" case $DIFF in #( diff) : - flags="--strip-trailing-cr -u" ;; #( - none) : - as_fn_error $? "ocamltest requires a diff tool" "$LINENO" 5 ;; #( - *) : - ;; -esac - for flag in ${flags}; do - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $DIFF supports $flag" >&5 -printf %s "checking whether $DIFF supports $flag... " >&6; }; - if $DIFF $DIFF_FLAGS $flag $0 $0 > /dev/null 2>&1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for extra $DIFF flags" >&5 +printf %s "checking for extra $DIFF flags... " >&6; } +if test ${ocaml_cv_prog_diff_flags+y} then : - DIFF_FLAGS="$DIFF_FLAGS $flag" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + printf %s "(cached) " >&6 else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + flags="" + for flag in -u --strip-trailing-cr; do + "$DIFF" $flag /dev/zero /dev/zero >/dev/null 2>&1 && \ + flags="${flags:+$flags }$flag" + done + ocaml_cv_prog_diff_flags="${flags:-none needed}" fi - done +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_prog_diff_flags" >&5 +printf "%s\n" "$ocaml_cv_prog_diff_flags" >&6; } + if test "x$ocaml_cv_prog_diff_flags" = x'none needed' +then : + DIFF_FLAGS="" + +else $as_nop + DIFF_FLAGS=$ocaml_cv_prog_diff_flags + +fi ;; #( + *) : + ;; +esac fi if test x"$enable_flambda" = "xyes" @@ -23311,7 +21756,8 @@ if test x"$enable_flat_float_array" = "xno" then : flat_float_array=false else $as_nop - printf "%s\n" "#define FLAT_FLOAT_ARRAY 1" >>confdefs.h + +printf "%s\n" "#define FLAT_FLOAT_ARRAY 1" >>confdefs.h flat_float_array=true fi @@ -23319,10 +21765,13 @@ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mmap supports MAP_STACK" >&5 printf %s "checking whether mmap supports MAP_STACK... " >&6; } +if test ${ocaml_cv_func_mmap_MAP_STACK+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "$cross_compiling" = yes then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no assumed" >&5 -printf "%s\n" "no assumed" >&6; } + ocaml_cv_func_mmap_MAP_STACK='no assumed' else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -23348,45 +21797,45 @@ main (void) _ACEOF if ac_fn_c_try_run "$LINENO" then : - has_mmap_map_stack=true - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + ocaml_cv_func_mmap_MAP_STACK=yes else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + ocaml_cv_func_mmap_MAP_STACK=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_func_mmap_MAP_STACK" >&5 +printf "%s\n" "$ocaml_cv_func_mmap_MAP_STACK" >&6; } if test x"$enable_mmap_map_stack" = "xyes" then : - if test x"$has_mmap_map_stack" = "xtrue" + if test x"$ocaml_cv_func_mmap_MAP_STACK" = "xyes" then : case $target in #( *-freebsd*) : - as_fn_error $? "mmap MAP_STACK not supported on FreeBSD" "$LINENO" 5 ;; #( + as_fn_error $? "mmap MAP_STACK is not supported on FreeBSD" "$LINENO" 5 ;; #( *) : - with_mmap_map_stack=true; - printf "%s\n" "#define USE_MMAP_MAP_STACK 1" >>confdefs.h - ;; + ;; esac else $as_nop as_fn_error $? "mmap MAP_STACK requested but not found on $target" "$LINENO" 5 fi - else $as_nop case $target in #( *-openbsd*) : - with_mmap_map_stack=true; - printf "%s\n" "#define USE_MMAP_MAP_STACK 1" >>confdefs.h - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using MAP_STACK on OpenBSD due to stack checking" >&5 -printf "%s\n" "$as_me: using MAP_STACK on OpenBSD due to stack checking" >&6;} ;; #( + ocaml_cv_func_mmap_MAP_STACK=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Using MAP_STACK on OpenBSD due to stack checking" >&5 +printf "%s\n" "$as_me: Using MAP_STACK on OpenBSD due to stack checking" >&6;} ;; #( *) : - with_mmap_map_stack=false ;; + ;; esac +fi +if test x"$ocaml_cv_func_mmap_MAP_STACK" = "xyes" +then : + +printf "%s\n" "#define USE_MMAP_MAP_STACK 1" >>confdefs.h fi @@ -23422,7 +21871,8 @@ printf "%s\n" "$as_me: Function sections are not supported function_sections=true; oc_native_compflags='-function-sections' internal_cflags="$internal_cflags -ffunction-sections"; - printf "%s\n" "#define FUNCTION_SECTIONS 1" >>confdefs.h + +printf "%s\n" "#define FUNCTION_SECTIONS 1" >>confdefs.h ;; #( *) : function_sections=false; @@ -23532,33 +21982,36 @@ else $as_nop esac fi -# Define a few macros that were defined in config/m-nt.h -# but whose value is not guessed properly by configure -# (all this should be understood and fixed) +# Define a few macros that were defined in config/m-nt.h but which values are +# not guessed properly by configure (all this should be understood and fixed) +have_broken_printf=false case $target in #( *-w64-mingw32*) : - printf "%s\n" "#define HAS_BROKEN_PRINTF 1" >>confdefs.h - - printf "%s\n" "#define HAS_IPV6 1" >>confdefs.h - - printf "%s\n" "#define HAS_NICE 1" >>confdefs.h - ;; #( + have_broken_printf=true + have_ipv6=true ;; #( *-pc-windows) : - printf "%s\n" "#define HAS_BROKEN_PRINTF 1" >>confdefs.h - - printf "%s\n" "#define HAS_IPV6 1" >>confdefs.h - - printf "%s\n" "#define HAS_NICE 1" >>confdefs.h - ;; #( + have_broken_printf=true + have_ipv6=true ;; #( *-*-solaris*) : - # This is required as otherwise floats are printed - # as "Infinity" and "Inf" instead of the expected "inf" - printf "%s\n" "#define HAS_BROKEN_PRINTF 1" >>confdefs.h - ;; #( + have_broken_printf=true ;; #( *) : ;; esac +if ${have_broken_printf} +then : + +printf "%s\n" "#define HAVE_BROKEN_PRINTF 1" >>confdefs.h + +fi + +if $have_ipv6 +then : + +printf "%s\n" "#define HAVE_IPV6 1" >>confdefs.h + +fi + # Do not permanently cache the result of flexdll.h unset ac_cv_header_flexdll_h @@ -24707,9 +23160,8 @@ do "otherlibs/dynlink/dynlink_config.ml") CONFIG_FILES="$CONFIG_FILES otherlibs/dynlink/dynlink_config.ml" ;; "utils/config.common.ml") CONFIG_FILES="$CONFIG_FILES utils/config.common.ml" ;; "utils/config.generated.ml") CONFIG_FILES="$CONFIG_FILES utils/config.generated.ml" ;; + "runtime/caml/config.h") CONFIG_HEADERS="$CONFIG_HEADERS runtime/caml/config.h" ;; "runtime/caml/exec.h") CONFIG_HEADERS="$CONFIG_HEADERS runtime/caml/exec.h" ;; - "runtime/caml/m.h") CONFIG_HEADERS="$CONFIG_HEADERS runtime/caml/m.h" ;; - "runtime/caml/s.h") CONFIG_HEADERS="$CONFIG_HEADERS runtime/caml/s.h" ;; "runtime/caml/version.h") CONFIG_HEADERS="$CONFIG_HEADERS runtime/caml/version.h" ;; "compilerlibs/META") CONFIG_FILES="$CONFIG_FILES compilerlibs/META" ;; "otherlibs/dynlink/META") CONFIG_FILES="$CONFIG_FILES otherlibs/dynlink/META" ;; diff --git a/configure.ac b/configure.ac index 9758cadd394b..e20c8205871b 100644 --- a/configure.ac +++ b/configure.ac @@ -105,11 +105,11 @@ AC_SUBST([OCAML_VERSION_MINOR], [OCAML__VERSION_MINOR]) AC_SUBST([OCAML_VERSION_PATCHLEVEL], [OCAML__VERSION_PATCHLEVEL]) AC_SUBST([OCAML_VERSION_EXTRA], [OCAML__VERSION_EXTRA]) AC_SUBST([OCAML_VERSION_SHORT], [OCAML__VERSION_SHORT]) -AC_DEFINE([MAGIC_NUMBER_PREFIX], ["][MAGIC_NUMBER__PREFIX]["]) -AC_DEFINE([MAGIC_NUMBER_VERSION], ["][MAGIC_NUMBER__VERSION]["]) -AC_DEFINE([EXEC_MAGIC_LENGTH], [MAGIC_NUMBER__LENGTH]) +AC_DEFINE([MAGIC_NUMBER_PREFIX], ["][MAGIC_NUMBER__PREFIX]["], [TODO]) +AC_DEFINE([MAGIC_NUMBER_VERSION], ["][MAGIC_NUMBER__VERSION]["], [TODO]) +AC_DEFINE([EXEC_MAGIC_LENGTH], [MAGIC_NUMBER__LENGTH], [TODO]) AC_SUBST([MAGIC_LENGTH], [MAGIC_NUMBER__LENGTH]) -AC_DEFINE([EXEC_FORMAT], ["][EXEC__FORMAT]["]) +AC_DEFINE([EXEC_FORMAT], ["][EXEC__FORMAT]["], [TODO]) AC_SUBST([EXEC_MAGIC_NUMBER], [EXEC__MAGIC_NUMBER]) AC_SUBST([CMI_MAGIC_NUMBER], [CMI__MAGIC_NUMBER]) AC_SUBST([CMO_MAGIC_NUMBER], [CMO__MAGIC_NUMBER]) @@ -125,7 +125,6 @@ AC_SUBST([CC]) AC_SUBST([SAK_BUILD]) AC_SUBST([SAK]) AC_SUBST([encode_C_literal]) -AC_SUBST([DIFF_FLAGS]) AC_SUBST([CSC]) AC_SUBST([CSCFLAGS]) # Note: This is present for the flexdll bootstrap where it exposed as the old @@ -228,7 +227,6 @@ AC_SUBST([ocamltest]) AC_SUBST([ocamltest_target]) AC_SUBST([ocamltest_opt_target]) AC_SUBST([ASPP]) -AC_SUBST([endianness]) AC_SUBST([AS]) AC_SUBST([asm_cfi_supported]) AC_SUBST([asm_size_type_directives]) @@ -275,9 +273,13 @@ AC_CONFIG_FILES([ocamltest/ocamltest_config.ml]) AC_CONFIG_FILES([otherlibs/dynlink/dynlink_config.ml]) AC_CONFIG_FILES([utils/config.common.ml]) AC_CONFIG_FILES([utils/config.generated.ml]) +AC_CONFIG_HEADERS([runtime/caml/config.h]) +AH_TOP([[#ifndef CAML_CONFIG_H +#define CAML_CONFIG_H]]) +AH_BOTTOM([[#include "conf_post.h" + +#endif /* CAML_CONFIG_H */]]) AC_CONFIG_HEADERS([runtime/caml/exec.h]) -AC_CONFIG_HEADERS([runtime/caml/m.h]) -AC_CONFIG_HEADERS([runtime/caml/s.h]) AC_CONFIG_HEADERS([runtime/caml/version.h]) AC_CONFIG_FILES([compilerlibs/META]) AC_CONFIG_FILES([otherlibs/dynlink/META]) @@ -285,14 +287,14 @@ AC_CONFIG_FILES([otherlibs/runtime_events/META]) AC_CONFIG_FILES([stdlib/META]) # Definitions related to the version of OCaml -AC_DEFINE([OCAML_VERSION_MAJOR], [OCAML__VERSION_MAJOR]) -AC_DEFINE([OCAML_VERSION_MINOR], [OCAML__VERSION_MINOR]) -AC_DEFINE([OCAML_VERSION_PATCHLEVEL], [OCAML__VERSION_PATCHLEVEL]) +AC_DEFINE([OCAML_VERSION_MAJOR], [OCAML__VERSION_MAJOR], [TODO]) +AC_DEFINE([OCAML_VERSION_MINOR], [OCAML__VERSION_MINOR], [TODO]) +AC_DEFINE([OCAML_VERSION_PATCHLEVEL], [OCAML__VERSION_PATCHLEVEL], [TODO]) m4_if([OCAML__VERSION_EXTRA],[], [], - [AC_DEFINE([OCAML_VERSION_ADDITIONAL], ["][OCAML__VERSION_EXTRA]["]) - AC_DEFINE([OCAML_VERSION_EXTRA], ["][OCAML__VERSION_EXTRA]["])]) -AC_DEFINE([OCAML_VERSION], [OCAML__VERSION_NUMBER]) -AC_DEFINE([OCAML_VERSION_STRING], ["][OCAML__VERSION]["]) + [AC_DEFINE([OCAML_VERSION_ADDITIONAL], ["][OCAML__VERSION_EXTRA]["], [TODO]) + AC_DEFINE([OCAML_VERSION_EXTRA], ["][OCAML__VERSION_EXTRA]["], [TODO])]) +AC_DEFINE([OCAML_VERSION], [OCAML__VERSION_NUMBER], [TODO]) +AC_DEFINE([OCAML_VERSION_STRING], ["][OCAML__VERSION]["], [TODO]) # Works out how many "o"s are needed in quoted strings AC_CONFIG_COMMANDS_PRE(OCAML_QUOTED_STRING_ID) @@ -1125,13 +1127,14 @@ AS_CASE([$flexdll_source_dir,$supports_shared_libraries,$flexlink,$target], mkexe_cmd_exp="$CC" +have_arch_code32=false AS_CASE([$ocaml_cc_vendor,$target], [*,x86_64-*-darwin*], [oc_ldflags='-Wl,-no_compact_unwind'; - AC_DEFINE([HAS_ARCH_CODE32], [1])], + have_arch_code32=true], [*,aarch64-*-darwin*|*,arm64-*-darwin*], - AC_DEFINE([HAS_ARCH_CODE32], [1]), - [*,*-*-cygwin], + [have_arch_code32=true], + [*,*-*-cygwin*], [common_cppflags="$common_cppflags -U_WIN32" AS_IF([$supports_shared_libraries], [mkexe_cmd_exp="flexlink -exe -chain ${flexdll_chain} ${flexlink_flags}" @@ -1163,37 +1166,18 @@ AS_CASE([$ocaml_cc_vendor,$target], mkexe_extra_flags="$mkexe_ldflags_prefix$oc_exe_ldflags" mkexedebugflag=''], [*,x86_64-*-linux*], - AC_DEFINE([HAS_ARCH_CODE32], [1]), + [have_arch_code32=true], [xlc-*,powerpc-ibm-aix*], [oc_ldflags='-brtl -bexpfull' - AC_DEFINE([HAS_ARCH_CODE32], [1])], + have_arch_code32=true], [gcc-*,powerpc-*-linux*], [oc_ldflags="-mbss-plt"]) -# How to build sak - -AS_IF([test x"$build" = x"$target" -o x"$target_runnable" = xtrue], - [AS_CASE([$target], - [*-pc-windows], - [SAK_BUILD=m4_normalize([ - "\$(CC) \$(OC_CFLAGS) \$(CFLAGS) \$(OC_CPPFLAGS) \$(CPPFLAGS) \$(2) - /link /out:\$(1) $oc_exe_ldflags \$(OC_LDFLAGS) \$(LDFLAGS)"])], - [SAK_BUILD=m4_normalize([ - '$(MKEXE_VIA_CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(CPPFLAGS)'])]) - SAK="\$(ROOTDIR)/runtime/sak${EXEEXT}"], - [AC_MSG_NOTICE([detecting the C toolchain for build]) - AX_PROG_CC_FOR_BUILD - # Note that *-pc-windows is not supported for _build_ so we can use '-o' - SAK_BUILD=m4_normalize(["$CC_FOR_BUILD $LDFLAGS_FOR_BUILD -o \$(1) \$(2) - $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD"]) - SAK="\$(ROOTDIR)/runtime/sak${BUILD_EXEEXT}"]) - -# sak command to use to encode C literal strings - -AS_CASE([$target], - [*-w64-mingw32*|*-pc-windows], - [encode_C_literal="encode-C-utf16-literal"], - [encode_C_literal="encode-C-utf8-literal"]) +AS_IF([${have_arch_code32}], + [AC_DEFINE([HAVE_ARCH_CODE32], [1], [Define HAVE_ARCH_CODE32 if, on a 64-bit + machine, code pointers fit in 32 bits, i.e. the code segment resides in the + low 4G of the addressing space. + HAVE_ARCH_CODE32 is ignored on 32-bit machines.])]) # Winpthreads emulation library for the MSVC port AC_MSG_CHECKING([for winpthreads sources]) @@ -1247,18 +1231,12 @@ AC_SEARCH_LIBS([cos], [m], # Checks for header files -AC_CHECK_HEADER([pthread_np.h],[AC_DEFINE([HAS_PTHREAD_NP_H], [1])]) -AC_CHECK_HEADER([dirent.h], [AC_DEFINE([HAS_DIRENT], [1])], [], - [#include ]) - -AC_CHECK_HEADER([sys/select.h], [AC_DEFINE([HAS_SYS_SELECT_H], [1])], [], - [#include ]) +AC_CHECK_HEADERS_ONCE([pthread_np.h sys/mman.h]) -AC_CHECK_HEADER([sys/mman.h], [AC_DEFINE([HAS_SYS_MMAN_H], [1])]) +AC_CHECK_HEADERS([dirent.h sys/select.h], [], [], [#include ]) AS_CASE([$target], - [*-*-linux*], - [AC_CHECK_HEADER([linux/futex.h], [AC_DEFINE([HAS_LINUX_FUTEX_H])])]) + [*-*-linux*], [AC_CHECK_HEADERS([linux/futex.h])]) # Checks for types @@ -1280,7 +1258,7 @@ AS_IF( [bits=32; arch64=false], [test "x$ac_cv_sizeof_long_p" = "x8" ], [bits=64; arch64=true - AC_DEFINE([ARCH_SIXTYFOUR], [1])], + AC_DEFINE([ARCH_SIXTYFOUR], [1], [TODO])], [AC_MSG_ERROR([Neither 32 nor 64 bits architecture.])] ) @@ -1295,17 +1273,9 @@ AS_IF( [AC_MSG_ERROR([Sorry, we can't find a 64-bit integer type.])] ) -AC_DEFINE_UNQUOTED([SIZEOF_PTR], [$ac_cv_sizeof_long_p]) -AC_DEFINE_UNQUOTED([SIZEOF_LONGLONG], [$ac_cv_sizeof_long_long]) - AC_MSG_NOTICE([Target is a $bits bits architecture]) -AC_C_BIGENDIAN( - [ - AC_DEFINE([ARCH_BIG_ENDIAN], [1]) - [endianness="be"] - ], - [endianness="le"], +AC_C_BIGENDIAN([], [], [AC_MSG_ERROR([could not determine endianness.])], [AC_MSG_ERROR([unable to handle universal endianness])] ) @@ -1322,15 +1292,14 @@ AS_IF([! $arch64], [i686], [], [AS_IF([test "$ac_cv_alignof_double" -gt 4], [align_double=true - AC_DEFINE([ARCH_ALIGN_DOUBLE], [1])]) + AC_DEFINE([ARCH_ALIGN_DOUBLE], [1], [TODO])]) AS_IF([test "x$ac_cv_sizeof_long" = "x8" && test "$ac_cv_alignof_long" -gt 4], - [align_int64=true - AC_DEFINE([ARCH_ALIGN_INT64], [1])], + [align_int64=true], [AS_IF([test "x$ac_cv_sizeof_long_long" = "x8" && test "$ac_cv_alignof_long_long" -gt 4], - [align_int64=true - AC_DEFINE([ARCH_ALIGN_INT64], [1])])]) + [align_int64=true])]) + AS_IF([$align_int64], [AC_DEFINE([ARCH_ALIGN_INT64], [1], [TODO])]) ])]) AC_CHECK_TYPES([max_align_t], [], [], [[#include ]]) @@ -1343,25 +1312,14 @@ AS_IF([! $arch64], # Support for C11 atomic types -OCAML_CC_SUPPORTS_ATOMIC([], [$cclibs]) -AS_CASE([$cc_supports_atomic,$ocaml_cc_vendor], - [false,msvc-*], - [OCAML_CC_SUPPORTS_ATOMIC([-std:c11]) - AS_IF([$cc_supports_atomic], - [common_cflags="$common_cflags -std:c11"], - [OCAML_CC_SUPPORTS_ATOMIC([-std:c11 -experimental:c11atomics]) - AS_IF([$cc_supports_atomic], - [common_cflags="$common_cflags -std:c11 -experimental:c11atomics"]) -])]) -AS_IF([! $cc_supports_atomic], - [AC_MSG_FAILURE([C11 atomic support is required, use another C compiler])]) +OCAML_CC_C11_ATOMIC_CFLAGS([$cclibs]) # Full support for thread local storage # macOS and MinGW-w64 have problems with thread local storage accessed from DLLs AS_CASE([$target], [*-apple-darwin*|*-w64-mingw32*|*-pc-windows], [], - [AC_DEFINE([HAS_FULL_THREAD_VARIABLES], [1])] + [AC_DEFINE([HAS_FULL_THREAD_VARIABLES], [1], [TODO])] ) # Shared library support @@ -1649,7 +1607,7 @@ AS_CASE([$enable_native_toplevel,$natdynlink], [install_ocamlnat=true], [install_ocamlnat=false]) -AC_DEFINE_UNQUOTED([OCAML_OS_TYPE], ["$ostype"]) +AC_DEFINE_UNQUOTED([OCAML_OS_TYPE], ["$ostype"], [TODO]) target_os_type="$ostype" AS_IF([$cross_compiler], @@ -1741,7 +1699,7 @@ AS_CASE([$as_target,$ocaml_cc_vendor], AS_IF([test "$with_pic"], [fpic=true - AC_DEFINE([CAML_WITH_FPIC], [1]) + AC_DEFINE([CAML_WITH_FPIC], [1], [TODO]) internal_cflags="$internal_cflags $sharedlib_cflags" default_aspp="$default_aspp $sharedlib_cflags"], [fpic=false]) @@ -1759,6 +1717,12 @@ AS_CASE([$rlwrap,$system], # Checks for library functions +AC_CHECK_FUNCS_ONCE(m4_normalize([accept4 dup3 execvpe getauxval getcwd + getentropy getgroups getrusage gettimeofday inet_aton initgroups issetugid + lockf mkfifo mkstemp mktime nanosleep nice pipe2 prctl pthread_setname_np + pthread_set_name_np putenv pwrite realpath rewinddir secure_getenv + __secure_getenv setgroups setitimer system times utimes waitpid wait4])) + ## Check the semantics of signal handlers OCAML_SIGNAL_HANDLERS_SEMANTICS @@ -1769,7 +1733,7 @@ AC_CHECK_FUNCS(m4_normalize([expm1 log1p hypot fma exp2 log2 cbrt acosh asinh atanh erf erfc trunc round copysign]), [], [has_c99_float_ops=false]) AS_IF([$has_c99_float_ops], - [AC_DEFINE([HAS_C99_FLOAT_OPS], [1]) +[AC_DEFINE([HAS_C99_FLOAT_OPS], [1], [TODO]) # Check whether round works (known bug in mingw-w64) OCAML_C99_CHECK_ROUND # Check whether fma works (regressed in mingw-w64 8.0.0; and present but @@ -1779,30 +1743,6 @@ AS_IF([$has_c99_float_ops], [AC_MSG_ERROR(m4_normalize([C99 float ops unavailable, enable replacements with --enable-imprecise-c99-float-ops]))])]) -## getentropy -AC_CHECK_FUNC([getentropy], [AC_DEFINE([HAS_GETENTROPY], [1])]) - -## getrusage -AC_CHECK_FUNC([getrusage], [AC_DEFINE([HAS_GETRUSAGE], [1])]) - -## times -AC_CHECK_FUNC([times], [AC_DEFINE([HAS_TIMES], [1])]) - -## secure_getenv and __secure_getenv - -saved_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" - -AC_CHECK_FUNC([secure_getenv], - [AC_DEFINE([HAS_SECURE_GETENV], [1])], - [AC_CHECK_FUNC([__secure_getenv], [AC_DEFINE([HAS___SECURE_GETENV], [1])])]) - -CPPFLAGS="$saved_CPPFLAGS" - -## issetugid - -AC_CHECK_FUNC([issetugid], [AC_DEFINE([HAS_ISSETUGID], [1])]) - ## Checking for monotonic clock source ## On Windows MSVC, QueryPerformanceCounter and QueryPerformanceFrequency ## are always available. @@ -1816,7 +1756,7 @@ AS_CASE([$target], AC_CHECK_FUNCS([clock_gettime_nsec_np], [ has_monotonic_clock=true - AC_DEFINE([HAS_CLOCK_GETTIME_NSEC_NP], [1]) + AC_DEFINE([HAS_CLOCK_GETTIME_NSEC_NP], [1], [TODO]) ], [has_monotonic_clock=false])], [AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ @@ -1829,7 +1769,7 @@ AS_CASE([$target], ]])], [ has_monotonic_clock=true - AC_DEFINE([HAS_POSIX_MONOTONIC_CLOCK], [1]) + AC_DEFINE([HAS_POSIX_MONOTONIC_CLOCK], [1], [TODO]) ], [has_monotonic_clock=false]) ] @@ -2036,11 +1976,11 @@ AS_CASE([$target], [*-w64-mingw32*], [cclibs="$cclibs -lws2_32" AC_SEARCH_LIBS([socket], [ws2_32]) - AC_CHECK_FUNC([socketpair], [AC_DEFINE([HAS_SOCKETPAIR], [1])])], + AC_CHECK_FUNCS([socketpair])], [*-pc-windows], [cclibs="$cclibs ws2_32.lib" - AC_SEARCH_LIBS([socket], [ws2_32]) - AC_CHECK_FUNC([socketpair], [AC_DEFINE([HAS_SOCKETPAIR], [1])])], + OCAML_CL_SEARCH_LIBS([socket], [ws2_32]) + AC_CHECK_FUNCS([socketpair])], [*-*-haiku], [cclibs="$cclibs -lnetwork" AC_SEARCH_LIBS([socket], [network])], @@ -2056,36 +1996,32 @@ AS_CASE([$target], ] ) -AS_IF([$sockets], [AC_DEFINE([HAS_SOCKETS], [1])]) +AS_IF([$sockets], + [AC_DEFINE([HAVE_SOCKETS], [1], [Define if you have BSD sockets.])]) ## socklen_t AS_CASE([$target], [*-w64-mingw32*|*-pc-windows], - [AC_CHECK_TYPE([socklen_t], [AC_DEFINE([HAS_SOCKLEN_T], [1])], [], - [#include ])], - [AC_CHECK_TYPE([socklen_t], [AC_DEFINE([HAS_SOCKLEN_T], [1])], [], - [#include ])]) - -AC_CHECK_FUNC([inet_aton], [AC_DEFINE([HAS_INET_ATON], [1])]) + [AC_CHECK_TYPES([socklen_t], [], [], [#include ])], + [AC_CHECK_TYPES([socklen_t], [], [], [#include ])]) ## Unix domain sockets support on Windows AS_CASE([$target], [*-w64-mingw32*|*-pc-windows], - [AC_CHECK_HEADERS([afunix.h], [AC_DEFINE([HAS_AFUNIX_H], [1])], [], - [#include ])]) + [AC_CHECK_HEADERS([afunix.h], [], [], [#include ])]) ## IPv6 support -ipv6=true +have_ipv6=true AS_CASE([$target], [*-w64-mingw32*|*-pc-windows], [AC_CHECK_TYPE( - [struct sockaddr_in6], [], [ipv6=false], [#include ])], + [struct sockaddr_in6], [], [have_ipv6=false], [#include ])], [AC_CHECK_TYPE( - [struct sockaddr_in6], [], [ipv6=false], + [struct sockaddr_in6], [], [have_ipv6=false], [ #include #include @@ -2094,80 +2030,35 @@ AS_CASE([$target], )] ) -AS_IF([$ipv6], +AS_IF([$have_ipv6], [AC_CHECK_FUNCS([getaddrinfo getnameinfo inet_pton inet_ntop], [], - [ipv6=false])]) -AS_IF([$ipv6], - [AC_DEFINE([HAS_IPV6], [1])]) - -AC_CHECK_FUNC([rewinddir], [AC_DEFINE([HAS_REWINDDIR], [1])]) - -AC_CHECK_FUNC([lockf], [AC_DEFINE([HAS_LOCKF], [1])]) - -AC_CHECK_FUNC([mkfifo], [AC_DEFINE([HAS_MKFIFO], [1])]) - -AC_CHECK_FUNC([getcwd], [AC_DEFINE([HAS_GETCWD], [1])]) - -AC_CHECK_FUNC([system], [AC_DEFINE([HAS_SYSTEM], [1])]) + [$have_ipv6=false])]) ## utime -## Note: this was defined in config/s-nt.h but the autoconf macros do not -# seem to detect it properly on Windows so we hardcode the definition -# of HAS_UTIME on Windows but this will probably need to be clarified AS_CASE([$target], - [*-w64-mingw32*|*-pc-windows], [AC_DEFINE([HAS_UTIME], [1])], + # SetFileTime is used instead of _utime, + [*-w64-mingw32*|*-pc-windows], [], [AC_CHECK_HEADER([sys/types.h], [AC_CHECK_HEADER([utime.h], - [AC_CHECK_FUNC([utime], [AC_DEFINE([HAS_UTIME], [1])])])])]) - -AC_CHECK_FUNC([utimes], [AC_DEFINE([HAS_UTIMES], [1])]) + [AC_CHECK_FUNC([utime], [AC_DEFINE([HAS_UTIME], [1], [TODO])])])])]) AC_CHECK_FUNC([fchmod], - [AC_CHECK_FUNC([fchown], [AC_DEFINE([HAS_FCHMOD], [1])])]) + [AC_CHECK_FUNC([fchown], [AC_DEFINE([HAS_FCHMOD], [1], [TODO])])]) AC_CHECK_FUNC([truncate], - [AC_CHECK_FUNC([ftruncate], [AC_DEFINE([HAS_TRUNCATE], [1])])]) + [AC_CHECK_FUNC([ftruncate], [AC_DEFINE([HAS_TRUNCATE], [1], [TODO])])]) ## select AC_CHECK_FUNC([select], [AC_CHECK_TYPE([fd_set], - [AC_DEFINE([HAS_SELECT], [1])], [], [ + [AC_DEFINE([HAS_SELECT], [1], [TODO])], [], [ #include #include ])]) -AC_CHECK_FUNC([nanosleep], [AC_DEFINE([HAS_NANOSLEEP], [1])]) - AC_CHECK_FUNC([symlink], [AC_CHECK_FUNC([readlink], - [AC_CHECK_FUNC([lstat], [AC_DEFINE([HAS_SYMLINK], [1])])])]) - -AC_CHECK_FUNC([realpath], [AC_DEFINE([HAS_REALPATH], [1])]) - -# wait -AC_CHECK_FUNC( - [waitpid], - [ - wait=true - AC_DEFINE([HAS_WAITPID], [1]) - ], - [wait=false]) - -AC_CHECK_FUNC( - [wait4], - [ - has_wait=true - AC_DEFINE([HAS_WAIT4], [1]) - ]) - -## getgroups -AC_CHECK_FUNC([getgroups], [AC_DEFINE([HAS_GETGROUPS], [1])]) - -## setgroups -AC_CHECK_FUNC([setgroups], [AC_DEFINE([HAS_SETGROUPS], [1])]) - -## initgroups -AC_CHECK_FUNC([initgroups], [AC_DEFINE([HAS_INITGROUPS], [1])]) + [AC_CHECK_FUNC([lstat], [AC_DEFINE([HAS_SYMLINK], [1], [TODO])])])]) ## termios @@ -2176,78 +2067,48 @@ AC_CHECK_HEADER([termios.h], [AC_CHECK_FUNC([tcsetattr], [AC_CHECK_FUNC([tcsendbreak], [AC_CHECK_FUNC([tcflush], - [AC_CHECK_FUNC([tcflow], [AC_DEFINE([HAS_TERMIOS], [1])])])])])])]) - -## setitimer - -AC_CHECK_FUNC([setitimer], - [ - setitimer=true - AC_DEFINE([HAS_SETITIMER], [1]) - ], - [setitimer=false]) + [AC_CHECK_FUNC([tcflow], [AC_DEFINE([HAS_TERMIOS], [1], [TODO])])])])])])]) ## gethostname -# Note: detection fails on Windows so hardcoding the result -# (should be debugged later) -AS_CASE([$target], - [*-w64-mingw32*|*-pc-windows], [AC_DEFINE([HAS_GETHOSTNAME], [1])], - [AC_CHECK_FUNC([gethostname], [AC_DEFINE([HAS_GETHOSTNAME], [1])])]) +AC_CHECK_FUNCS([gethostname]) ## uname AC_CHECK_HEADER([sys/utsname.h], - [AC_CHECK_FUNC([uname], [AC_DEFINE([HAS_UNAME], [1])])]) - -## gettimeofday - -AC_CHECK_FUNC([gettimeofday], - [ - gettimeofday=true - AC_DEFINE([HAS_GETTIMEOFDAY], [1]) - ], - [gettimeofday=false]) - -## mktime - -AC_CHECK_FUNC([mktime], [AC_DEFINE([HAS_MKTIME], [1])]) + [AC_CHECK_FUNCS([uname])]) ## setsid AS_CASE([$target], [*-*-cygwin|*-w64-mingw32*|*-pc-windows], [], - [AC_CHECK_FUNC([setsid], [AC_DEFINE([HAS_SETSID], [1])])]) - -## putenv - -AC_CHECK_FUNC([putenv], [AC_DEFINE([HAS_PUTENV], [1])]) + [AC_CHECK_FUNCS([setsid])]) ## setenv and unsetenv AC_CHECK_FUNC([setenv], - [AC_CHECK_FUNC([unsetenv], [AC_DEFINE([HAS_SETENV_UNSETENV], [1])])]) + [AC_CHECK_FUNC([unsetenv], [AC_DEFINE([HAS_SETENV_UNSETENV], [1], [TODO])])]) ## newlocale() and # Note: the detection fails on msvc so we hardcode the result # (should be debugged later) AS_CASE([$target], - [*-pc-windows], [AC_DEFINE([HAS_LOCALE_H], [1])], + [*-pc-windows], [AC_DEFINE([HAS_LOCALE_H], [1], [TODO])], [AC_CHECK_HEADER([locale.h], [AC_CHECK_FUNC([newlocale], [AC_CHECK_FUNC([freelocale], - [AC_CHECK_FUNC([uselocale], [AC_DEFINE([HAS_LOCALE_H], [1])])])])])]) + [AC_CHECK_FUNC([uselocale], [AC_DEFINE([HAS_LOCALE_H], [1], [TODO])])])])])]) AC_CHECK_HEADER([xlocale.h], [AC_CHECK_FUNC([newlocale], [AC_CHECK_FUNC([freelocale], - [AC_CHECK_FUNC([uselocale], [AC_DEFINE([HAS_XLOCALE_H], [1])])])])]) + [AC_CHECK_FUNC([uselocale], [AC_DEFINE([HAS_XLOCALE_H], [1], [TODO])])])])]) ## strtod_l # Note: not detected on MSVC so hardcoding the result # (should be debugged later) AS_CASE([$target], - [*-pc-windows], [AC_DEFINE([HAS_STRTOD_L], [1])], - [AC_CHECK_FUNC([strtod_l], [AC_DEFINE([HAS_STRTOD_L], [1])])]) + [*-pc-windows], [AC_DEFINE([HAVE_STRTOD_L], [1], [TODO])], + [AC_CHECK_FUNCS([strtod_l])]) ## shared library support AS_IF([$supports_shared_libraries], @@ -2263,18 +2124,14 @@ AS_IF([$supports_shared_libraries], AS_IF([$supports_shared_libraries], [AC_MSG_NOTICE([Dynamic loading of shared libraries is supported.]) - AC_DEFINE([SUPPORT_DYNAMIC_LINKING], [1])], + AC_DEFINE([SUPPORT_DYNAMIC_LINKING], [1], [TODO])], [AC_MSG_NOTICE([Dynamic loading of shared libraries is not supported.])]) ## mmap AC_CHECK_HEADER([sys/mman.h], [AC_CHECK_FUNC([mmap], - [AC_CHECK_FUNC([munmap], [AC_DEFINE([HAS_MMAP], [1])])])]) - -## pwrite - -AC_CHECK_FUNC([pwrite], [AC_DEFINE([HAS_PWRITE], [1])]) + [AC_CHECK_FUNC([munmap], [AC_DEFINE([HAS_MMAP], [1], [TODO])])])]) ## -fdebug-prefix-map support by the C compiler AS_CASE([$ocaml_cc_vendor,$target], @@ -2303,8 +2160,8 @@ AS_IF([$stat_has_ns_precision], AX_FUNC_WHICH_GETHOSTBYNAME_R AS_CASE([$ac_cv_func_which_gethostbyname_r], - [six], [AC_DEFINE([HAS_GETHOSTBYNAME_R],[6])], - [five], [AC_DEFINE([HAS_GETHOSTBYNAME_R],[5])], + [six], [AC_DEFINE([HAS_GETHOSTBYNAME_R],[6], [TODO])], + [five], [AC_DEFINE([HAS_GETHOSTBYNAME_R],[5], [TODO])], [three], [AC_MSG_WARN([OCaml does not support this variant])]) # Number of arguments of gethostbyaddr_r @@ -2312,49 +2169,17 @@ AS_CASE([$ac_cv_func_which_gethostbyname_r], AX_FUNC_WHICH_GETHOSTBYADDR_R AS_CASE([$ac_cv_func_which_gethostbyaddr_r], - [eight], [AC_DEFINE([HAS_GETHOSTBYADDR_R],[8])], - [seven], [AC_DEFINE([HAS_GETHOSTBYADDR_R],[7])]) - -## mkstemp - -AC_CHECK_FUNC([mkstemp], [AC_DEFINE([HAS_MKSTEMP], [1])]) - -## nice - -AC_CHECK_FUNC([nice], [AC_DEFINE([HAS_NICE], [1])]) - -## dup3 - -AC_CHECK_FUNC([dup3], [AC_DEFINE([HAS_DUP3], [1])]) - -## pipe2 - -AC_CHECK_FUNC([pipe2], [AC_DEFINE([HAS_PIPE2], [1])]) - -## accept4 - -AC_CHECK_FUNC([accept4], [AC_DEFINE([HAS_ACCEPT4], [1])]) - -## getauxval - -AC_CHECK_FUNC([getauxval], [AC_DEFINE([HAS_GETAUXVAL], [1])]) + [eight], [AC_DEFINE([HAS_GETHOSTBYADDR_R],[8], [TODO])], + [seven], [AC_DEFINE([HAS_GETHOSTBYADDR_R],[7], [TODO])]) ## shmat -AC_CHECK_HEADER([sys/shm.h], - [ - AC_DEFINE([HAS_SYS_SHM_H], [1]) - AC_CHECK_FUNC([shmat], [AC_DEFINE([HAS_SHMAT], [1])]) - ]) - -## execvpe - -AC_CHECK_FUNC([execvpe], [AC_DEFINE([HAS_EXECVPE], [1])]) +AC_CHECK_HEADERS([sys/shm.h], [AC_CHECK_FUNCS([shmat])]) ## posix_spawn AC_CHECK_HEADER([spawn.h], [AC_CHECK_FUNC([posix_spawn], - [AC_CHECK_FUNC([posix_spawnp], [AC_DEFINE([HAS_POSIX_SPAWN], [1])])])]) + [AC_CHECK_FUNC([posix_spawnp], [AC_DEFINE([HAS_POSIX_SPAWN], [1], [TODO])])])]) AS_IF([$cross_compiler], [AC_PATH_TARGET_TOOL([PKG_CONFIG], [pkg-config], [false])], @@ -2426,7 +2251,7 @@ int main(void) { AS_IF([test x"$zstd_status" = "xok"], [AC_MSG_NOTICE([compressed compilation artefacts supported]) internal_cppflags="$internal_cppflags $zstd_flags" - AC_DEFINE([HAS_ZSTD], [1])], + AC_DEFINE([HAS_ZSTD], [1], [TODO])], [AS_CASE(["$with_zstd"], [no], [], @@ -2487,7 +2312,7 @@ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#define _GNU_SOURCE #include - #ifdef HAS_PTHREAD_NP_H + #ifdef HAVE_PTHREAD_NP_H #include #endif #include ]], @@ -2496,7 +2321,7 @@ AC_LINK_IFELSE( CPU_COUNT(&cs); pthread_getaffinity_np(pthread_self(), sizeof(cs), &cs);]])], [AC_MSG_RESULT([GNU]) - AC_DEFINE([HAS_GNU_GETAFFINITY_NP], [1])], + AC_DEFINE([HAS_GNU_GETAFFINITY_NP], [1], [TODO])], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include @@ -2508,35 +2333,17 @@ AC_LINK_IFELSE( CPU_COUNT(&cs); pthread_getaffinity_np(pthread_self(), sizeof(cs), &cs);]])], [AC_MSG_RESULT([BSD]) - AC_DEFINE([HAS_BSD_GETAFFINITY_NP], [1])], + AC_DEFINE([HAS_BSD_GETAFFINITY_NP], [1], [TODO])], [AC_MSG_RESULT([pthread_getaffinity_np not found])])]) -## prctl -AC_CHECK_FUNCS( - [prctl], - [AC_DEFINE([HAS_PRCTL], [1])]) - -## pthread_setname_np -AC_CHECK_FUNCS( - [pthread_setname_np], - [AC_DEFINE([HAS_PTHREAD_SETNAME_NP], [1])]) - -## pthread_set_name_np -AC_CHECK_FUNCS( - [pthread_set_name_np], - [AC_DEFINE([HAS_PTHREAD_SET_NAME_NP], [1])]) - ## SetThreadDescription -AC_CHECK_FUNCS( - [SetThreadDescription], - [AC_DEFINE([HAS_SETTHREADDESCRIPTION], [1]) - AC_CHECK_DECL( - [SetThreadDescription], - [AC_DEFINE([HAS_DECL_SETTHREADDESCRIPTION], [1])], - [], - [[#define WIN32_LEAN_AND_MEAN - #include - #include ]])]) +AS_CASE([$target], + [*-mingw*|*-windows], + [AC_CHECK_FUNCS([SetThreadDescription], + [AC_CHECK_DECLS([SetThreadDescription], [], [], +[[#define WIN32_LEAN_AND_MEAN +#include +#include ]])])]) ## Activate the systhread library @@ -2572,7 +2379,7 @@ AS_IF([test x"$enable_frame_pointers" = "xyes"], [clang-*|gcc-*], [common_cflags="$common_cflags -g -fno-omit-frame-pointer" frame_pointers=true - AC_DEFINE([WITH_FRAME_POINTERS], [1]) + AC_DEFINE([WITH_FRAME_POINTERS], [1], [TODO]) AC_MSG_NOTICE([using frame pointers])], [AC_MSG_ERROR([frame pointers not supported on this platform])] )], @@ -2584,7 +2391,7 @@ AS_IF([test x"$enable_frame_pointers" = "xyes"], ## Check for mmap support for huge pages and contiguous heap OCAML_MMAP_SUPPORTS_HUGE_PAGES -AC_DEFINE_UNQUOTED([HEADER_RESERVED_BITS], [$reserved_header_bits]) +AC_DEFINE_UNQUOTED([HEADER_RESERVED_BITS], [$reserved_header_bits], [TODO]) AS_IF([test x"$enable_installing_bytecode_programs" = "xno"], [install_bytecode_programs=false], @@ -2630,20 +2437,20 @@ AS_IF([$build_ocamltest], AC_CONFIG_LINKS([ ocamltest/ocamltest_unix.ml:${ocamltest_unix_mod} ]) - AC_CHECK_PROGS([DIFF], [patdiff diff], [none]) - DIFF_FLAGS="" - flags="" - AS_CASE([$DIFF], - [diff], [flags="--strip-trailing-cr -u"], - [none], - [AC_MSG_ERROR([ocamltest requires a diff tool])]) - for flag in ${flags}; do - AC_MSG_CHECKING([whether $DIFF supports $flag]); - AS_IF([$DIFF $DIFF_FLAGS $flag $0 $0 > /dev/null 2>&1], - [DIFF_FLAGS="$DIFF_FLAGS $flag" - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - done]) + AC_CHECK_PROGS([DIFF], [patdiff diff], + [AC_MSG_ERROR([ocamltest requires a diff tool])]) + AS_CASE([$DIFF], [diff], + [AC_CACHE_CHECK([for extra $DIFF flags], + [ocaml_cv_prog_diff_flags], + [flags="" + for flag in -u --strip-trailing-cr; do + "$DIFF" $flag /dev/zero /dev/zero >/dev/null 2>&1 && \ + flags="${flags:+$flags }$flag" + done + ocaml_cv_prog_diff_flags="${flags:-none needed}"]) + AS_IF([test "x$ocaml_cv_prog_diff_flags" = x'none needed'], + [AC_SUBST([DIFF_FLAGS], [""])], + [AC_SUBST([DIFF_FLAGS], [$ocaml_cv_prog_diff_flags])])])]) AS_IF([test x"$enable_flambda" = "xyes"], [flambda=true @@ -2665,26 +2472,22 @@ AS_IF([test x"$enable_cmm_invariants" = "xyes"], AS_IF([test x"$enable_flat_float_array" = "xno"], [flat_float_array=false], - [AC_DEFINE([FLAT_FLOAT_ARRAY], [1]) + [AC_DEFINE([FLAT_FLOAT_ARRAY], [1], [TODO]) flat_float_array=true]) OCAML_MMAP_SUPPORTS_MAP_STACK AS_IF([test x"$enable_mmap_map_stack" = "xyes"], - [AS_IF([test x"$has_mmap_map_stack" = "xtrue"], + [AS_IF([test x"$ocaml_cv_func_mmap_MAP_STACK" = "xyes"], [AS_CASE([$target], [*-freebsd*], - [AC_MSG_ERROR([mmap MAP_STACK not supported on FreeBSD])], - [with_mmap_map_stack=true; - AC_DEFINE([USE_MMAP_MAP_STACK], [1])])], - [AC_MSG_ERROR([mmap MAP_STACK requested but not found on $target])]) - ], + [AC_MSG_ERROR([mmap MAP_STACK is not supported on FreeBSD])])], + [AC_MSG_ERROR([mmap MAP_STACK requested but not found on $target])])], [AS_CASE([$target], [*-openbsd*], - [with_mmap_map_stack=true; - AC_DEFINE([USE_MMAP_MAP_STACK], [1]) - AC_MSG_NOTICE([using MAP_STACK on OpenBSD due to stack checking])], - [with_mmap_map_stack=false]) - ]) + [ocaml_cv_func_mmap_MAP_STACK=yes + AC_MSG_NOTICE([Using MAP_STACK on OpenBSD due to stack checking])])]) +AS_IF([test x"$ocaml_cv_func_mmap_MAP_STACK" = "xyes"], + [AC_DEFINE([USE_MMAP_MAP_STACK], [1], [Define to use mmap MAP_STACK.])]) oc_native_compflags='' @@ -2709,7 +2512,7 @@ AS_IF([test x"$enable_function_sections" = "xno"], [function_sections=true; oc_native_compflags='-function-sections' internal_cflags="$internal_cflags -ffunction-sections"; - AC_DEFINE([FUNCTION_SECTIONS], [1])], + AC_DEFINE([FUNCTION_SECTIONS], [1], [TODO])], [function_sections=false; AC_MSG_NOTICE([Function sections are not supported by $ocaml_cc_vendor.])])])], @@ -2778,22 +2581,25 @@ AS_IF([test x"$prefix" = "xNONE"], [*-*-cygwin,*-w64-mingw32*|*-*-cygwin,*-pc-windows], [prefix="$(LC_ALL=C.UTF-8 cygpath -m "$prefix")"])]) -# Define a few macros that were defined in config/m-nt.h -# but whose value is not guessed properly by configure -# (all this should be understood and fixed) +# Define a few macros that were defined in config/m-nt.h but which values are +# not guessed properly by configure (all this should be understood and fixed) +have_broken_printf=false AS_CASE([$target], [*-w64-mingw32*], - [AC_DEFINE([HAS_BROKEN_PRINTF], [1]) - AC_DEFINE([HAS_IPV6], [1]) - AC_DEFINE([HAS_NICE], [1])], + [have_broken_printf=true + have_ipv6=true], [*-pc-windows], - [AC_DEFINE([HAS_BROKEN_PRINTF], [1]) - AC_DEFINE([HAS_IPV6], [1]) - AC_DEFINE([HAS_NICE], [1])], + [have_broken_printf=true + have_ipv6=true], [*-*-solaris*], - # This is required as otherwise floats are printed - # as "Infinity" and "Inf" instead of the expected "inf" - [AC_DEFINE([HAS_BROKEN_PRINTF], [1])]) + [have_broken_printf=true]) + +AS_IF([${have_broken_printf}], + [AC_DEFINE([HAVE_BROKEN_PRINTF], [1], [Define if floats are printed as + "Infinity" and "Inf" instead of the expected "inf".])]) + +AS_IF([$have_ipv6], + [AC_DEFINE([HAVE_IPV6], [1], [Define if IPv6 is supported.])]) # Do not permanently cache the result of flexdll.h unset ac_cv_header_flexdll_h diff --git a/otherlibs/systhreads/st_posix.h b/otherlibs/systhreads/st_posix.h index 22c3dbd455a7..5172a532afd5 100644 --- a/otherlibs/systhreads/st_posix.h +++ b/otherlibs/systhreads/st_posix.h @@ -36,7 +36,7 @@ Caml_inline void st_msleep(const st_timeout *timeout) #else -#ifdef HAS_SYS_SELECT_H +#ifdef HAVE_SYS_SELECT_H #include #endif diff --git a/otherlibs/systhreads/st_stubs.c b/otherlibs/systhreads/st_stubs.c index 290cb8c05fcf..7f13e17c77a8 100644 --- a/otherlibs/systhreads/st_stubs.c +++ b/otherlibs/systhreads/st_stubs.c @@ -24,15 +24,15 @@ # include # include "caml/osdeps.h" -# if defined(HAS_SETTHREADDESCRIPTION) && \ - !defined(HAS_DECL_SETTHREADDESCRIPTION) +# if defined(HAVE_SETTHREADDESCRIPTION) && \ + !defined(HAVE_DECL_SETTHREADDESCRIPTION) WINBASEAPI HRESULT WINAPI SetThreadDescription(HANDLE hThread, PCWSTR lpThreadDescription); # endif -#elif defined(HAS_PRCTL) +#elif defined(HAVE_PRCTL) # include -#elif defined(HAS_PTHREAD_SETNAME_NP) || defined(HAS_PTHREAD_SET_NAME_NP) +#elif defined(HAVE_PTHREAD_SETNAME_NP) || defined(HAVE_PTHREAD_SET_NAME_NP) # include # if defined(HAS_PTHREAD_NP_H) @@ -985,21 +985,21 @@ CAMLprim value caml_set_current_thread_name(value name) { #if defined(_WIN32) -# if defined(HAS_SETTHREADDESCRIPTION) +# if defined(HAVE_SETTHREADDESCRIPTION) wchar_t *thread_name = caml_stat_strdup_to_utf16(String_val(name)); SetThreadDescription(GetCurrentThread(), thread_name); caml_stat_free(thread_name); # endif -# if defined(HAS_PTHREAD_SETNAME_NP) +# if defined(HAVE_PTHREAD_SETNAME_NP) // We are using both methods. // See: https://github.com/ocaml/ocaml/pull/13504#discussion_r1786358928 pthread_setname_np(pthread_self(), String_val(name)); # endif -#elif defined(HAS_PRCTL) +#elif defined(HAVE_PRCTL) prctl(PR_SET_NAME, String_val(name)); -#elif defined(HAS_PTHREAD_SETNAME_NP) +#elif defined(HAVE_PTHREAD_SETNAME_NP) # if defined(__APPLE__) pthread_setname_np(String_val(name)); # elif defined(__NetBSD__) @@ -1007,7 +1007,7 @@ CAMLprim value caml_set_current_thread_name(value name) # else pthread_setname_np(pthread_self(), String_val(name)); # endif -#elif defined(HAS_PTHREAD_SET_NAME_NP) +#elif defined(HAVE_PTHREAD_SET_NAME_NP) pthread_set_name_np(pthread_self(), String_val(name)); #else if (caml_runtime_warnings_active()) { diff --git a/otherlibs/unix/accept_unix.c b/otherlibs/unix/accept_unix.c index aef00a649836..e8e8a4bb2a67 100644 --- a/otherlibs/unix/accept_unix.c +++ b/otherlibs/unix/accept_unix.c @@ -21,7 +21,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include "caml/socketaddr.h" @@ -37,7 +37,7 @@ CAMLprim value caml_unix_accept(value cloexec, value sock) addr_len = sizeof(addr); caml_enter_blocking_section(); -#if defined(HAS_ACCEPT4) && defined(SOCK_CLOEXEC) +#if defined(HAVE_ACCEPT4) && defined(SOCK_CLOEXEC) retcode = accept4(Int_val(sock), &addr.s_gen, &addr_len, clo ? SOCK_CLOEXEC : 0); #else @@ -45,7 +45,7 @@ CAMLprim value caml_unix_accept(value cloexec, value sock) #endif caml_leave_blocking_section(); if (retcode == -1) caml_uerror("accept", Nothing); -#if !(defined(HAS_ACCEPT4) && defined(SOCK_CLOEXEC)) +#if !(defined(HAVE_ACCEPT4) && defined(SOCK_CLOEXEC)) if (clo) caml_unix_set_cloexec(retcode, "accept", Nothing); #endif a = caml_unix_alloc_sockaddr(&addr, addr_len, retcode); diff --git a/otherlibs/unix/addrofstr.c b/otherlibs/unix/addrofstr.c index 8271246a8b47..948fcc0c4731 100644 --- a/otherlibs/unix/addrofstr.c +++ b/otherlibs/unix/addrofstr.c @@ -18,14 +18,14 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include "caml/socketaddr.h" CAMLprim value caml_unix_inet_addr_of_string(value s) { if (! caml_string_is_c_safe(s)) caml_failwith("inet_addr_of_string"); -#if defined(HAS_IPV6) +#if defined(HAVE_IPV6) #ifdef _WIN32 { CAMLparam1(s); @@ -74,7 +74,7 @@ CAMLprim value caml_unix_inet_addr_of_string(value s) caml_failwith("inet_addr_of_string"); } #endif -#elif defined(HAS_INET_ATON) +#elif defined(HAVE_INET_ATON) { struct in_addr address; if (inet_aton(String_val(s), &address) == 0) diff --git a/otherlibs/unix/bind_unix.c b/otherlibs/unix/bind_unix.c index e550f998dd6f..74c1d04c3858 100644 --- a/otherlibs/unix/bind_unix.c +++ b/otherlibs/unix/bind_unix.c @@ -17,7 +17,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include "caml/socketaddr.h" diff --git a/otherlibs/unix/caml/socketaddr.h b/otherlibs/unix/caml/socketaddr.h index 768669d0cc10..cea717f93403 100644 --- a/otherlibs/unix/caml/socketaddr.h +++ b/otherlibs/unix/caml/socketaddr.h @@ -23,7 +23,7 @@ /* Code duplication with runtime/debugger.c is inevitable, because * pulling winsock2.h creates many naming conflicts. */ #include -#ifdef HAS_AFUNIX_H +#ifdef HAVE_AFUNIX_H #include #else #define UNIX_PATH_MAX 108 @@ -49,12 +49,12 @@ union sock_addr_union { struct sockaddr s_gen; struct sockaddr_un s_unix; struct sockaddr_in s_inet; -#ifdef HAS_IPV6 +#ifdef HAVE_IPV6 struct sockaddr_in6 s_inet6; #endif }; -#ifdef HAS_SOCKLEN_T +#ifdef HAVE_SOCKLEN_T typedef socklen_t socklen_param_type; #else typedef int socklen_param_type; @@ -80,7 +80,7 @@ extern value caml_unix_alloc_sockaddr (union sock_addr_union * addr /*in*/, extern value caml_unix_alloc_inet_addr (struct in_addr * inaddr); #define GET_INET_ADDR(v) (*((struct in_addr *) (v))) -#ifdef HAS_IPV6 +#ifdef HAVE_IPV6 extern value caml_unix_alloc_inet6_addr (struct in6_addr * inaddr); #define GET_INET6_ADDR(v) (*((struct in6_addr *) (v))) @@ -88,7 +88,7 @@ extern value caml_unix_alloc_inet6_addr (struct in6_addr * inaddr); #ifndef CAML_BUILDING_UNIX #define alloc_inet6_addr caml_unix_alloc_inet6_addr #endif /* CAML_BUILDING_UNIX */ -#endif /* HAS_IPV6 */ +#endif /* HAVE_IPV6 */ #ifdef __cplusplus } diff --git a/otherlibs/unix/channels_unix.c b/otherlibs/unix/channels_unix.c index 152ba6ac6b95..30b1096c8a56 100644 --- a/otherlibs/unix/channels_unix.c +++ b/otherlibs/unix/channels_unix.c @@ -23,7 +23,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include #include "caml/socketaddr.h" #endif @@ -43,7 +43,7 @@ static int caml_unix_check_stream_semantics(int fd) case S_IFREG: case S_IFCHR: case S_IFIFO: /* These have stream semantics */ return 0; -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS case S_IFSOCK: { int so_type; socklen_param_type so_type_len = sizeof(so_type); diff --git a/otherlibs/unix/connect_unix.c b/otherlibs/unix/connect_unix.c index 90f3a6cb30d9..e40a0a548ef7 100644 --- a/otherlibs/unix/connect_unix.c +++ b/otherlibs/unix/connect_unix.c @@ -18,7 +18,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include "caml/socketaddr.h" diff --git a/otherlibs/unix/dup2.c b/otherlibs/unix/dup2.c index 1b6f620a229e..37bb0c917b72 100644 --- a/otherlibs/unix/dup2.c +++ b/otherlibs/unix/dup2.c @@ -30,7 +30,7 @@ CAMLprim value caml_unix_dup2(value cloexec, value fd1, value fd2) caml_unix_clear_cloexec(Int_val(fd2), "dup2", Nothing); } } else { -#ifdef HAS_DUP3 +#ifdef HAVE_DUP3 if (dup3(Int_val(fd1), Int_val(fd2), caml_unix_cloexec_p(cloexec) ? O_CLOEXEC : 0) == -1) caml_uerror("dup2", Nothing); diff --git a/otherlibs/unix/envir_unix.c b/otherlibs/unix/envir_unix.c index 0eaac46bc7a9..5ad2a4ca4a86 100644 --- a/otherlibs/unix/envir_unix.c +++ b/otherlibs/unix/envir_unix.c @@ -19,7 +19,7 @@ #include #endif #include -#ifdef HAS_GETAUXVAL +#ifdef HAVE_GETAUXVAL #include #endif @@ -39,12 +39,12 @@ CAMLprim value caml_unix_environment_unsafe(value unit) static char **secure_environ(void) { -#ifdef HAS_GETAUXVAL +#ifdef HAVE_GETAUXVAL if (!getauxval(AT_SECURE)) return environ; else return NULL; -#elif defined(HAS_ISSETUGID) +#elif defined(HAVE_ISSETUGID) if (!issetugid ()) return environ; else diff --git a/otherlibs/unix/execvp.c b/otherlibs/unix/execvp.c index 8fff5db39156..9f5472e14895 100644 --- a/otherlibs/unix/execvp.c +++ b/otherlibs/unix/execvp.c @@ -37,7 +37,7 @@ CAMLprim value caml_unix_execvp(value path, value args) /* from smart compilers */ } -#ifndef HAS_EXECVPE +#ifndef HAVE_EXECVPE int caml_unix_execvpe_emulation(const char * name, char * const argv[], char * const envp[]); @@ -53,7 +53,7 @@ CAMLprim value caml_unix_execvpe(value path, value args, value env) argv = caml_unix_cstringvect(args, "execvpe"); envp = caml_unix_cstringvect(env, "execvpe"); wpath = caml_stat_strdup_to_os(String_val(path)); -#ifdef HAS_EXECVPE +#ifdef HAVE_EXECVPE (void) execvpe_os((const char_os *)wpath, EXECV_CAST argv, EXECV_CAST envp); err = errno; #else @@ -67,7 +67,7 @@ CAMLprim value caml_unix_execvpe(value path, value args, value env) /* from smart compilers */ } -#ifndef HAS_EXECVPE +#ifndef HAVE_EXECVPE static int caml_unix_execve_script(const char * path, char * const argv[], diff --git a/otherlibs/unix/getaddrinfo.c b/otherlibs/unix/getaddrinfo.c index a7a164353e94..3998747c0796 100644 --- a/otherlibs/unix/getaddrinfo.c +++ b/otherlibs/unix/getaddrinfo.c @@ -23,7 +23,7 @@ #include "caml/unixsupport.h" #include "cst2constr.h" -#if defined(HAS_SOCKETS) && defined(HAS_IPV6) +#if defined(HAVE_SOCKETS) && defined(HAVE_IPV6) #include "caml/socketaddr.h" #ifndef _WIN32 diff --git a/otherlibs/unix/getcwd.c b/otherlibs/unix/getcwd.c index dccc1f88a10d..c031e171d0a5 100644 --- a/otherlibs/unix/getcwd.c +++ b/otherlibs/unix/getcwd.c @@ -33,7 +33,7 @@ #endif #endif -#ifdef HAS_GETCWD +#ifdef HAVE_GETCWD CAMLprim value caml_unix_getcwd(value unit) { diff --git a/otherlibs/unix/getgroups.c b/otherlibs/unix/getgroups.c index 74382713cfba..519e0f352657 100644 --- a/otherlibs/unix/getgroups.c +++ b/otherlibs/unix/getgroups.c @@ -18,7 +18,7 @@ #include #include -#ifdef HAS_GETGROUPS +#ifdef HAVE_GETGROUPS #include #ifndef _WIN32 diff --git a/otherlibs/unix/gethost.c b/otherlibs/unix/gethost.c index 8837e1425044..3fb4f850b1ec 100644 --- a/otherlibs/unix/gethost.c +++ b/otherlibs/unix/gethost.c @@ -23,7 +23,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include "caml/socketaddr.h" #ifndef _WIN32 @@ -84,7 +84,7 @@ CAMLprim value caml_unix_gethostbyaddr(value a) struct hostent * hp; int addr_type = AF_INET; socklen_t addr_len = 4; -#if HAS_IPV6 +#if HAVE_IPV6 struct in6_addr in6; if (caml_string_length(a) == 16) { addr_type = AF_INET6; @@ -95,7 +95,7 @@ CAMLprim value caml_unix_gethostbyaddr(value a) #endif in4 = GET_INET_ADDR(a); adr = (char *)&in4; -#if HAS_IPV6 +#if HAVE_IPV6 } #endif #if !defined(HAS_GETHOSTBYADDR_R) diff --git a/otherlibs/unix/gethostname.c b/otherlibs/unix/gethostname.c index df29c59e97cf..4b085b587e47 100644 --- a/otherlibs/unix/gethostname.c +++ b/otherlibs/unix/gethostname.c @@ -21,7 +21,7 @@ #endif #include "caml/unixsupport.h" -#ifdef HAS_GETHOSTNAME +#ifdef HAVE_GETHOSTNAME #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 @@ -36,7 +36,7 @@ CAMLprim value caml_unix_gethostname(value unit) } #else -#ifdef HAS_UNAME +#ifdef HAVE_UNAME #include diff --git a/otherlibs/unix/getnameinfo.c b/otherlibs/unix/getnameinfo.c index 5d486525a50a..b807a719a9c0 100644 --- a/otherlibs/unix/getnameinfo.c +++ b/otherlibs/unix/getnameinfo.c @@ -21,7 +21,7 @@ #include #include "caml/unixsupport.h" -#if defined(HAS_SOCKETS) && defined(HAS_IPV6) +#if defined(HAVE_SOCKETS) && defined(HAVE_IPV6) #include "caml/socketaddr.h" #ifndef _WIN32 diff --git a/otherlibs/unix/getpeername_unix.c b/otherlibs/unix/getpeername_unix.c index 90aab9dd8ce1..3da1a3caf3bd 100644 --- a/otherlibs/unix/getpeername_unix.c +++ b/otherlibs/unix/getpeername_unix.c @@ -17,7 +17,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include "caml/socketaddr.h" diff --git a/otherlibs/unix/getproto.c b/otherlibs/unix/getproto.c index 2ee7a62eed5b..edd56a45ad21 100644 --- a/otherlibs/unix/getproto.c +++ b/otherlibs/unix/getproto.c @@ -19,7 +19,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #ifndef _WIN32 #include diff --git a/otherlibs/unix/getserv.c b/otherlibs/unix/getserv.c index db322e196ce7..e3e13c2516c5 100644 --- a/otherlibs/unix/getserv.c +++ b/otherlibs/unix/getserv.c @@ -19,7 +19,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include diff --git a/otherlibs/unix/getsockname_unix.c b/otherlibs/unix/getsockname_unix.c index 6692929558c3..ceacd2ae7f06 100644 --- a/otherlibs/unix/getsockname_unix.c +++ b/otherlibs/unix/getsockname_unix.c @@ -17,7 +17,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include "caml/socketaddr.h" diff --git a/otherlibs/unix/gmtime.c b/otherlibs/unix/gmtime.c index adcaea176dc5..fe212a9516d4 100644 --- a/otherlibs/unix/gmtime.c +++ b/otherlibs/unix/gmtime.c @@ -57,7 +57,7 @@ CAMLprim value caml_unix_localtime(value t) return alloc_tm(tm); } -#ifdef HAS_MKTIME +#ifdef HAVE_MKTIME CAMLprim value caml_unix_mktime(value t) { diff --git a/otherlibs/unix/initgroups.c b/otherlibs/unix/initgroups.c index 1c0a34bca98d..1e4028e9ae21 100644 --- a/otherlibs/unix/initgroups.c +++ b/otherlibs/unix/initgroups.c @@ -17,7 +17,7 @@ #include #include -#ifdef HAS_INITGROUPS +#ifdef HAVE_INITGROUPS #include #ifndef _WIN32 diff --git a/otherlibs/unix/itimer.c b/otherlibs/unix/itimer.c index 5b2d18f06d55..7fe50450cb2a 100644 --- a/otherlibs/unix/itimer.c +++ b/otherlibs/unix/itimer.c @@ -20,7 +20,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SETITIMER +#ifdef HAVE_SETITIMER #include #include diff --git a/otherlibs/unix/listen_unix.c b/otherlibs/unix/listen_unix.c index 60bafa400db3..201d0a46d041 100644 --- a/otherlibs/unix/listen_unix.c +++ b/otherlibs/unix/listen_unix.c @@ -17,7 +17,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include diff --git a/otherlibs/unix/lockf_unix.c b/otherlibs/unix/lockf_unix.c index 67bd4a7718fc..f76128edaefe 100644 --- a/otherlibs/unix/lockf_unix.c +++ b/otherlibs/unix/lockf_unix.c @@ -86,7 +86,7 @@ CAMLprim value caml_unix_lockf(value fd, value cmd, value span) #else -#ifdef HAS_LOCKF +#ifdef HAVE_LOCKF #ifndef _WIN32 #include #else diff --git a/otherlibs/unix/mkfifo.c b/otherlibs/unix/mkfifo.c index a446932d3f56..d92f24840a26 100644 --- a/otherlibs/unix/mkfifo.c +++ b/otherlibs/unix/mkfifo.c @@ -21,7 +21,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_MKFIFO +#ifdef HAVE_MKFIFO CAMLprim value caml_unix_mkfifo(value path, value vmode) { diff --git a/otherlibs/unix/mmap_unix.c b/otherlibs/unix/mmap_unix.c index 026cbcf5fa21..8a393f5f7d8b 100644 --- a/otherlibs/unix/mmap_unix.c +++ b/otherlibs/unix/mmap_unix.c @@ -57,7 +57,7 @@ static int caml_grow_file(int fd, file_offset size) /* First use pwrite for growing - it is a conservative method, as it can never happen that we shrink by accident */ -#ifdef HAS_PWRITE +#ifdef HAVE_PWRITE c = 0; p = pwrite(fd, &c, 1, size - 1); #else diff --git a/otherlibs/unix/nice.c b/otherlibs/unix/nice.c index 9ca9bea20c2a..5b7cf479b5bf 100644 --- a/otherlibs/unix/nice.c +++ b/otherlibs/unix/nice.c @@ -24,7 +24,7 @@ CAMLprim value caml_unix_nice(value incr) { int ret; errno = 0; -#ifdef HAS_NICE +#ifdef HAVE_NICE ret = nice(Int_val(incr)); #else ret = 0; diff --git a/otherlibs/unix/pipe_unix.c b/otherlibs/unix/pipe_unix.c index 3ed9e2e71e91..31321d283e50 100644 --- a/otherlibs/unix/pipe_unix.c +++ b/otherlibs/unix/pipe_unix.c @@ -23,7 +23,7 @@ CAMLprim value caml_unix_pipe(value cloexec, value vunit) { int fd[2]; value res; -#ifdef HAS_PIPE2 +#ifdef HAVE_PIPE2 if (pipe2(fd, caml_unix_cloexec_p(cloexec) ? O_CLOEXEC : 0) == -1) caml_uerror("pipe", Nothing); #else diff --git a/otherlibs/unix/putenv.c b/otherlibs/unix/putenv.c index 1d8dde38814a..da4bcd4f64d6 100644 --- a/otherlibs/unix/putenv.c +++ b/otherlibs/unix/putenv.c @@ -26,7 +26,7 @@ #include "caml/unixsupport.h" -#ifdef HAS_PUTENV +#ifdef HAVE_PUTENV CAMLprim value caml_unix_putenv(value name, value val) { diff --git a/otherlibs/unix/realpath_unix.c b/otherlibs/unix/realpath_unix.c index 4c66a0243ce6..e9ace08d2e20 100644 --- a/otherlibs/unix/realpath_unix.c +++ b/otherlibs/unix/realpath_unix.c @@ -19,7 +19,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_REALPATH +#ifdef HAVE_REALPATH CAMLprim value caml_unix_realpath (value p) { diff --git a/otherlibs/unix/rewinddir.c b/otherlibs/unix/rewinddir.c index 01ca64e9bf65..27758e87919a 100644 --- a/otherlibs/unix/rewinddir.c +++ b/otherlibs/unix/rewinddir.c @@ -24,7 +24,7 @@ #include #endif -#ifdef HAS_REWINDDIR +#ifdef HAVE_REWINDDIR CAMLprim value caml_unix_rewinddir(value vd) { diff --git a/otherlibs/unix/select_unix.c b/otherlibs/unix/select_unix.c index 8d4dc12d217c..0e6f06d9ad17 100644 --- a/otherlibs/unix/select_unix.c +++ b/otherlibs/unix/select_unix.c @@ -25,7 +25,7 @@ #include #include -#ifdef HAS_SYS_SELECT_H +#ifdef HAVE_SYS_SELECT_H #include #endif #include diff --git a/otherlibs/unix/sendrecv_unix.c b/otherlibs/unix/sendrecv_unix.c index 7a85ff3808c5..ca790930c617 100644 --- a/otherlibs/unix/sendrecv_unix.c +++ b/otherlibs/unix/sendrecv_unix.c @@ -21,7 +21,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include "caml/socketaddr.h" static const int msg_flag_table[] = { diff --git a/otherlibs/unix/setgroups.c b/otherlibs/unix/setgroups.c index 0bc68f4ebda1..7f78218484af 100644 --- a/otherlibs/unix/setgroups.c +++ b/otherlibs/unix/setgroups.c @@ -18,7 +18,7 @@ #include #include -#ifdef HAS_SETGROUPS +#ifdef HAVE_SETGROUPS #include #ifndef _WIN32 diff --git a/otherlibs/unix/setsid.c b/otherlibs/unix/setsid.c index 65c1dab31f9f..78acd69cad88 100644 --- a/otherlibs/unix/setsid.c +++ b/otherlibs/unix/setsid.c @@ -22,7 +22,7 @@ CAMLprim value caml_unix_setsid(value unit) { -#ifdef HAS_SETSID +#ifdef HAVE_SETSID pid_t pid = setsid(); if (pid == (pid_t)(-1)) caml_uerror("setsid", Nothing); return Val_long(pid); diff --git a/otherlibs/unix/shutdown_unix.c b/otherlibs/unix/shutdown_unix.c index e5f682695748..2d192dc9f704 100644 --- a/otherlibs/unix/shutdown_unix.c +++ b/otherlibs/unix/shutdown_unix.c @@ -17,7 +17,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include diff --git a/otherlibs/unix/sleep_unix.c b/otherlibs/unix/sleep_unix.c index 7c4f73ae8529..faca223785b0 100644 --- a/otherlibs/unix/sleep_unix.c +++ b/otherlibs/unix/sleep_unix.c @@ -23,7 +23,7 @@ #ifdef HAS_SELECT #include #include -#ifdef HAS_SYS_SELECT_H +#ifdef HAVE_SYS_SELECT_H #include #endif #endif @@ -33,7 +33,7 @@ CAMLprim value caml_unix_sleep(value duration_sec) { double sec = Double_val(duration_sec); if (sec < 0.0) return Val_unit; -#if defined(HAS_NANOSLEEP) +#if defined(HAVE_NANOSLEEP) { struct timespec t = caml_timespec_of_sec(sec); int ret; diff --git a/otherlibs/unix/socket_unix.c b/otherlibs/unix/socket_unix.c index 452546281345..13de0927b2b6 100644 --- a/otherlibs/unix/socket_unix.c +++ b/otherlibs/unix/socket_unix.c @@ -18,14 +18,14 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include #include const int caml_unix_socket_domain_table[] = { PF_UNIX, PF_INET, -#if defined(HAS_IPV6) +#if defined(HAVE_IPV6) PF_INET6 #elif defined(PF_UNSPEC) PF_UNSPEC diff --git a/otherlibs/unix/socketaddr.c b/otherlibs/unix/socketaddr.c index b340eeba1392..b44faf520b45 100644 --- a/otherlibs/unix/socketaddr.c +++ b/otherlibs/unix/socketaddr.c @@ -20,7 +20,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include "caml/socketaddr.h" @@ -40,7 +40,7 @@ CAMLexport value caml_unix_alloc_inet_addr(struct in_addr * a) return res; } -#ifdef HAS_IPV6 +#ifdef HAVE_IPV6 CAMLexport value caml_unix_alloc_inet6_addr(struct in6_addr * a) { @@ -76,7 +76,7 @@ void caml_unix_get_sockaddr(value mladr, break; } case 1: /* ADDR_INET */ -#ifdef HAS_IPV6 +#ifdef HAVE_IPV6 if (caml_string_length(Field(mladr, 0)) == 16) { memset(&adr->s_inet6, 0, sizeof(struct sockaddr_in6)); adr->s_inet6.sin6_family = AF_INET6; @@ -152,7 +152,7 @@ value caml_unix_alloc_sockaddr(union sock_addr_union * adr /*in*/, Field(res,1) = Val_int(ntohs(adr->s_inet.sin_port)); break; } -#ifdef HAS_IPV6 +#ifdef HAVE_IPV6 case AF_INET6: { a = caml_unix_alloc_inet6_addr(&adr->s_inet6.sin6_addr); res = caml_alloc_small(2, 1); diff --git a/otherlibs/unix/socketpair_unix.c b/otherlibs/unix/socketpair_unix.c index a93c95502a67..b3340148b45d 100644 --- a/otherlibs/unix/socketpair_unix.c +++ b/otherlibs/unix/socketpair_unix.c @@ -18,7 +18,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include diff --git a/otherlibs/unix/socketpair_win32.c b/otherlibs/unix/socketpair_win32.c index effeeb7cfb26..144553cfad9e 100644 --- a/otherlibs/unix/socketpair_win32.c +++ b/otherlibs/unix/socketpair_win32.c @@ -20,7 +20,7 @@ #include "caml/unixsupport.h" #include -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include "caml/socketaddr.h" #include @@ -28,7 +28,7 @@ extern const int caml_unix_socket_domain_table[]; /* from socket.c */ extern const int caml_unix_socket_type_table[]; /* from socket.c */ -#ifdef HAS_SOCKETPAIR +#ifdef HAVE_SOCKETPAIR #error "Windows has defined sockepair! win32unix should be updated." @@ -198,6 +198,6 @@ CAMLprim value caml_unix_socketpair(value cloexec, value vdomain, value vtype, CAMLreturn(result); } -#endif /* HAS_SOCKETPAIR */ +#endif /* HAVE_SOCKETPAIR */ -#endif /* HAS_SOCKETS */ +#endif /* HAVE_SOCKETS */ diff --git a/otherlibs/unix/sockopt_unix.c b/otherlibs/unix/sockopt_unix.c index 685ff1a905c0..f5bda0800ddd 100644 --- a/otherlibs/unix/sockopt_unix.c +++ b/otherlibs/unix/sockopt_unix.c @@ -20,7 +20,7 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include #include diff --git a/otherlibs/unix/spawn.c b/otherlibs/unix/spawn.c index 74e573953851..f6b6ad01314b 100644 --- a/otherlibs/unix/spawn.c +++ b/otherlibs/unix/spawn.c @@ -139,7 +139,7 @@ CAMLprim value caml_unix_spawn(value executable, /* string */ if (envp == NULL) { execvp(path, argv); } else { -#ifdef HAS_EXECVPE +#ifdef HAVE_EXECVPE execvpe(path, argv, envp); #else /* No other thread is running in the child process, so we can change diff --git a/otherlibs/unix/strofaddr.c b/otherlibs/unix/strofaddr.c index 31276f7040c3..74daf75ebeed 100644 --- a/otherlibs/unix/strofaddr.c +++ b/otherlibs/unix/strofaddr.c @@ -18,14 +18,14 @@ #include #include "caml/unixsupport.h" -#ifdef HAS_SOCKETS +#ifdef HAVE_SOCKETS #include "caml/socketaddr.h" CAMLprim value caml_unix_string_of_inet_addr(value a) { char * res; -#ifdef HAS_IPV6 +#ifdef HAVE_IPV6 #ifdef _WIN32 char buffer[64]; union sock_addr_union sa; diff --git a/otherlibs/unix/times_unix.c b/otherlibs/unix/times_unix.c index 025eb33257f4..17bc5a87d280 100644 --- a/otherlibs/unix/times_unix.c +++ b/otherlibs/unix/times_unix.c @@ -21,14 +21,14 @@ #include #include #include -#ifdef HAS_GETRUSAGE +#ifdef HAVE_GETRUSAGE #include #include #endif CAMLprim value caml_unix_times(value unit) { -#ifdef HAS_GETRUSAGE +#ifdef HAVE_GETRUSAGE value res; struct rusage ru; diff --git a/otherlibs/unix/utimes_unix.c b/otherlibs/unix/utimes_unix.c index 77468025f5d1..a3add57a97c8 100644 --- a/otherlibs/unix/utimes_unix.c +++ b/otherlibs/unix/utimes_unix.c @@ -22,7 +22,7 @@ #include #include "caml/unixsupport.h" -#if defined(HAS_UTIMES) +#if defined(HAVE_UTIMES) #include #include diff --git a/otherlibs/unix/wait.c b/otherlibs/unix/wait.c index 31fb2b9e4dd6..b503bdf422c9 100644 --- a/otherlibs/unix/wait.c +++ b/otherlibs/unix/wait.c @@ -77,9 +77,9 @@ CAMLprim value caml_unix_wait(value unit) return alloc_process_status(pid, status); } -#if defined(HAS_WAITPID) || defined(HAS_WAIT4) +#if defined(HAVE_WAITPID) || defined(HAVE_WAIT4) -#ifndef HAS_WAITPID +#ifndef HAVE_WAITPID #define waitpid(pid,status,opts) wait4(pid,status,opts,NULL) #endif diff --git a/runtime/afl.c b/runtime/afl.c index 8d56ad185385..80731d8db796 100644 --- a/runtime/afl.c +++ b/runtime/afl.c @@ -27,7 +27,7 @@ unsigned char * caml_afl_area_ptr = NULL; uintnat caml_afl_prev_loc; -#if !defined(HAS_SYS_SHM_H) || !defined(HAS_SHMAT) +#if !defined(HAVE_SYS_SHM_H) || !defined(HAVE_SHMAT) CAMLexport value caml_setup_afl(value unit) { @@ -183,4 +183,4 @@ CAMLprim value caml_reset_afl_instrumentation(value full) return Val_unit; } -#endif /* HAS_SYS_SHM_H */ +#endif /* HAVE_SYS_SHM_H */ diff --git a/runtime/amd64.S b/runtime/amd64.S index 5c36868a7c6a..78deb71feed6 100644 --- a/runtime/amd64.S +++ b/runtime/amd64.S @@ -18,7 +18,7 @@ /* PIC mode support based on contribution by Paul Stravers (see PR#4795) */ -#include "caml/m.h" +#include "caml/config.h" #include "caml/asm.h" #if defined(SYS_macosx) diff --git a/runtime/arm64.S b/runtime/arm64.S index 2082ae4fd824..ff9c5f3bc32b 100644 --- a/runtime/arm64.S +++ b/runtime/arm64.S @@ -18,7 +18,7 @@ /* Asm part of the runtime system, ARM processor, 64-bit mode */ /* Must be preprocessed by cpp */ -#include "caml/m.h" +#include "caml/config.h" #include "caml/asm.h" /* Special registers */ diff --git a/runtime/array.c b/runtime/array.c index d08289d92778..6c4f972c6f7a 100644 --- a/runtime/array.c +++ b/runtime/array.c @@ -274,7 +274,7 @@ CAMLprim value caml_array_create_float(value len) Caml_out_of_heap_header(Double_wosize, Double_tag), #if defined(ARCH_SIXTYFOUR) 0x7FF0000000000001 -#elif defined(ARCH_BIG_ENDIAN) +#elif defined(WORDS_BIGENDIAN) 0x7FF00000, 0x00000001, #else 0x00000001, 0x7FF00000 diff --git a/runtime/bigarray.c b/runtime/bigarray.c index bd3ce896eb10..c301d283d8e2 100644 --- a/runtime/bigarray.c +++ b/runtime/bigarray.c @@ -792,7 +792,7 @@ CAMLprim value caml_ba_uint8_get16(value vb, value vind) if (idx < 0 || idx >= b->dim[0] - 1) caml_array_bound_error(); b1 = ((unsigned char*) b->data)[idx]; b2 = ((unsigned char*) b->data)[idx+1]; -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN res = b1 << 8 | b2; #else res = b2 << 8 | b1; @@ -811,7 +811,7 @@ CAMLprim value caml_ba_uint8_get32(value vb, value vind) b2 = ((unsigned char*) b->data)[idx+1]; b3 = ((unsigned char*) b->data)[idx+2]; b4 = ((unsigned char*) b->data)[idx+3]; -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN res = b1 << 24 | b2 << 16 | b3 << 8 | b4; #else res = b4 << 24 | b3 << 16 | b2 << 8 | b1; @@ -834,7 +834,7 @@ CAMLprim value caml_ba_uint8_get64(value vb, value vind) b6 = ((unsigned char*) b->data)[idx+5]; b7 = ((unsigned char*) b->data)[idx+6]; b8 = ((unsigned char*) b->data)[idx+7]; -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN res = (uint64_t) b1 << 56 | (uint64_t) b2 << 48 | (uint64_t) b3 << 40 | (uint64_t) b4 << 32 | (uint64_t) b5 << 24 | (uint64_t) b6 << 16 @@ -941,7 +941,7 @@ CAMLprim value caml_ba_uint8_set16(value vb, value vind, value newval) struct caml_ba_array * b = Caml_ba_array_val(vb); if (idx < 0 || idx >= b->dim[0] - 1) caml_array_bound_error(); val = Long_val(newval); -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN b1 = 0xFF & val >> 8; b2 = 0xFF & val; #else @@ -961,7 +961,7 @@ CAMLprim value caml_ba_uint8_set32(value vb, value vind, value newval) struct caml_ba_array * b = Caml_ba_array_val(vb); if (idx < 0 || idx >= b->dim[0] - 3) caml_array_bound_error(); val = Int32_val(newval); -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN b1 = 0xFF & val >> 24; b2 = 0xFF & val >> 16; b3 = 0xFF & val >> 8; @@ -987,7 +987,7 @@ CAMLprim value caml_ba_uint8_set64(value vb, value vind, value newval) struct caml_ba_array * b = Caml_ba_array_val(vb); if (idx < 0 || idx >= b->dim[0] - 7) caml_array_bound_error(); val = Int64_val(newval); -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN b1 = 0xFF & val >> 56; b2 = 0xFF & val >> 48; b3 = 0xFF & val >> 40; diff --git a/runtime/caml/compatibility.h b/runtime/caml/compatibility.h index 103170f13345..011876a886e4 100644 --- a/runtime/caml/compatibility.h +++ b/runtime/caml/compatibility.h @@ -17,6 +17,13 @@ #ifndef CAML_COMPATIBILITY_H #define CAML_COMPATIBILITY_H +#ifdef WORDS_BIGENDIAN +#define ARCH_BIG_ENDIAN 1 +#endif + +#define NO_NAKED_POINTERS 1 +#define CAML_SAFE_STRING 1 + #define HAS_STDINT_H 1 /* Deprecated since OCaml 5.3 */ /* HAS_NANOSECOND_STAT is deprecated since OCaml 5.3 */ @@ -33,4 +40,220 @@ #define HAS_UNISTD 1 #endif +#ifdef HAVE_AFUNIX_H +#define HAS_AFUNIX_H 1 +#endif + +#ifdef HAVE_DIRENT_H +#define HAS_DIRENT 1 +#endif + +#ifdef HAVE_PTHREAD_NP_H +#define HAS_PTHREAD_NP_H 1 +#endif + +#ifdef HAVE_SYS_MMAN_H +#define HAS_SYS_MMAN_H 1 +#endif + +#ifdef HAVE_SYS_SELECT_H +#define HAS_SYS_SELECT_H 1 +#endif + +#ifdef HAVE_SYS_SHM_H +#define HAS_SYS_SHM_H 1 +#endif + +#ifdef HAVE_ACCEPT4 +#define HAS_ACCEPT4 1 +#endif + +#ifdef HAVE_DUP3 +#define HAS_DUP3 1 +#endif + +#ifdef HAVE_EXECVPE +#define HAS_EXECVPE 1 +#endif + +#ifdef HAVE_GETAUXVAL +#define HAS_GETAUXVAL 1 +#endif + +#ifdef HAVE_GETCWD +#define HAS_GETCWD 1 +#endif + +#ifdef HAVE_GETENTROPY +#define HAS_GETENTROPY 1 +#endif + +#ifdef HAVE_GETGROUPS +#define HAS_GETGROUPS 1 +#endif + +#ifdef HAVE_GETRUSAGE +#define HAS_GETRUSAGE 1 +#endif + +#ifdef HAVE_GETHOSTNAME +#define HAS_GETHOSTNAME 1 +#endif + +#ifdef HAVE_GETTIMEOFDAY +#define HAS_GETTIMEOFDAY 1 +#endif + +#ifdef HAVE_INET_ATON +#define HAS_INET_ATON 1 +#endif + +#ifdef HAVE_INITGROUPS +#define HAS_INITGROUPS 1 +#endif + +#ifdef HAVE_ISSETUGID +#define HAS_ISSETUGID 1 +#endif + +#ifdef HAVE_LOCKF +#define HAS_LOCKF 1 +#endif + +#ifdef HAVE_MKFIFO +#define HAS_MKFIFO 1 +#endif + +#ifdef HAVE_MKSTEMP +#define HAS_MKSTEMP 1 +#endif + +#ifdef HAVE_MKTIME +#define HAS_MKTIME 1 +#endif + +#ifdef HAVE_NANOSLEEP +#define HAS_NANOSLEEP 1 +#endif + +#ifdef HAVE_NICE +#define HAS_NICE 1 +#endif + +#ifdef HAVE_PIPE2 +#define HAS_PIPE2 1 +#endif + +#ifdef HAVE_PUTENV +#define HAS_PUTENV 1 +#endif + +#ifdef HAVE_PWRITE +#define HAS_PWRITE 1 +#endif + +#ifdef HAVE_REALPATH +#define HAS_REALPATH 1 +#endif + +#ifdef HAVE_REWINDDIR +#define HAS_REWINDDIR 1 +#endif + +#ifdef HAVE_SECURE_GETENV +#define HAS_SECURE_GETENV 1 +#endif + +#ifdef HAVE___SECURE_GETENV +#define HAS___SECURE_GETENV 1 +#endif + +#ifdef HAVE_SETGROUPS +#define HAS_SETGROUPS 1 +#endif + +#ifdef HAVE_SETSID +#define HAS_SETSID 1 +#endif + +#ifdef HAVE_SETITIMER +#define HAS_SETITIMER 1 +#endif + +#ifdef HAVE_SHMAT +#define HAS_SHMAT 1 +#endif + +#ifdef HAVE_SOCKETPAIR +#define HAS_SOCKETPAIR 1 +#endif + +#ifdef HAVE_STRTOD_L +#define HAS_STRTOD_L 1 +#endif + +#ifdef HAVE_SYSTEM +#define HAS_SYSTEM 1 +#endif + +#ifdef HAVE_TIMES +#define HAS_TIMES 1 +#endif + +#ifdef HAVE_UNAME +#define HAS_UNAME 1 +#endif + +#ifdef HAVE_UTIMES +#define HAS_UTIMES 1 +#endif + +#ifdef HAVE_WAITPID +#define HAS_WAITPID 1 +#endif + +#ifdef HAVE_WAIT4 +#define HAS_WAIT4 1 +#endif + +#ifdef HAVE_SOCKLEN_T +#define HAS_SOCKLEN_T 1 +#endif + +#ifdef SIZEOF_LONG_P +#define SIZEOF_PTR SIZEOF_LONG_P +#endif + +#ifdef SIZEOF_LONG_LONG +#define SIZEOF_LONGLONG SIZEOF_LONG_LONG +#endif + +#ifdef HAVE_WORKING_FMA +#define HAS_WORKING_FMA 1 +#endif + +#ifdef HAVE_WORKING_ROUND +#define HAS_WORKING_ROUND 1 +#endif + +#ifdef HAVE_GETHOSTNAME +#define HAS_GETHOSTNAME 1 +#endif + +#ifdef HAVE_SOCKETS +#define HAS_SOCKETS 1 +#endif + +#ifdef HAVE_IPV6 +#define HAS_IPV6 1 +#endif + +#ifdef HAVE_BROKEN_PRINTF +#define HAS_BROKEN_PRINTF 1 +#endif + +#ifdef HAVE_ARCH_CODE32 +#define HAS_ARCH_CODE32 1 +#endif + #endif /* CAML_COMPATIBILITY_H */ diff --git a/runtime/caml/config.h b/runtime/caml/conf_post.h similarity index 96% rename from runtime/caml/config.h rename to runtime/caml/conf_post.h index 5aa62d6714b6..2b0f4fc04394 100644 --- a/runtime/caml/config.h +++ b/runtime/caml/conf_post.h @@ -13,11 +13,6 @@ /* */ /**************************************************************************/ -#ifndef CAML_CONFIG_H -#define CAML_CONFIG_H - -#include "m.h" -#include "s.h" #include "compatibility.h" /* CAML_NAME_SPACE was introduced in OCaml 3.08 to declare compatibility with @@ -31,11 +26,11 @@ /* If supported, tell gcc that we can use 32-bit code addresses for * threaded code, unless we are compiled for a shared library (-fPIC option) */ -#ifdef HAS_ARCH_CODE32 +#ifdef HAVE_ARCH_CODE32 #ifndef __PIC__ # define ARCH_CODE32 #endif /* __PIC__ */ -#endif /* HAS_ARCH_CODE32 */ +#endif /* HAVE_ARCH_CODE32 */ /* No longer used in the codebase, but kept because it was exported */ #define INT64_LITERAL(s) s ## LL @@ -106,7 +101,7 @@ #define ARCH_INT64_TYPE long #define ARCH_UINT64_TYPE unsigned long #define ARCH_INT64_PRINTF_FORMAT "l" - #elif SIZEOF_LONGLONG == 8 + #elif SIZEOF_LONG_LONG == 8 #define ARCH_INT64_TYPE long long #define ARCH_UINT64_TYPE unsigned long long #define ARCH_INT64_PRINTF_FORMAT "ll" @@ -115,17 +110,17 @@ #endif #endif -#if SIZEOF_PTR == SIZEOF_LONG +#if SIZEOF_LONG_P == SIZEOF_LONG /* Standard models: ILP32 or I32LP64 */ typedef long intnat; typedef unsigned long uintnat; #define ARCH_INTNAT_PRINTF_FORMAT "l" -#elif SIZEOF_PTR == SIZEOF_INT +#elif SIZEOF_LONG_P == SIZEOF_INT /* Hypothetical IP32L64 model */ typedef int intnat; typedef unsigned int uintnat; #define ARCH_INTNAT_PRINTF_FORMAT "" -#elif SIZEOF_PTR == 8 +#elif SIZEOF_LONG_P == 8 /* Win64 model: IL32P64 */ typedef int64_t intnat; typedef uint64_t uintnat; @@ -150,7 +145,7 @@ typedef uint64_t uintnat; #if defined(__arm__) && !defined(__ARM_EABI__) #define ARCH_FLOAT_ENDIANNESS 0x45670123 -#elif defined(ARCH_BIG_ENDIAN) +#elif defined(WORDS_BIGENDIAN) #define ARCH_FLOAT_ENDIANNESS 0x76543210 #else #define ARCH_FLOAT_ENDIANNESS 0x01234567 @@ -262,5 +257,3 @@ typedef uint64_t uintnat; #elif (!defined(NATIVE_CODE)) #define Cache_line_bsize 64 #endif - -#endif /* CAML_CONFIG_H */ diff --git a/runtime/caml/config.h.in b/runtime/caml/config.h.in new file mode 100644 index 000000000000..10d44e9a30fe --- /dev/null +++ b/runtime/caml/config.h.in @@ -0,0 +1,543 @@ +/* runtime/caml/config.h.in. Generated from configure.ac by autoheader. */ + +#ifndef CAML_CONFIG_H +#define CAML_CONFIG_H + +/* The normal alignment of 'double', in bytes. */ +#undef ALIGNOF_DOUBLE + +/* The normal alignment of 'long', in bytes. */ +#undef ALIGNOF_LONG + +/* The normal alignment of 'long long', in bytes. */ +#undef ALIGNOF_LONG_LONG + +/* TODO */ +#undef ARCH_ALIGN_DOUBLE + +/* TODO */ +#undef ARCH_ALIGN_INT64 + +/* TODO */ +#undef ARCH_SIXTYFOUR + +/* TODO */ +#undef ASM_CFI_SUPPORTED + +/* TODO */ +#undef CAML_WITH_FPIC + +/* TODO */ +#undef EXEC_FORMAT + +/* TODO */ +#undef EXEC_MAGIC_LENGTH + +/* TODO */ +#undef FLAT_FLOAT_ARRAY + +/* TODO */ +#undef FUNCTION_SECTIONS + +/* TODO */ +#undef HAS_BSD_GETAFFINITY_NP + +/* TODO */ +#undef HAS_C99_FLOAT_OPS + +/* TODO */ +#undef HAS_CLOCK_GETTIME_NSEC_NP + +/* TODO */ +#undef HAS_FCHMOD + +/* TODO */ +#undef HAS_FULL_THREAD_VARIABLES + +/* TODO */ +#undef HAS_GETHOSTBYADDR_R + +/* TODO */ +#undef HAS_GETHOSTBYNAME_R + +/* TODO */ +#undef HAS_GNU_GETAFFINITY_NP + +/* TODO */ +#undef HAS_HUGE_PAGES + +/* TODO */ +#undef HAS_LIBUNWIND + +/* TODO */ +#undef HAS_LOCALE_H + +/* TODO */ +#undef HAS_MMAP + +/* TODO */ +#undef HAS_POSIX_MONOTONIC_CLOCK + +/* TODO */ +#undef HAS_POSIX_SPAWN + +/* TODO */ +#undef HAS_SELECT + +/* TODO */ +#undef HAS_SETENV_UNSETENV + +/* TODO */ +#undef HAS_SYMLINK + +/* TODO */ +#undef HAS_TERMIOS + +/* TODO */ +#undef HAS_TRUNCATE + +/* TODO */ +#undef HAS_UTIME + +/* TODO */ +#undef HAS_XLOCALE_H + +/* TODO */ +#undef HAS_ZSTD + +/* Define to 1 if you have the 'accept' function. */ +#undef HAVE_ACCEPT + +/* Define to 1 if you have the 'accept4' function. */ +#undef HAVE_ACCEPT4 + +/* Define to 1 if you have the 'acosh' function. */ +#undef HAVE_ACOSH + +/* Define to 1 if you have the header file. */ +#undef HAVE_AFUNIX_H + +/* Define HAVE_ARCH_CODE32 if, on a 64-bit machine, code pointers fit in 32 + bits, i.e. the code segment resides in the low 4G of the addressing space. + HAVE_ARCH_CODE32 is ignored on 32-bit machines. */ +#undef HAVE_ARCH_CODE32 + +/* Define to 1 if you have the 'asinh' function. */ +#undef HAVE_ASINH + +/* Define to 1 if you have the 'atanh' function. */ +#undef HAVE_ATANH + +/* Define to 1 if you have the 'bind' function. */ +#undef HAVE_BIND + +/* Define if floats are printed as "Infinity" and "Inf" instead of the + expected "inf". */ +#undef HAVE_BROKEN_PRINTF + +/* Define to 1 if you have the 'cbrt' function. */ +#undef HAVE_CBRT + +/* Define to 1 if you have the 'clock_gettime_nsec_np' function. */ +#undef HAVE_CLOCK_GETTIME_NSEC_NP + +/* Define to 1 if you have the 'connect' function. */ +#undef HAVE_CONNECT + +/* Define to 1 if you have the 'copysign' function. */ +#undef HAVE_COPYSIGN + +/* Define to 1 if you have the declaration of 'SetThreadDescription', and to 0 + if you don't. */ +#undef HAVE_DECL_SETTHREADDESCRIPTION + +/* Define to 1 if you have the header file. */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the 'dup3' function. */ +#undef HAVE_DUP3 + +/* Define to 1 if you have the 'erf' function. */ +#undef HAVE_ERF + +/* Define to 1 if you have the 'erfc' function. */ +#undef HAVE_ERFC + +/* Define to 1 if you have the 'execvpe' function. */ +#undef HAVE_EXECVPE + +/* Define to 1 if you have the 'exp2' function. */ +#undef HAVE_EXP2 + +/* Define to 1 if you have the 'expm1' function. */ +#undef HAVE_EXPM1 + +/* Define to 1 if you have the 'fma' function. */ +#undef HAVE_FMA + +/* Define to 1 if you have the seven-argument form of gethostbyaddr_r(). */ +#undef HAVE_FUNC_GETHOSTBYADDR_R_7 + +/* Define to 1 if you have the eight-argument form of gethostbyaddr_r(). */ +#undef HAVE_FUNC_GETHOSTBYADDR_R_8 + +/* Define to 1 if you have the three-argument form of gethostbyname_r(). */ +#undef HAVE_FUNC_GETHOSTBYNAME_R_3 + +/* Define to 1 if you have the five-argument form of gethostbyname_r(). */ +#undef HAVE_FUNC_GETHOSTBYNAME_R_5 + +/* Define to 1 if you have the six-argument form of gethostbyname_r(). */ +#undef HAVE_FUNC_GETHOSTBYNAME_R_6 + +/* Define to 1 if you have the 'getaddrinfo' function. */ +#undef HAVE_GETADDRINFO + +/* Define to 1 if you have the 'getauxval' function. */ +#undef HAVE_GETAUXVAL + +/* Define to 1 if you have the 'getcwd' function. */ +#undef HAVE_GETCWD + +/* Define to 1 if you have the 'getentropy' function. */ +#undef HAVE_GETENTROPY + +/* Define to 1 if you have the 'getgroups' function. */ +#undef HAVE_GETGROUPS + +/* Define to 1 if you have some form of gethostbyaddr_r(). */ +#undef HAVE_GETHOSTBYADDR_R + +/* Define to 1 if you have some form of gethostbyname_r(). */ +#undef HAVE_GETHOSTBYNAME_R + +/* Define to 1 if you have the 'gethostname' function. */ +#undef HAVE_GETHOSTNAME + +/* Define to 1 if you have the 'getnameinfo' function. */ +#undef HAVE_GETNAMEINFO + +/* Define to 1 if you have the 'getrusage' function. */ +#undef HAVE_GETRUSAGE + +/* Define to 1 if you have the 'gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the 'hypot' function. */ +#undef HAVE_HYPOT + +/* Define to 1 if you have the 'inet_aton' function. */ +#undef HAVE_INET_ATON + +/* Define to 1 if you have the 'inet_ntop' function. */ +#undef HAVE_INET_NTOP + +/* Define to 1 if you have the 'inet_pton' function. */ +#undef HAVE_INET_PTON + +/* Define to 1 if you have the 'initgroups' function. */ +#undef HAVE_INITGROUPS + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if IPv6 is supported. */ +#undef HAVE_IPV6 + +/* Define to 1 if you have the 'issetugid' function. */ +#undef HAVE_ISSETUGID + +/* Define if the C compiler supports the labels as values extension. */ +#undef HAVE_LABELS_AS_VALUES + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_FUTEX_H + +/* Define to 1 if you have the 'listen' function. */ +#undef HAVE_LISTEN + +/* Define to 1 if you have the 'lockf' function. */ +#undef HAVE_LOCKF + +/* Define to 1 if you have the 'log1p' function. */ +#undef HAVE_LOG1P + +/* Define to 1 if you have the 'log2' function. */ +#undef HAVE_LOG2 + +/* Define to 1 if the system has the type 'max_align_t'. */ +#undef HAVE_MAX_ALIGN_T + +/* Define to 1 if you have the 'mkfifo' function. */ +#undef HAVE_MKFIFO + +/* Define to 1 if you have the 'mkstemp' function. */ +#undef HAVE_MKSTEMP + +/* Define to 1 if you have the 'mktime' function. */ +#undef HAVE_MKTIME + +/* Define to 1 if you have the 'nanosleep' function. */ +#undef HAVE_NANOSLEEP + +/* Define if you have nice(). */ +#undef HAVE_NICE + +/* Define to 1 if you have the 'pipe2' function. */ +#undef HAVE_PIPE2 + +/* Define to 1 if you have the 'prctl' function. */ +#undef HAVE_PRCTL + +/* Define to 1 if you have the header file. */ +#undef HAVE_PTHREAD_NP_H + +/* Have PTHREAD_PRIO_INHERIT. */ +#undef HAVE_PTHREAD_PRIO_INHERIT + +/* Define to 1 if you have the 'pthread_setname_np' function. */ +#undef HAVE_PTHREAD_SETNAME_NP + +/* Define to 1 if you have the 'pthread_set_name_np' function. */ +#undef HAVE_PTHREAD_SET_NAME_NP + +/* Define to 1 if you have the 'putenv' function. */ +#undef HAVE_PUTENV + +/* Define to 1 if you have the 'pwrite' function. */ +#undef HAVE_PWRITE + +/* Define to 1 if you have the 'realpath' function. */ +#undef HAVE_REALPATH + +/* Define to 1 if you have the 'rewinddir' function. */ +#undef HAVE_REWINDDIR + +/* Define to 1 if you have the 'round' function. */ +#undef HAVE_ROUND + +/* Define to 1 if you have the 'secure_getenv' function. */ +#undef HAVE_SECURE_GETENV + +/* Define to 1 if you have the 'setgroups' function. */ +#undef HAVE_SETGROUPS + +/* Define to 1 if you have the 'setitimer' function. */ +#undef HAVE_SETITIMER + +/* Define to 1 if you have the 'setsid' function. */ +#undef HAVE_SETSID + +/* Define to 1 if you have the 'SetThreadDescription' function. */ +#undef HAVE_SETTHREADDESCRIPTION + +/* Define to 1 if you have the 'shmat' function. */ +#undef HAVE_SHMAT + +/* Define to 1 if you have the 'socket' function. */ +#undef HAVE_SOCKET + +/* Define to 1 if you have the 'socketpair' function. */ +#undef HAVE_SOCKETPAIR + +/* Define if you have BSD sockets. */ +#undef HAVE_SOCKETS + +/* Define to 1 if the system has the type 'socklen_t'. */ +#undef HAVE_SOCKLEN_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the 'strtod_l' function. */ +#undef HAVE_STRTOD_L + +/* Define to 1 if 'st_atimensec' is a member of 'struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMENSEC + +/* Define to 1 if 'st_atimespec.tv_nsec' is a member of 'struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC + +/* Define to 1 if 'st_atim.tv_nsec' is a member of 'struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + +/* Define to 1 if you have the 'system' function. */ +#undef HAVE_SYSTEM + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MMAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SHM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the 'times' function. */ +#undef HAVE_TIMES + +/* Define to 1 if you have the 'trunc' function. */ +#undef HAVE_TRUNC + +/* Define to 1 if you have the 'uname' function. */ +#undef HAVE_UNAME + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the 'utimes' function. */ +#undef HAVE_UTIMES + +/* Define to 1 if you have the 'wait4' function. */ +#undef HAVE_WAIT4 + +/* Define to 1 if you have the 'waitpid' function. */ +#undef HAVE_WAITPID + +/* Define to 1 if 'fma' works. The newlib library (intentionally) simply + contains return x * y + z. This workaround is also used for + https://sourceforge.net/p/mingw-w64/bugs/848/ */ +#undef HAVE_WORKING_FMA + +/* Define to 1 if 'round' works. This workaround exists primarily for + https://sourceforge.net/p/mingw-w64/bugs/573/ */ +#undef HAVE_WORKING_ROUND + +/* Define to 1 if you have the '__secure_getenv' function. */ +#undef HAVE___SECURE_GETENV + +/* TODO */ +#undef HEADER_RESERVED_BITS + +/* TODO */ +#undef HUGE_PAGE_SIZE + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* TODO */ +#undef MAGIC_NUMBER_PREFIX + +/* TODO */ +#undef MAGIC_NUMBER_VERSION + +/* TODO */ +#undef OCAML_OS_TYPE + +/* TODO */ +#undef OCAML_VERSION + +/* TODO */ +#undef OCAML_VERSION_ADDITIONAL + +/* TODO */ +#undef OCAML_VERSION_EXTRA + +/* TODO */ +#undef OCAML_VERSION_MAJOR + +/* TODO */ +#undef OCAML_VERSION_MINOR + +/* TODO */ +#undef OCAML_VERSION_PATCHLEVEL + +/* TODO */ +#undef OCAML_VERSION_STRING + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* TODO */ +#undef POSIX_SIGNALS + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* The size of 'int', as computed by sizeof. */ +#undef SIZEOF_INT + +/* The size of 'long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* The size of 'long long', as computed by sizeof. */ +#undef SIZEOF_LONG_LONG + +/* The size of 'long *', as computed by sizeof. */ +#undef SIZEOF_LONG_P + +/* The size of 'short', as computed by sizeof. */ +#undef SIZEOF_SHORT + +/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#undef STDC_HEADERS + +/* TODO */ +#undef SUPPORTS_TREE_VECTORIZE + +/* TODO */ +#undef SUPPORT_DYNAMIC_LINKING + +/* Define to use mmap MAP_STACK. */ +#undef USE_MMAP_MAP_STACK + +/* TODO */ +#undef WITH_FRAME_POINTERS + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Define to 'long int' if does not define. */ +#undef off_t + +#include "conf_post.h" + +#endif /* CAML_CONFIG_H */ diff --git a/runtime/caml/m.h.in b/runtime/caml/m.h.in index d771d26083b6..d46401e7f770 100644 --- a/runtime/caml/m.h.in +++ b/runtime/caml/m.h.in @@ -22,11 +22,11 @@ Otherwise, leave ARCH_SIXTYFOUR undefined. This assumes sizeof(char *) = 4. */ -#undef ARCH_BIG_ENDIAN +#undef WORDS_BIGENDIAN -/* Define ARCH_BIG_ENDIAN if the processor is big endian (the most +/* Define WORDS_BIGENDIAN if the processor is big endian (the most significant byte of an integer stored in memory comes first). - Leave ARCH_BIG_ENDIAN undefined if the processor is little-endian + Leave WORDS_BIGENDIAN undefined if the processor is little-endian (the least significant byte comes first). */ @@ -36,22 +36,22 @@ doubleword-aligned. Leave ARCH_ALIGN_DOUBLE undefined if the processor supports word-aligned doubles. */ -#undef HAS_ARCH_CODE32 +#undef HAVE_ARCH_CODE32 -/* Define HAS_ARCH_CODE32 if, on a 64-bit machine, code pointers fit +/* Define HAVE_ARCH_CODE32 if, on a 64-bit machine, code pointers fit in 32 bits, i.e. the code segment resides in the low 4G of the addressing space. - HAS_ARCH_CODE32 is ignored on 32-bit machines. */ + HAVE_ARCH_CODE32 is ignored on 32-bit machines. */ #undef SIZEOF_INT #undef SIZEOF_LONG -#undef SIZEOF_PTR +#undef SIZEOF_LONG_P #undef SIZEOF_SHORT -#undef SIZEOF_LONGLONG +#undef SIZEOF_LONG_LONG -/* Define SIZEOF_INT, SIZEOF_LONG, SIZEOF_PTR, SIZEOF_SHORT and - SIZEOF_LONGLONG to the sizes in bytes of the C types "int", "long", - "char *", "short" and "long long" respectively. */ +/* Define SIZEOF_INT, SIZEOF_LONG, SIZEOF_LONG_P, SIZEOF_SHORT and + SIZEOF_LONG_LONG to the sizes in bytes of the C types "int", "long", + "long *", "short" and "long long" respectively. */ #undef ARCH_ALIGN_INT64 @@ -71,12 +71,8 @@ #undef WITH_FRAME_POINTERS -#define NO_NAKED_POINTERS 1 - #undef CAML_WITH_FPIC -#define CAML_SAFE_STRING 1 - #undef FLAT_FLOAT_ARRAY #undef FUNCTION_SECTIONS diff --git a/runtime/caml/mlvalues.h b/runtime/caml/mlvalues.h index 73eea54b3442..eb169d37dd3f 100644 --- a/runtime/caml/mlvalues.h +++ b/runtime/caml/mlvalues.h @@ -228,7 +228,7 @@ CAMLno_tsan_for_perf Caml_inline header_t Hd_val(value val) #define Reserved_val(val) (Reserved_hd (Hd_val (val))) -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN #define Tag_val(val) (((volatile unsigned char *) (val)) [-1]) /* Also an l-value. */ #define Tag_hp(hp) (((volatile unsigned char *) (hp)) [sizeof(value)-1]) diff --git a/runtime/caml/platform.h b/runtime/caml/platform.h index a282f8b02e3e..24515896abc0 100644 --- a/runtime/caml/platform.h +++ b/runtime/caml/platform.h @@ -150,7 +150,7 @@ void caml_plat_futex_free(caml_plat_futex*); fallback, even if a futex implementation is available. */ #ifndef CAML_PLAT_FUTEX_FALLBACK # if defined(_WIN32) \ - || (defined(__linux__) && defined(HAS_LINUX_FUTEX_H)) \ + || (defined(__linux__) && defined(HAVE_LINUX_FUTEX_H)) \ || defined(__FreeBSD__) || defined(__OpenBSD__) /* TODO We have implementations for these platforms, but they are currently untested, so use the fallback instead. diff --git a/runtime/caml/s.h.in b/runtime/caml/s.h.in index ca5c510c5070..f5a67488de89 100644 --- a/runtime/caml/s.h.in +++ b/runtime/caml/s.h.in @@ -55,68 +55,70 @@ exp2(), log2(), cbrt(), acosh(), asinh(), atanh(), erf(), erfc(), trunc(), round(), copysign(). */ -#undef HAS_WORKING_FMA +#undef HAVE_WORKING_FMA -/* Define HAS_WORKING_FMA if the fma function is correctly implemented. The - newlib library (intentionally) just has return x * y + z. This hatch is - also used for https://sourceforge.net/p/mingw-w64/bugs/848/ */ +/* Define HAVE_WORKING_FMA if the fma function is correctly implemented. + The newlib library (intentionally) just simply contains x * y + z. + This workaround is also used for + https://sourceforge.net/p/mingw-w64/bugs/848/ */ -#undef HAS_WORKING_ROUND +#undef HAVE_WORKING_ROUND -/* Define HAS_WORKING_ROUND is the round function is correctly implemented. This - hatch exists primarily for https://sourceforge.net/p/mingw-w64/bugs/573/ */ +/* Define HAVE_WORKING_ROUND if the round function is correctly implemented. + This workaround exists primarily for + https://sourceforge.net/p/mingw-w64/bugs/573/ */ -#undef HAS_GETENTROPY +#undef HAVE_GETENTROPY -#undef HAS_GETRUSAGE +#undef HAVE_GETRUSAGE -#undef HAS_TIMES +#undef HAVE_TIMES -#undef HAS_SECURE_GETENV +#undef HAVE_SECURE_GETENV -#undef HAS___SECURE_GETENV +#undef HAVE___SECURE_GETENV -#undef HAS_ISSETUGID +#undef HAVE_ISSETUGID -#undef HAS_SYS_MMAN_H +#undef HAVE_SYS_MMAN_H -#undef HAS_LINUX_FUTEX_H +#undef HAVE_LINUX_FUTEX_H /* 2. For the Unix library. */ -#undef HAS_SOCKETS +#undef HAVE_SOCKETS -/* Define HAS_SOCKETS if you have BSD sockets. */ +/* Define HAVE_SOCKETS if you have BSD sockets. */ -#undef HAS_SOCKETPAIR +#undef HAVE_SOCKETPAIR -/* Define HAS_SOCKETPAIR if you have the socketpair function. Only +/* Define HAVE_SOCKETPAIR if you have the socketpair function. Only relevant on Windows. */ -#undef HAS_SOCKLEN_T +#undef HAVE_SOCKLEN_T -/* Define HAS_SOCKLEN_T if the type socklen_t is defined in +/* Define HAVE_SOCKLEN_T if the type socklen_t is defined in /usr/include/sys/socket.h. */ -#undef HAS_AFUNIX_H +#undef HAVE_AFUNIX_H -/* Define HAS_AFUNIX_H if you have . */ +/* Define HAVE_AFUNIX_H if you have . */ -#undef HAS_INET_ATON +#undef HAVE_INET_ATON -#undef HAS_IPV6 +#undef HAVE_IPV6 -#undef HAS_PTHREAD_NP_H +#undef HAVE_PTHREAD_NP_H -#undef HAS_PRCTL +#undef HAVE_PRCTL -#undef HAS_PTHREAD_SETNAME_NP +#undef HAVE_PTHREAD_SETNAME_NP -#undef HAS_PTHREAD_SET_NAME_NP +#undef HAVE_PTHREAD_SET_NAME_NP -#undef HAS_SETTHREADDESCRIPTION +#undef HAVE_SETTHREADDESCRIPTION -#undef HAS_DECL_SETTHREADDESCRIPTION +#undef HAVE_DECL_SETTHREADDESCRIPTION #undef HAS_DIRENT @@ -125,31 +127,31 @@ Otherwise, we'll load /usr/include/sys/dir.h, and readdir() is expected to return a struct direct *. */ -#undef HAS_REWINDDIR +#undef HAVE_REWINDDIR -/* Define HAS_REWINDDIR if you have rewinddir(). */ +/* Define HAVE_REWINDDIR if you have rewinddir(). */ -#undef HAS_LOCKF +#undef HAVE_LOCKF -/* Define HAS_LOCKF if the library provides the lockf() function. */ +/* Define HAVE_LOCKF if the library provides the lockf() function. */ -#undef HAS_MKFIFO +#undef HAVE_MKFIFO -/* Define HAS_MKFIFO if the library provides the mkfifo() function. */ +/* Define HAVE_MKFIFO if the library provides the mkfifo() function. */ -#undef HAS_GETCWD +#undef HAVE_GETCWD -/* Define HAS_GETCWD if the library provides the getcwd() function. */ +/* Define HAVE_GETCWD if the library provides the getcwd() function. */ -#undef HAS_SYSTEM +#undef HAVE_SYSTEM -/* Define HAS_SYSTEM if the library provides the system() function. */ +/* Define HAVE_SYSTEM if the library provides the system() function. */ #undef HAS_UTIME -#undef HAS_UTIMES +#undef HAVE_UTIMES /* Define HAS_UTIME if you have /usr/include/utime.h and the library - provides utime(). Define HAS_UTIMES if the library provides utimes(). */ + provides utime(). Define HAVE_UTIMES if the library provides utimes(). */ #undef HAS_FCHMOD @@ -164,71 +166,71 @@ /* Define HAS_SELECT if you have select(). */ -#undef HAS_SYS_SELECT_H +#undef HAVE_SYS_SELECT_H -/* Define HAS_SYS_SELECT_H if /usr/include/sys/select.h exists +/* Define HAVE_SYS_SELECT_H if /usr/include/sys/select.h exists and should be included before using select(). */ -#undef HAS_NANOSLEEP -/* Define HAS_NANOSLEEP if you have nanosleep(). */ +#undef HAVE_NANOSLEEP +/* Define HAVE_NANOSLEEP if you have nanosleep(). */ #undef HAS_SYMLINK /* Define HAS_SYMLINK if you have symlink() and readlink() and lstat(). */ -#undef HAS_REALPATH -/* Define HAS_REALPATH if you have realpath(). */ +#undef HAVE_REALPATH +/* Define HAVE_REALPATH if you have realpath(). */ -#undef HAS_WAIT4 -#undef HAS_WAITPID +#undef HAVE_WAIT4 +#undef HAVE_WAITPID -/* Define HAS_WAIT4 if you have wait4(). - Define HAS_WAITPID if you have waitpid(). */ +/* Define HAVE_WAIT4 if you have wait4(). + Define HAVE_WAITPID if you have waitpid(). */ -#undef HAS_GETGROUPS +#undef HAVE_GETGROUPS -/* Define HAS_GETGROUPS if you have getgroups(). */ +/* Define HAVE_GETGROUPS if you have getgroups(). */ -#undef HAS_SETGROUPS +#undef HAVE_SETGROUPS -/* Define HAS_SETGROUPS if you have setgroups(). */ +/* Define HAVE_SETGROUPS if you have setgroups(). */ -#undef HAS_INITGROUPS +#undef HAVE_INITGROUPS -/* Define HAS_INITGROUPS if you have initgroups(). */ +/* Define HAVE_INITGROUPS if you have initgroups(). */ #undef HAS_TERMIOS /* Define HAS_TERMIOS if you have /usr/include/termios.h and it is Posix-compliant. */ -#undef HAS_SETITIMER +#undef HAVE_SETITIMER -/* Define HAS_SETITIMER if you have setitimer(). */ +/* Define HAVE_SETITIMER if you have setitimer(). */ -#undef HAS_GETHOSTNAME +#undef HAVE_GETHOSTNAME -/* Define HAS_GETHOSTNAME if you have gethostname(). */ +/* Define HAVE_GETHOSTNAME if you have gethostname(). */ -#undef HAS_UNAME +#undef HAVE_UNAME -/* Define HAS_UNAME if you have uname(). */ +/* Define HAVE_UNAME if you have uname(). */ -#undef HAS_GETTIMEOFDAY +#undef HAVE_GETTIMEOFDAY -/* Define HAS_GETTIMEOFDAY if you have gettimeofday(). */ +/* Define HAVE_GETTIMEOFDAY if you have gettimeofday(). */ -#undef HAS_MKTIME +#undef HAVE_MKTIME -/* Define HAS_MKTIME if you have mktime(). */ +/* Define HAVE_MKTIME if you have mktime(). */ -#undef HAS_SETSID +#undef HAVE_SETSID -/* Define HAS_SETSID if you have setsid(). */ +/* Define HAVE_SETSID if you have setsid(). */ -#undef HAS_PUTENV +#undef HAVE_PUTENV -/* Define HAS_PUTENV if you have putenv(). */ +/* Define HAVE_PUTENV if you have putenv(). */ #undef HAS_SETENV_UNSETENV @@ -244,16 +246,16 @@ /* Define HAS_XLOCALE_H if you have the include file and the uselocale() function. */ -#undef HAS_STRTOD_L +#undef HAVE_STRTOD_L -/* Define HAS_STRTOD_L if you have strtod_l */ +/* Define HAVE_STRTOD_L if you have strtod_l */ #undef HAS_MMAP /* Define HAS_MMAP if you have the include file and the functions mmap() and munmap(). */ -#undef HAS_PWRITE +#undef HAVE_PWRITE #undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC #undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC @@ -279,25 +281,25 @@ gethostbyaddr_r(): either 7 or 8 depending on prototype. (7 is the Solaris version, 8 is the Linux version). */ -#undef HAS_MKSTEMP +#undef HAVE_MKSTEMP -#undef HAS_NICE +#undef HAVE_NICE -/* Define HAS_NICE if you have nice(). */ +/* Define HAVE_NICE if you have nice(). */ -#undef HAS_DUP3 +#undef HAVE_DUP3 -#undef HAS_PIPE2 +#undef HAVE_PIPE2 -#undef HAS_ACCEPT4 +#undef HAVE_ACCEPT4 -#undef HAS_GETAUXVAL +#undef HAVE_GETAUXVAL -#undef HAS_SYS_SHM_H +#undef HAVE_SYS_SHM_H -#undef HAS_SHMAT +#undef HAVE_SHMAT -#undef HAS_EXECVPE +#undef HAVE_EXECVPE #undef HAS_POSIX_SPAWN @@ -307,7 +309,7 @@ #undef HAS_LIBUNWIND -#undef HAS_BROKEN_PRINTF +#undef HAVE_BROKEN_PRINTF #undef HAS_POSIX_MONOTONIC_CLOCK diff --git a/runtime/debugger.c b/runtime/debugger.c index 4d098b979582..2da0d7c54e1d 100644 --- a/runtime/debugger.c +++ b/runtime/debugger.c @@ -37,7 +37,7 @@ int caml_debugger_in_use = 0; uintnat caml_event_count; int caml_debugger_fork_mode = 1; /* parent by default */ -#if !defined(HAS_SOCKETS) || defined(NATIVE_CODE) +#if !defined(HAVE_SOCKETS) || defined(NATIVE_CODE) void caml_debugger_init(void) { @@ -83,14 +83,14 @@ CAMLexport void caml_debugger_cleanup_fork(void) #undef ATOM /* Code duplication with otherlibs/unix/socketaddr.h is inevitable * because pulling winsock2.h creates many naming conflicts. */ -#ifdef HAS_AFUNIX_H +#ifdef HAVE_AFUNIX_H #include #else struct sockaddr_un { ADDRESS_FAMILY sun_family; char sun_path[108]; }; -#endif /* HAS_AFUNIX_H */ +#endif /* HAVE_AFUNIX_H */ #include #endif /* _WIN32 */ diff --git a/runtime/domain.c b/runtime/domain.c index 7ec5675877d8..4a67d9ba65e2 100644 --- a/runtime/domain.c +++ b/runtime/domain.c @@ -30,7 +30,7 @@ #include #ifdef HAS_GNU_GETAFFINITY_NP #include -#ifdef HAS_PTHREAD_NP_H +#ifdef HAVE_PTHREAD_NP_H #include #endif #endif diff --git a/runtime/extern.c b/runtime/extern.c index dcb860957d75..cf52d68a380e 100644 --- a/runtime/extern.c +++ b/runtime/extern.c @@ -1193,7 +1193,7 @@ CAMLexport void caml_serialize_block_2(void * data, intnat len) struct caml_extern_state* s = get_extern_state (); if (s->extern_ptr + 2 * len > s->extern_limit) grow_extern_output(s, 2 * len); -#ifndef ARCH_BIG_ENDIAN +#ifndef WORDS_BIGENDIAN { unsigned char * p; char * q; @@ -1212,7 +1212,7 @@ CAMLexport void caml_serialize_block_4(void * data, intnat len) struct caml_extern_state* s = get_extern_state (); if (s->extern_ptr + 4 * len > s->extern_limit) grow_extern_output(s, 4 * len); -#ifndef ARCH_BIG_ENDIAN +#ifndef WORDS_BIGENDIAN { unsigned char * p; char * q; @@ -1231,7 +1231,7 @@ CAMLexport void caml_serialize_block_8(void * data, intnat len) struct caml_extern_state* s = get_extern_state (); if (s->extern_ptr + 8 * len > s->extern_limit) grow_extern_output(s, 8 * len); -#ifndef ARCH_BIG_ENDIAN +#ifndef WORDS_BIGENDIAN { unsigned char * p; char * q; diff --git a/runtime/fix_code.c b/runtime/fix_code.c index b6e5fde3fc1c..30bb359531b2 100644 --- a/runtime/fix_code.c +++ b/runtime/fix_code.c @@ -55,7 +55,7 @@ void caml_load_code(int fd, asize_t len) caml_fatal_error("truncated bytecode file"); caml_init_code_fragments(); /* Prepare the code for execution */ -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN caml_fixup_endianness(caml_start_code, caml_code_size); #endif #ifdef THREADED_CODE @@ -65,7 +65,7 @@ void caml_load_code(int fd, asize_t len) /* This code is needed only if the processor is big endian */ -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN void caml_fixup_endianness(code_t code, asize_t len) { diff --git a/runtime/floats.c b/runtime/floats.c index 0bc58e423bec..04c26437e78f 100644 --- a/runtime/floats.c +++ b/runtime/floats.c @@ -177,13 +177,13 @@ CAMLprim value caml_format_float(value fmt, value arg) value res; double d = Double_val(arg); -#ifdef HAS_BROKEN_PRINTF +#ifdef HAVE_BROKEN_PRINTF if (isfinite(d)) { #endif USE_LOCALE; res = caml_alloc_sprintf(String_val(fmt), d); RESTORE_LOCALE; -#ifdef HAS_BROKEN_PRINTF +#ifdef HAVE_BROKEN_PRINTF } else { if (isnan(d)) { res = caml_copy_string("nan"); @@ -403,13 +403,13 @@ CAMLprim value caml_float_of_string(value vs) if (sign < 0) d = -d; } else { /* Convert using strtod */ -#if defined(HAS_STRTOD_L) && defined(HAS_LOCALE) +#if defined(HAVE_STRTOD_L) && defined(HAS_LOCALE) d = strtod_l((const char *) buf, &end, caml_locale); #else USE_LOCALE; d = strtod((const char *) buf, &end); RESTORE_LOCALE; -#endif /* HAS_STRTOD_L */ +#endif /* HAVE_STRTOD_L */ if (end != dst) goto error; } if (buf != parse_buffer) caml_stat_free(buf); @@ -495,7 +495,7 @@ CAMLprim value caml_trunc_float(value f) CAMLexport double caml_round(double f) { -#ifdef HAS_WORKING_ROUND +#ifdef HAVE_WORKING_ROUND return round(f); #else union { uint64_t i; double d; } u, pred_one_half; /* predecessor of 0.5 */ @@ -538,7 +538,7 @@ CAMLprim value caml_nextafter_float(value x, value y) return caml_copy_double(caml_nextafter(Double_val(x), Double_val(y))); } -#ifndef HAS_WORKING_FMA +#ifndef HAVE_WORKING_FMA union double_as_int64 { double d; uint64_t i; }; #define IEEE754_DOUBLE_BIAS 0x3ff #define IEEE_EXPONENT(N) (((N) >> 52) & 0x7ff) @@ -555,7 +555,7 @@ union double_as_int64 { double d; uint64_t i; }; CAMLexport double caml_fma(double x, double y, double z) { -#ifdef HAS_WORKING_FMA +#ifdef HAVE_WORKING_FMA return fma(x, y, z); #else // Emulation of FMA, from S. Boldo and G. Melquiond, "Emulation // of a FMA and Correctly Rounded Sums: Proved Algorithms Using @@ -1059,7 +1059,7 @@ CAMLprim value caml_erfc_float(value f) union double_as_two_int32 { double d; -#if defined(ARCH_BIG_ENDIAN) || (defined(__arm__) && !defined(__ARM_EABI__)) +#if defined(WORDS_BIGENDIAN) || (defined(__arm__) && !defined(__ARM_EABI__)) struct { uint32_t h; uint32_t l; } i; #else struct { uint32_t l; uint32_t h; } i; diff --git a/runtime/hash.c b/runtime/hash.c index 017862265409..4fc74d37b758 100644 --- a/runtime/hash.c +++ b/runtime/hash.c @@ -90,7 +90,7 @@ CAMLexport uint32_t caml_hash_mix_double(uint32_t hash, double d) { union { double d; -#if defined(ARCH_BIG_ENDIAN) || (defined(__arm__) && !defined(__ARM_EABI__)) +#if defined(WORDS_BIGENDIAN) || (defined(__arm__) && !defined(__ARM_EABI__)) struct { uint32_t h; uint32_t l; } i; #else struct { uint32_t l; uint32_t h; } i; @@ -150,7 +150,7 @@ CAMLexport uint32_t caml_hash_mix_string(uint32_t h, value s) /* Mix by 32-bit blocks (little-endian) */ for (i = 0; i + 4 <= len; i += 4) { -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN w = Byte_u(s, i) | (Byte_u(s, i+1) << 8) | (Byte_u(s, i+2) << 16) diff --git a/runtime/intern.c b/runtime/intern.c index bc293b579d5d..a379dd9e0353 100644 --- a/runtime/intern.c +++ b/runtime/intern.c @@ -1149,7 +1149,7 @@ CAMLexport void caml_deserialize_block_1(void * data, intnat len) CAMLexport void caml_deserialize_block_2(void * data, intnat len) { struct caml_intern_state* s = get_intern_state (); -#ifndef ARCH_BIG_ENDIAN +#ifndef WORDS_BIGENDIAN const unsigned char * p, * q; for (p = s->intern_src, q = data; len > 0; len--, p += 2, q += 2) Reverse_16(q, p); @@ -1163,7 +1163,7 @@ CAMLexport void caml_deserialize_block_2(void * data, intnat len) CAMLexport void caml_deserialize_block_4(void * data, intnat len) { struct caml_intern_state* s = get_intern_state (); -#ifndef ARCH_BIG_ENDIAN +#ifndef WORDS_BIGENDIAN const unsigned char * p, * q; for (p = s->intern_src, q = data; len > 0; len--, p += 4, q += 4) Reverse_32(q, p); @@ -1177,7 +1177,7 @@ CAMLexport void caml_deserialize_block_4(void * data, intnat len) CAMLexport void caml_deserialize_block_8(void * data, intnat len) { struct caml_intern_state* s = get_intern_state (); -#ifndef ARCH_BIG_ENDIAN +#ifndef WORDS_BIGENDIAN const unsigned char * p, * q; for (p = s->intern_src, q = data; len > 0; len--, p += 8, q += 8) Reverse_64(q, p); diff --git a/runtime/lexing.c b/runtime/lexing.c index 16776869ad74..20d00eb87f43 100644 --- a/runtime/lexing.c +++ b/runtime/lexing.c @@ -50,7 +50,7 @@ struct lexing_table { value lex_code; }; -#if defined(ARCH_BIG_ENDIAN) || SIZEOF_SHORT != 2 +#if defined(WORDS_BIGENDIAN) || SIZEOF_SHORT != 2 #define Short(tbl,n) \ (*((unsigned char *)((tbl) + (n) * 2)) + \ (*((signed char *)((tbl) + (n) * 2 + 1)) << 8)) diff --git a/runtime/md5.c b/runtime/md5.c index 9f70b998251b..e2429331d6dc 100644 --- a/runtime/md5.c +++ b/runtime/md5.c @@ -105,7 +105,7 @@ CAMLexport void caml_md5_block(unsigned char digest[16], * will fill a supplied 16-byte array with the digest. */ -#ifndef ARCH_BIG_ENDIAN +#ifndef WORDS_BIGENDIAN #define byteReverse(buf, len) /* Nothing */ #else static void byteReverse(unsigned char * buf, unsigned longs) diff --git a/runtime/meta.c b/runtime/meta.c index ae19074e5fdb..519057a55f76 100644 --- a/runtime/meta.c +++ b/runtime/meta.c @@ -68,7 +68,7 @@ CAMLprim value caml_reify_bytecode(value ls_prog, prog = caml_stat_alloc(len + sizeof(opcode_t) * 2 /* for 'RETURN 1' */); memcpy(prog, Caml_ba_data_val(ls_prog), len); -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN caml_fixup_endianness(prog, len); #endif prog[len / sizeof(opcode_t)] = RETURN; diff --git a/runtime/parsing.c b/runtime/parsing.c index c50b96ae14ed..d793fa7dda44 100644 --- a/runtime/parsing.c +++ b/runtime/parsing.c @@ -65,7 +65,7 @@ struct parser_env { /* Mirrors parser_env in ../stdlib/parsing.ml */ value errflag; }; -#if defined(ARCH_BIG_ENDIAN) || SIZEOF_SHORT != 2 +#if defined(WORDS_BIGENDIAN) || SIZEOF_SHORT != 2 #define Short(tbl,n) \ (*((unsigned char *)((tbl) + (n) * 2)) + \ (*((signed char *)((tbl) + (n) * 2 + 1)) << 8)) diff --git a/runtime/platform.c b/runtime/platform.c index 0c780aff7b7a..edcf8c23098a 100644 --- a/runtime/platform.c +++ b/runtime/platform.c @@ -27,7 +27,7 @@ #include "caml/lf_skiplist.h" #include "caml/misc.h" #include "caml/signals.h" -#ifdef HAS_SYS_MMAN_H +#ifdef HAVE_SYS_MMAN_H #include #endif #ifdef _WIN32 diff --git a/runtime/power.S b/runtime/power.S index 88ebe2945162..eb4b2d87b976 100644 --- a/runtime/power.S +++ b/runtime/power.S @@ -13,7 +13,7 @@ /* */ /**************************************************************************/ -#include "caml/m.h" +#include "caml/config.h" #include "caml/asm.h" .abiversion 2 diff --git a/runtime/riscv.S b/runtime/riscv.S index 099a48a96435..205ea6df80ad 100644 --- a/runtime/riscv.S +++ b/runtime/riscv.S @@ -16,7 +16,7 @@ /* Asm part of the runtime system, RISC-V processor, 64-bit mode */ /* Must be preprocessed by cpp */ -#include "caml/m.h" +#include "caml/config.h" #include "caml/asm.h" #define DOMAIN_STATE_PTR s11 diff --git a/runtime/s390x.S b/runtime/s390x.S index 7ae504992cda..2c86ba30176f 100644 --- a/runtime/s390x.S +++ b/runtime/s390x.S @@ -15,7 +15,7 @@ /* */ /**************************************************************************/ -#include "caml/m.h" +#include "caml/config.h" #include "caml/asm.h" /* Special registers */ diff --git a/runtime/startup_byt.c b/runtime/startup_byt.c index ee9cfc63d4a3..c41408d13442 100644 --- a/runtime/startup_byt.c +++ b/runtime/startup_byt.c @@ -89,7 +89,7 @@ static void error(const char *msg, ...) static void fixup_endianness_trailer(uint32_t * p) { -#ifndef ARCH_BIG_ENDIAN +#ifndef WORDS_BIGENDIAN Reverse_32(p, p); #endif } @@ -399,7 +399,7 @@ static void do_print_config(void) "false"); #endif printf("supports_afl: %s\n", -#ifdef HAS_SYS_SHM_H +#ifdef HAVE_SYS_SHM_H "true"); #else "false"); diff --git a/runtime/str.c b/runtime/str.c index 6a86c898848b..7eca9246f768 100644 --- a/runtime/str.c +++ b/runtime/str.c @@ -118,7 +118,7 @@ CAMLprim value caml_string_get16(value str, value index) if (idx < 0 || idx + 1 >= caml_string_length(str)) caml_array_bound_error(); b1 = Byte_u(str, idx); b2 = Byte_u(str, idx + 1); -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN res = b1 << 8 | b2; #else res = b2 << 8 | b1; @@ -141,7 +141,7 @@ CAMLprim value caml_string_get32(value str, value index) b2 = Byte_u(str, idx + 1); b3 = Byte_u(str, idx + 2); b4 = Byte_u(str, idx + 3); -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN res = b1 << 24 | b2 << 16 | b3 << 8 | b4; #else res = b4 << 24 | b3 << 16 | b2 << 8 | b1; @@ -168,7 +168,7 @@ CAMLprim value caml_string_get64(value str, value index) b6 = Byte_u(str, idx + 5); b7 = Byte_u(str, idx + 6); b8 = Byte_u(str, idx + 7); -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN res = (uint64_t) b1 << 56 | (uint64_t) b2 << 48 | (uint64_t) b3 << 40 | (uint64_t) b4 << 32 | (uint64_t) b5 << 24 | (uint64_t) b6 << 16 @@ -194,7 +194,7 @@ CAMLprim value caml_bytes_set16(value str, value index, value newval) intnat idx = Long_val(index); if (idx < 0 || idx + 1 >= caml_string_length(str)) caml_array_bound_error(); val = Long_val(newval); -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN b1 = 0xFF & val >> 8; b2 = 0xFF & val; #else @@ -213,7 +213,7 @@ CAMLprim value caml_bytes_set32(value str, value index, value newval) intnat idx = Long_val(index); if (idx < 0 || idx + 3 >= caml_string_length(str)) caml_array_bound_error(); val = Int32_val(newval); -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN b1 = 0xFF & val >> 24; b2 = 0xFF & val >> 16; b3 = 0xFF & val >> 8; @@ -238,7 +238,7 @@ CAMLprim value caml_bytes_set64(value str, value index, value newval) intnat idx = Long_val(index); if (idx < 0 || idx + 7 >= caml_string_length(str)) caml_array_bound_error(); val = Int64_val(newval); -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN b1 = 0xFF & val >> 56; b2 = 0xFF & val >> 48; b3 = 0xFF & val >> 40; diff --git a/runtime/sys.c b/runtime/sys.c index 60df7828f466..14429da20855 100644 --- a/runtime/sys.c +++ b/runtime/sys.c @@ -36,17 +36,17 @@ #ifndef _WIN32 #include #endif -#ifdef HAS_TIMES +#ifdef HAVE_TIMES #include #endif -#ifdef HAS_GETRUSAGE +#ifdef HAVE_GETRUSAGE #include #include #endif -#ifdef HAS_GETTIMEOFDAY +#ifdef HAVE_GETTIMEOFDAY #include #endif -#if defined(HAS_GETENTROPY) && defined(__APPLE__) +#if defined(HAVE_GETENTROPY) && defined(__APPLE__) #include #endif #include "caml/alloc.h" @@ -404,11 +404,11 @@ CAMLprim value caml_sys_getcwd(value unit) { char_os buff[4096]; char_os * ret; -#ifdef HAS_GETCWD +#ifdef HAVE_GETCWD ret = getcwd_os(buff, sizeof(buff)/sizeof(*buff)); #else caml_invalid_argument("Sys.getcwd not implemented"); -#endif /* HAS_GETCWD */ +#endif /* HAVE_GETCWD */ if (ret == 0) caml_sys_error(NO_ARG); return caml_copy_string_of_os(buff); } @@ -535,7 +535,7 @@ void caml_sys_init(const char_os * exe_name, char_os **argv) #endif #endif -#ifdef HAS_SYSTEM +#ifdef HAVE_SYSTEM CAMLprim value caml_sys_system_command(value command) { CAMLparam1 (command); @@ -567,7 +567,7 @@ CAMLprim value caml_sys_system_command(value command) double caml_sys_time_include_children_unboxed(value include_children) { -#ifdef HAS_GETRUSAGE +#ifdef HAVE_GETRUSAGE struct rusage ru; double sec = 0.; @@ -583,7 +583,7 @@ double caml_sys_time_include_children_unboxed(value include_children) return sec; #else - #ifdef HAS_TIMES + #ifdef HAVE_TIMES #ifndef CLK_TCK #ifdef HZ #define CLK_TCK HZ @@ -632,7 +632,7 @@ int caml_unix_random_seed(intnat data[16]) int nread = 0; /* Try kernel entropy first */ -#ifdef HAS_GETENTROPY +#ifdef HAVE_GETENTROPY if (getentropy(buffer, sizeof(buffer)) != -1) { nread = sizeof(buffer); } else @@ -650,7 +650,7 @@ int caml_unix_random_seed(intnat data[16]) /* Otherwise, complement whatever we got (probably nothing) with some not-very-random data. */ -#ifdef HAS_GETTIMEOFDAY +#ifdef HAVE_GETTIMEOFDAY struct timeval tv; gettimeofday(&tv, NULL); if (n < 16) data[n++] = tv.tv_usec; @@ -682,7 +682,7 @@ CAMLprim value caml_sys_random_seed(value unit) CAMLprim value caml_sys_const_big_endian(value unit) { -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN return Val_true; #else return Val_false; @@ -740,7 +740,7 @@ CAMLprim value caml_sys_get_config(value unit) result = caml_alloc_small (3, 0); Field(result, 0) = ostype; Field(result, 1) = Val_long (8 * sizeof(value)); -#ifdef ARCH_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN Field(result, 2) = Val_true; #else Field(result, 2) = Val_false; diff --git a/runtime/unix.c b/runtime/unix.c index e58c77cf5170..464caeef69b2 100644 --- a/runtime/unix.c +++ b/runtime/unix.c @@ -28,7 +28,7 @@ #include #include #include "caml/config.h" -#ifdef HAS_GETTIMEOFDAY +#ifdef HAVE_GETTIMEOFDAY #include #endif #include @@ -57,7 +57,7 @@ #ifdef __APPLE__ #include #endif -#ifdef HAS_SYS_MMAN_H +#ifdef HAVE_SYS_MMAN_H #include #endif #include "caml/fail.h" @@ -405,11 +405,11 @@ char * caml_executable_name(void) char *caml_secure_getenv (char const *var) { -#ifdef HAS_SECURE_GETENV +#ifdef HAVE_SECURE_GETENV return secure_getenv (var); -#elif defined (HAS___SECURE_GETENV) +#elif defined (HAVE___SECURE_GETENV) return __secure_getenv (var); -#elif defined(HAS_ISSETUGID) +#elif defined(HAVE_ISSETUGID) if (!issetugid ()) return getenv(var); else @@ -432,7 +432,7 @@ uint64_t caml_time_counter(void) return (uint64_t) t.tv_sec * NSEC_PER_SEC + (uint64_t) t.tv_nsec; -#elif defined(HAS_GETTIMEOFDAY) +#elif defined(HAVE_GETTIMEOFDAY) struct timeval t; gettimeofday(&t, 0); return diff --git a/stdlib/header.c b/stdlib/header.c index 3e71883f0f4a..d0e60cdefdb2 100644 --- a/stdlib/header.c +++ b/stdlib/header.c @@ -20,7 +20,6 @@ #include #include #include -#include "caml/s.h" #ifndef _WIN32 #include #endif diff --git a/testsuite/tests/cxx-api/all-includes.h b/testsuite/tests/cxx-api/all-includes.h index 668619d38a43..d4afc8f9760a 100644 --- a/testsuite/tests/cxx-api/all-includes.h +++ b/testsuite/tests/cxx-api/all-includes.h @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -34,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/testsuite/tests/lib-unix/unix-execvpe/has-execvpe.sh b/testsuite/tests/lib-unix/unix-execvpe/has-execvpe.sh index 51707f108a11..b1ebaa597cd1 100755 --- a/testsuite/tests/lib-unix/unix-execvpe/has-execvpe.sh +++ b/testsuite/tests/lib-unix/unix-execvpe/has-execvpe.sh @@ -5,7 +5,7 @@ # It makes sense to run the tests only if execvpe is nt implemented. # If it is implemented, the test is skipped. -if grep -q "#define HAS_EXECVPE" ${ocamlsrcdir}/runtime/caml/s.h; then +if grep -q "#define HAVE_EXECVPE" ${ocamlsrcdir}/runtime/caml/config.h; then exit ${TEST_SKIP}; fi exit ${TEST_PASS} diff --git a/yacc/main.c b/yacc/main.c index 59cf02d5c223..34a269db6ba3 100644 --- a/yacc/main.c +++ b/yacc/main.c @@ -42,7 +42,7 @@ char_os temp_form[] = T("yacc.XXXXXXX"); #ifdef _WIN32 wchar_t dirsep = L'\\'; /* mingw provides an implementation of mkstemp, but it's ANSI only */ -#undef HAS_MKSTEMP +#undef HAVE_MKSTEMP #else char dirsep = '/'; #endif @@ -62,7 +62,7 @@ char_os *output_file_name; char_os *text_file_name; char_os *verbose_file_name; -#ifdef HAS_MKSTEMP +#ifdef HAVE_MKSTEMP int action_fd = -1, entry_fd = -1, text_fd = -1; #endif @@ -115,7 +115,7 @@ void done(int k) k = 1; } -#ifdef HAS_MKSTEMP +#ifdef HAVE_MKSTEMP if (action_fd != -1) unlink(action_file_name); if (entry_fd != -1) @@ -327,7 +327,7 @@ void create_file_names(void) entry_file_name[len + 5] = L'e'; text_file_name[len + 5] = L't'; -#ifdef HAS_MKSTEMP +#ifdef HAVE_MKSTEMP action_fd = mkstemp(action_file_name); if (action_fd == -1) open_error(action_file_name); @@ -385,7 +385,7 @@ void open_files(void) open_error(input_file_name); } -#ifdef HAS_MKSTEMP +#ifdef HAVE_MKSTEMP action_file = fdopen(action_fd, "w"); #else action_file = fopen_os(action_file_name, T("w")); @@ -393,7 +393,7 @@ void open_files(void) if (action_file == 0) open_error(action_file_name); -#ifdef HAS_MKSTEMP +#ifdef HAVE_MKSTEMP entry_file = fdopen(entry_fd, "w"); #else entry_file = fopen_os(entry_file_name, T("w")); @@ -401,7 +401,7 @@ void open_files(void) if (entry_file == 0) open_error(entry_file_name); -#ifdef HAS_MKSTEMP +#ifdef HAVE_MKSTEMP text_file = fdopen(text_fd, "w"); #else text_file = fopen_os(text_file_name, T("w"));