summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Hinderer <seb@tarides.com>2023-03-09 18:19:18 +0100
committerSébastien Hinderer <seb@tarides.com>2023-03-14 17:34:39 +0100
commit6fd3475e124e21d4433556ffd4e19e80a66cfb0c (patch)
tree34a51fed78dbf920398cd7717696bdbba4a340af
parent0a7cbc8716c29388f6021f65fb25ffa57ca8286f (diff)
downloadocaml-6fd3475e124e21d4433556ffd4e19e80a66cfb0c.tar.gz
Make OC_NATIVE_CPPFLAGS configurable
This means moving its definition from Makefile.common to Makefile.build_config.in
-rw-r--r--Makefile.build_config.in12
-rw-r--r--Makefile.common7
2 files changed, 12 insertions, 7 deletions
diff --git a/Makefile.build_config.in b/Makefile.build_config.in
index d9e947ec32..88883d2cf5 100644
--- a/Makefile.build_config.in
+++ b/Makefile.build_config.in
@@ -54,6 +54,18 @@ COMPUTE_DEPS=@compute_deps@
OC_CFLAGS=@oc_cflags@
OC_CPPFLAGS=-I$(ROOTDIR)/runtime @oc_cppflags@
+# The following variable defines flags to be passed to the C preprocessor
+# when compiling C files to be linked with native code. This includes
+# the native runtime itself and can also include the stub code around
+# C libraries when it needs to be different from the one used to
+# link with bytecode.
+
+# 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)
+
# Additional link-time options
# To support dynamic loading of shared libraries (they need to look at
# our own symbols):
diff --git a/Makefile.common b/Makefile.common
index 5f2c4531b4..76e66a44dc 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -142,13 +142,6 @@ endif # ifeq "$(BOOTSTRAPPING_FLEXDLL)" "false"
# List of other libraries
ALL_OTHERLIBS = dynlink str systhreads unix runtime_events
-# The following variable defines flags to be passed to the C preprocessor
-# when compiling C files for the native runtime.
-# 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)
-
# Flags to pass to the C preprocessor when preprocessing assembly files
OC_ASPPFLAGS=-I $(ROOTDIR)/runtime $(OC_NATIVE_CPPFLAGS)