diff options
author | Sébastien Hinderer <seb@tarides.com> | 2023-03-09 18:32:12 +0100 |
---|---|---|
committer | Sébastien Hinderer <seb@tarides.com> | 2023-03-14 17:34:39 +0100 |
commit | 74d164a8fbbec113d951710708dc2ba8114a79d2 (patch) | |
tree | 75a822c9ef17ca45efa77fa708e6e73cf6001f99 | |
parent | 6fd3475e124e21d4433556ffd4e19e80a66cfb0c (diff) | |
download | ocaml-74d164a8fbbec113d951710708dc2ba8114a79d2.tar.gz |
Compute OC_NATIVE_CPPFLAGS during configure rather than during build
-rw-r--r-- | Makefile.build_config.in | 3 | ||||
-rwxr-xr-x | configure | 4 | ||||
-rw-r--r-- | configure.ac | 3 |
3 files changed, 8 insertions, 2 deletions
diff --git a/Makefile.build_config.in b/Makefile.build_config.in index 88883d2cf5..0429921e2b 100644 --- a/Makefile.build_config.in +++ b/Makefile.build_config.in @@ -63,8 +63,7 @@ OC_CPPFLAGS=-I$(ROOTDIR)/runtime @oc_cppflags@ # These flags should be passed *in addition* to those in OC_CPPFLAGS, they # should not replace them. -OC_NATIVE_CPPFLAGS=\ - -DNATIVE_CODE -DTARGET_$(ARCH) -DMODEL_$(MODEL) -DSYS_$(SYSTEM) +OC_NATIVE_CPPFLAGS=-DNATIVE_CODE @native_cppflags@ # Additional link-time options # To support dynamic loading of shared libraries (they need to look at @@ -876,6 +876,7 @@ ln unix_or_win32 ocamlsrcdir systhread_support +native_cppflags system model arch64 @@ -3353,6 +3354,7 @@ OCAML_VERSION_SHORT=5.1 + # TODO: rename this variable @@ -15447,6 +15449,8 @@ fi; system=elf ;; #( ;; esac +native_cppflags="-DTARGET_${arch} -DMODEL_${model} -DSYS_${system}" + case $ccomptype in #( msvc) : runtime_asm_objects=${arch}nt.${OBJEXT} ;; #( diff --git a/configure.ac b/configure.ac index e4943d23e5..44c8c3b9c5 100644 --- a/configure.ac +++ b/configure.ac @@ -115,6 +115,7 @@ AC_SUBST([arch]) AC_SUBST([arch64]) AC_SUBST([model]) AC_SUBST([system]) +AC_SUBST([native_cppflags]) AC_SUBST([systhread_support]) AC_SUBST([ocamlsrcdir]) AC_SUBST([unix_or_win32]) @@ -1273,6 +1274,8 @@ AS_CASE([$host], [has_native_backend=yes; arch=riscv; model=riscv64; system=linux] ) +native_cppflags="-DTARGET_${arch} -DMODEL_${model} -DSYS_${system}" + AS_CASE([$ccomptype], [msvc], [runtime_asm_objects=${arch}nt.${OBJEXT}], |