summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Hinderer <seb@tarides.com>2023-03-09 14:57:02 +0100
committerSébastien Hinderer <seb@tarides.com>2023-03-14 17:34:39 +0100
commit48fa4b79776b57d872aefc0ae547de2773fb0632 (patch)
treee86cbbcb4bf59e1e492292accf7a9de9cf34e640
parentb72b639e2ceade33e2237f73be926ba46897b5bf (diff)
downloadocaml-48fa4b79776b57d872aefc0ae547de2773fb0632.tar.gz
Make private build variables private
Given the convention that the OC_* build varialbes are reserved for the build system, it seems better to make sure all of them are defined in the private Makefile.build_config file, rather than in Makefile.config which gets installed and thus becomes public. This commit moves the definitions of OC_CFLAGS, OC_CPPFLAGS, OC_LDFLAGS, OC_DLL_LDFLAGS and OC_EXE_LDFLAGS from Makefile.config.in to Makefile.build_config.in. It also moves the defintion of MKEXE_VIA_CC, since this variable relies on private build varables and does not seem relevant or useful outside of the context of the build of the compiler itself.
-rw-r--r--Makefile.build_config.in14
-rw-r--r--Makefile.config.in11
2 files changed, 14 insertions, 11 deletions
diff --git a/Makefile.build_config.in b/Makefile.build_config.in
index 86433f90fa..2a909e2b24 100644
--- a/Makefile.build_config.in
+++ b/Makefile.build_config.in
@@ -50,6 +50,20 @@ INSTALL_OCAMLNAT = @install_ocamlnat@
DEP_CC=@DEP_CC@ -MM
COMPUTE_DEPS=@compute_deps@
+# Build-system flags to use to compile C files
+OC_CFLAGS=@oc_cflags@
+OC_CPPFLAGS=-I$(ROOTDIR)/runtime @oc_cppflags@
+
+# Additional link-time options
+# To support dynamic loading of shared libraries (they need to look at
+# our own symbols):
+OC_LDFLAGS=@oc_ldflags@
+OC_DLL_LDFLAGS=@oc_dll_ldflags@
+OC_EXE_LDFLAGS=@oc_exe_ldflags@
+
+MKEXE_VIA_CC=\
+ $(CC) $(OC_EXE_LDFLAGS) $(OC_CFLAGS) $(CFLAGS) @mkexe_via_cc_ldflags@
+
# Which tool to use to display differences between files
DIFF=@DIFF@
# Which flags to pass to the diff tool
diff --git a/Makefile.config.in b/Makefile.config.in
index c8d6966c40..d56dc96ecd 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -78,13 +78,6 @@ CC=@CC@
CC_HAS_DEBUG_PREFIX_MAP=@cc_has_debug_prefix_map@
AS_HAS_DEBUG_PREFIX_MAP=@as_has_debug_prefix_map@
-### Additional link-time options
-# To support dynamic loading of shared libraries (they need to look at
-# our own symbols):
-OC_LDFLAGS=@oc_ldflags@
-OC_DLL_LDFLAGS=@oc_dll_ldflags@
-OC_EXE_LDFLAGS=@oc_exe_ldflags@
-
LDFLAGS?=@LDFLAGS@
### How to invoke the C preprocessor through the C compiler
@@ -175,9 +168,7 @@ OTHERLIBRARIES=@otherlibraries@
UNIX_OR_WIN32=@unix_or_win32@
INSTALL_SOURCE_ARTIFACTS=@install_source_artifacts@
-OC_CFLAGS=@oc_cflags@
CFLAGS=@CFLAGS@
-OC_CPPFLAGS=-I$(ROOTDIR)/runtime @oc_cppflags@
CPPFLAGS=@CPPFLAGS@
OCAMLC_CFLAGS=@ocamlc_cflags@
@@ -214,8 +205,6 @@ MKEXE=@mkexe@
MKDLL=@mkdll@
MKMAINDLL=@mkmaindll@
MKEXEDEBUGFLAG=@mkexedebugflag@
-MKEXE_VIA_CC=\
- $(CC) $(OC_EXE_LDFLAGS) $(OC_CFLAGS) $(CFLAGS) @mkexe_via_cc_ldflags@
RUNTIMED=@debug_runtime@
INSTRUMENTED_RUNTIME=@instrumented_runtime@