···8686 CFLAGS="$saved_CFLAGS"
8787])
88888989+AC_DEFUN([OCAML_CC_SUPPORTS_ALIGNED], [
9090+ AC_MSG_CHECKING([whether the C compiler supports __attribute__((aligned(n)))])
9191+ AC_COMPILE_IFELSE(
9292+ [AC_LANG_SOURCE([typedef struct {__attribute__((aligned(8))) int t;} t;])],
9393+ [AC_DEFINE([SUPPORTS_ALIGNED_ATTRIBUTE])
9494+ AC_MSG_RESULT([yes])],
9595+ [AC_MSG_RESULT([no])])])
9696+8997AC_DEFUN([OCAML_CC_HAS_DEBUG_PREFIX_MAP], [
9098 AC_MSG_CHECKING([whether the C compiler supports -fdebug-prefix-map])
9199 saved_CFLAGS="$CFLAGS"
+66-101
configure
···11#! /bin/sh
22-33-if test -e '.git' ; then :
44- if test -z "$ac_read_git_config" ; then :
55- extra_args=$(git config ocaml.configure 2>/dev/null)
66- extended_cache=$(git config ocaml.configure-cache 2>/dev/null)
77- cache_file=
88-99- # If ocaml.configure-cache is set, parse the command-line for the --host
1010- # option, in order to determine the name of the cache file.
1111- if test -n "$extended_cache" ; then :
1212- echo "Detected Git configuration option ocaml.configure-cache set to \
1313-\"$extended_cache\""
1414- dashdash=
1515- prev=
1616- host=default
1717- # The logic here is pretty borrowed from autoconf's
1818- for option in $extra_args "$@"
1919- do
2020- if test -n "$prev" ; then :
2121- host=$option
2222- continue
2323- fi
2424-2525- case $dashdash$option in
2626- --)
2727- dashdash=yes ;;
2828- -host | --host | --hos | --ho)
2929- prev=host ;;
3030- -host=* | --host=* | --hos=* | --ho=*)
3131- case $option in
3232- *=?*) host=$(expr "X$option" : '[^=]*=\(.*\)') ;;
3333- *=) host= ;;
3434- esac ;;
3535- esac
3636- done
3737- cache_file="`dirname "$0"`/$extended_cache/ocaml-$host.cache"
3838- fi
3939-4040- # If either option has a value, re-invoke configure
4141- if test -n "$extra_args$cache_file" ; then :
4242- echo "Detected Git configuration option ocaml.configure set to \
4343-\"$extra_args\""
4444- # Too much effort to get the echo to show appropriate quoting - the
4545- # invocation itself intentionally quotes $0 and passes $@ exactly as given
4646- # but allows a single expansion of ocaml.configure
4747- if test -n "$cache_file" ; then :
4848- echo "Re-running $0 $extra_args --cache-file \"$cache_file\" $@"
4949- ac_read_git_config=true exec "$0" $extra_args \
5050- --cache-file "$cache_file" "$@"
5151- else
5252- echo "Re-running $0 $extra_args $@"
5353- ac_read_git_config=true exec "$0" $extra_args "$@"
5454- fi
5555- fi
5656- fi
5757-fi
582# Guess values for system-dependent variables and create Makefiles.
593# Generated by GNU Autoconf 2.69 for OCaml 4.11.0+dev0-2019-10-18.
604#
···1229112235 ;;
1229212236esac
12293122371223812238+## Find vendor of the C compiler
1223912239+1224012240+1224112241+1224212242+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking C compiler vendor" >&5
1224312243+$as_echo_n "checking C compiler vendor... " >&6; }
1224412244+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1224512245+/* end confdefs.h. */
1224612246+1224712247+#if defined(_MSC_VER)
1224812248+msvc _MSC_VER
1224912249+#elif defined(__INTEL_COMPILER)
1225012250+icc __INTEL_COMPILER
1225112251+#elif defined(__clang_major__) && defined(__clang_minor__)
1225212252+clang __clang_major__ __clang_minor__
1225312253+#elif defined(__GNUC__) && defined(__GNUC_MINOR__)
1225412254+gcc __GNUC__ __GNUC_MINOR__
1225512255+#elif defined(__xlc__) && defined(__xlC__)
1225612256+xlc __xlC__ __xlC_ver__
1225712257+#else
1225812258+unknown
1225912259+#endif
1226012260+1226112261+_ACEOF
1226212262+if ac_fn_c_try_cpp "$LINENO"; then :
1226312263+ if ${ocaml_cv_cc_vendor+:} false; then :
1226412264+ $as_echo_n "(cached) " >&6
1226512265+else
1226612266+ ocaml_cv_cc_vendor=`grep '^[a-z]' conftest.i | tr -s ' ' '-'`
1226712267+fi
1226812268+1226912269+else
1227012270+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1227112271+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1227212272+as_fn_error $? "unexpected preprocessor failure
1227312273+See \`config.log' for more details" "$LINENO" 5; }
1227412274+fi
1227512275+rm -f conftest.err conftest.i conftest.$ac_ext
1227612276+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_cc_vendor" >&5
1227712277+$as_echo "$ocaml_cv_cc_vendor" >&6; }
1227812278+1227912279+1229412280# Determine how to call the C preprocessor directly.
1229512281# Most of the time, calling the C preprocessor through the C compiler is
1229612282# desirable and even important.
···1230212288# We thus figure out how to invoke the C preprocessor directly but
1230312289# let the CPP variable untouched, except for the MSVC port where we set it
1230412290# manually to make sure the backward compatibility is preserved
1230512305-case $host in #(
1230612306- *-pc-windows) :
1229112291+case $ocaml_cv_cc_vendor in #(
1229212292+ xlc-*) :
1229312293+ CPP="$CC -E -qnoppline" ;; #(
1229412294+ # suppress incompatible XLC line directives
1229512295+ msvc-*) :
1230712296 CPP="$CC -nologo -EP" ;; #(
1230812297 *) :
1230912298 ;;
···1240712396## Check for C99 support: done by libtool
1240812397## AC_PROG_CC_C99
12409123981241012410-## Find vendor of the C compiler
1241112411-1241212412-1241312413-1241412414- { $as_echo "$as_me:${as_lineno-$LINENO}: checking C compiler vendor" >&5
1241512415-$as_echo_n "checking C compiler vendor... " >&6; }
1241612416- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1241712417-/* end confdefs.h. */
1241812418-1241912419-#if defined(_MSC_VER)
1242012420-msvc _MSC_VER
1242112421-#elif defined(__INTEL_COMPILER)
1242212422-icc __INTEL_COMPILER
1242312423-#elif defined(__clang_major__) && defined(__clang_minor__)
1242412424-clang __clang_major__ __clang_minor__
1242512425-#elif defined(__GNUC__) && defined(__GNUC_MINOR__)
1242612426-gcc __GNUC__ __GNUC_MINOR__
1242712427-#elif defined(__xlc__) && defined(__xlC__)
1242812428-xlc __xlC__ __xlC_ver__
1242912429-#else
1243012430-unknown
1243112431-#endif
1243212432-1243312433-_ACEOF
1243412434-if ac_fn_c_try_cpp "$LINENO"; then :
1243512435- if ${ocaml_cv_cc_vendor+:} false; then :
1243612436- $as_echo_n "(cached) " >&6
1243712437-else
1243812438- ocaml_cv_cc_vendor=`grep '^[a-z]' conftest.i | tr -s ' ' '-'`
1243912439-fi
1244012440-1244112441-else
1244212442- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1244312443-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1244412444-as_fn_error $? "unexpected preprocessor failure
1244512445-See \`config.log' for more details" "$LINENO" 5; }
1244612446-fi
1244712447-rm -f conftest.err conftest.i conftest.$ac_ext
1244812448- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_cc_vendor" >&5
1244912449-$as_echo "$ocaml_cv_cc_vendor" >&6; }
1245012450-1245112451-1245212399## Determine which flags to use for the C compiler
12453124001245412401case $ocaml_cv_cc_vendor in #(
···1245612403 outputobj='-o $(EMPTY)'; gcc_warnings="-qflag=i:i" ;; #(
1245712404 # all warnings enabled
1245812405 msvc-*) :
1245912459- outputobj=-Fo; CPP="cl -nologo -EP"; gcc_warnings="" ;; #(
1240612406+ outputobj=-Fo; gcc_warnings="" ;; #(
1246012407 *) :
1246112408 outputobj='-o $(EMPTY)'; case 4.11.0+dev0-2019-10-18 in #(
1246212409 *+dev*) :
···1354113488 *) :
1354213489 ;;
1354313490esac
1349113491+1349213492+1349313493+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler supports __attribute__((aligned(n)))" >&5
1349413494+$as_echo_n "checking whether the C compiler supports __attribute__((aligned(n)))... " >&6; }
1349513495+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1349613496+/* end confdefs.h. */
1349713497+typedef struct {__attribute__((aligned(8))) int t;} t;
1349813498+_ACEOF
1349913499+if ac_fn_c_try_compile "$LINENO"; then :
1350013500+ $as_echo "#define SUPPORTS_ALIGNED_ATTRIBUTE 1" >>confdefs.h
1350113501+1350213502+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1350313503+$as_echo "yes" >&6; }
1350413504+else
1350513505+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1350613506+$as_echo "no" >&6; }
1350713507+fi
1350813508+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13544135091354513510# Configure the native-code compiler
1354613511
+10-6
configure.ac
···436436 mklib="rm -f \$(1) && ${AR} rc \$(1) \$(2) && ${RANLIB} \$(1)"
437437 ])
438438439439+## Find vendor of the C compiler
440440+OCAML_CC_VENDOR
441441+439442# Determine how to call the C preprocessor directly.
440443# Most of the time, calling the C preprocessor through the C compiler is
441444# desirable and even important.
···447450# We thus figure out how to invoke the C preprocessor directly but
448451# let the CPP variable untouched, except for the MSVC port where we set it
449452# manually to make sure the backward compatibility is preserved
450450-AS_CASE([$host],
451451- [*-pc-windows],
453453+AS_CASE([$ocaml_cv_cc_vendor],
454454+ [xlc-*],
455455+ [CPP="$CC -E -qnoppline"], # suppress incompatible XLC line directives
456456+ [msvc-*],
452457 [CPP="$CC -nologo -EP"])
453458454459# Libraries to build depending on the host
···513518## Check for C99 support: done by libtool
514519## AC_PROG_CC_C99
515520516516-## Find vendor of the C compiler
517517-OCAML_CC_VENDOR
518518-519521## Determine which flags to use for the C compiler
520522521523AS_CASE([$ocaml_cv_cc_vendor],
522524 [xlc-*],
523525 [outputobj='-o $(EMPTY)'; gcc_warnings="-qflag=i:i"], # all warnings enabled
524526 [msvc-*],
525525- [outputobj=-Fo; CPP="cl -nologo -EP"; gcc_warnings=""],
527527+ [outputobj=-Fo; gcc_warnings=""],
526528 [outputobj='-o $(EMPTY)'; AS_CASE([AC_PACKAGE_VERSION],
527529 [*+dev*],
528530 [gcc_warnings="-Wall -Werror"],
···842844 [OCAML_CC_HAS_FNO_TREE_VRP
843845 AS_IF([$cc_has_fno_tree_vrp],
844846 [internal_cflags="$internal_cflags -fno-tree-vrp"])])
847847+848848+OCAML_CC_SUPPORTS_ALIGNED
845849846850# Configure the native-code compiler
847851
···9595#define CAMLweakdef
9696#endif
97979898-/* Alignment */
9999-#ifdef __GNUC__
9898+/* Alignment is necessary for domain_state.h, since the code generated */
9999+/* by ocamlopt makes direct references into the domain state structure,*/
100100+/* which is stored in a register on many platforms. For this to work, */
101101+/* we need to be able to compute the exact offset of each member. */
102102+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
103103+#define CAMLalign(n) _Alignas(n)
104104+#elif defined(SUPPORTS_ALIGNED_ATTRIBUTE)
100105#define CAMLalign(n) __attribute__((aligned(n)))
101106#elif _MSC_VER >= 1500
102107#define CAMLalign(n) __declspec(align(n))