summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Hinderer <seb@tarides.com>2023-03-09 17:22:47 +0100
committerSébastien Hinderer <seb@tarides.com>2023-03-14 17:34:39 +0100
commit0a7cbc8716c29388f6021f65fb25ffa57ca8286f (patch)
treefb856edb96568aa5cf4a324d5e46440c36ef86e7
parent48fa4b79776b57d872aefc0ae547de2773fb0632 (diff)
downloadocaml-0a7cbc8716c29388f6021f65fb25ffa57ca8286f.tar.gz
Rename a few private build variables
The renamings done in this commit are: OC_COMMON_CFLAGS -> OC_COMMON_COMPFLAGS OC_COMMON_LDFLAGS -> OC_COMMON_LINKFLAGS OC_BYTECODE_LDFLAGS -> OC_BYTECODE_LINKFLAGS OC_NATIVE_CFLAGS -> OC_NATIVE_COMPFLAGS OC_NATIVE_LDFLAGS -> OC_NATIVE_LINKFLAGS
-rw-r--r--Makefile28
-rw-r--r--Makefile.build_config.in24
-rw-r--r--Makefile.common4
-rw-r--r--Makefile.menhir2
-rwxr-xr-xconfigure6
-rw-r--r--configure.ac6
6 files changed, 36 insertions, 34 deletions
diff --git a/Makefile b/Makefile
index c66028733c..bd57f60e67 100644
--- a/Makefile
+++ b/Makefile
@@ -474,9 +474,9 @@ ocamlc_LIBRARIES = $(addprefix compilerlibs/,ocamlcommon ocamlbytecomp)
ocamlc_MODULES = driver/main
-ocamlc$(EXE): OC_BYTECODE_LDFLAGS += -compat-32 -g
+ocamlc$(EXE): OC_BYTECODE_LINKFLAGS += -compat-32 -g
-ocamlc.opt$(EXE): OC_NATIVE_LDFLAGS += $(addprefix -cclib ,$(BYTECCLIBS))
+ocamlc.opt$(EXE): OC_NATIVE_LINKFLAGS += $(addprefix -cclib ,$(BYTECCLIBS))
partialclean::
rm -f ocamlc ocamlc.exe ocamlc.opt ocamlc.opt.exe
@@ -487,7 +487,7 @@ ocamlopt_LIBRARIES = $(addprefix compilerlibs/,ocamlcommon ocamloptcomp)
ocamlopt_MODULES = driver/optmain
-ocamlopt$(EXE): OC_BYTECODE_LDFLAGS += -g
+ocamlopt$(EXE): OC_BYTECODE_LINKFLAGS += -g
partialclean::
rm -f ocamlopt ocamlopt.exe ocamlopt.opt ocamlopt.opt.exe
@@ -500,7 +500,7 @@ ocaml_LIBRARIES = \
ocaml_MODULES = toplevel/topstart
.INTERMEDIATE: ocaml.tmp
-ocaml.tmp: OC_BYTECODE_LDFLAGS += -I toplevel/byte -linkall -g
+ocaml.tmp: OC_BYTECODE_LINKFLAGS += -I toplevel/byte -linkall -g
ocaml.tmp: $(ocaml_LIBRARIES:=.cma) $(ocaml_MODULES:=.cmo)
$(V_LINKC)$(LINK_BYTECODE_PROGRAM) -o $@ $^
@@ -1119,7 +1119,7 @@ ocamllex: ocamlyacc
ocamllex.opt: ocamlopt
$(MAKE) lex-allopt
-lex/ocamllex$(EXE): OC_BYTECODE_LDFLAGS += -compat-32
+lex/ocamllex$(EXE): OC_BYTECODE_LINKFLAGS += -compat-32
partialclean::
rm -f lex/*.cm* lex/*.o lex/*.obj
@@ -1364,7 +1364,7 @@ partialclean::
ocamldep_LIBRARIES = $(addprefix compilerlibs/,ocamlcommon ocamlbytecomp)
ocamldep_MODULES = tools/ocamldep
-tools/ocamldep$(EXE): OC_BYTECODE_LDFLAGS += -compat-32
+tools/ocamldep$(EXE): OC_BYTECODE_LINKFLAGS += -compat-32
# The profiler
@@ -1456,10 +1456,10 @@ ocamltex_MODULES = tools/ocamltex
# Note: the following definitions apply to all the prerequisites
# of ocamltex.
$(ocamltex): CAMLC = $(OCAMLRUN) $(ROOTDIR)/ocamlc$(EXE) $(STDLIBFLAGS)
-$(ocamltex): OC_COMMON_LDFLAGS += -linkall
+$(ocamltex): OC_COMMON_LINKFLAGS += -linkall
$(ocamltex): VPATH += $(addprefix otherlibs/,str unix)
-tools/ocamltex.cmo: OC_COMMON_CFLAGS += -no-alias-deps
+tools/ocamltex.cmo: OC_COMMON_COMPFLAGS += -no-alias-deps
# we need str and unix which depend on the bytecode version of other tools
# thus we use the othertools target
@@ -1506,13 +1506,15 @@ ocamlnat_LIBRARIES = \
ocamlnat_MODULES = $(ocaml_MODULES)
-ocamlnat$(EXE): OC_NATIVE_LDFLAGS += -linkall -I toplevel/native
+ocamlnat$(EXE): OC_NATIVE_LINKFLAGS += -linkall -I toplevel/native
COMPILE_NATIVE_MODULE = \
- $(CAMLOPT_CMD) $(OC_COMMON_CFLAGS) -I $(@D) $(INCLUDES) $(OC_NATIVE_CFLAGS)
+ $(CAMLOPT_CMD) $(OC_COMMON_COMPFLAGS) -I $(@D) $(INCLUDES) \
+ $(OC_NATIVE_COMPFLAGS)
+
toplevel/topdirs.cmx toplevel/toploop.cmx $(ocamlnat_MODULES:=.cmx): \
- OC_NATIVE_CFLAGS += -I toplevel/native
+ OC_NATIVE_COMPFLAGS += -I toplevel/native
toplevel/toploop.cmx: toplevel/native/topeval.cmx
@@ -1544,10 +1546,10 @@ endif
# Default rules
%.cmo: %.ml
- $(V_OCAMLC)$(CAMLC) $(OC_COMMON_CFLAGS) -I $(@D) $(INCLUDES) -c $<
+ $(V_OCAMLC)$(CAMLC) $(OC_COMMON_COMPFLAGS) -I $(@D) $(INCLUDES) -c $<
%.cmi: %.mli
- $(V_OCAMLC)$(CAMLC) $(OC_COMMON_CFLAGS) -I $(@D) $(INCLUDES) -c $<
+ $(V_OCAMLC)$(CAMLC) $(OC_COMMON_COMPFLAGS) -I $(@D) $(INCLUDES) -c $<
%.cmx: %.ml
$(V_OCAMLOPT)$(COMPILE_NATIVE_MODULE) -c $<
diff --git a/Makefile.build_config.in b/Makefile.build_config.in
index 2a909e2b24..d9e947ec32 100644
--- a/Makefile.build_config.in
+++ b/Makefile.build_config.in
@@ -103,9 +103,9 @@ DEFAULT_BUILD_TARGET = @default_build_target@
# The names of the variables below take the form XXX_YYY_ZZZ where
#
-# XXX is one of OC, OCAML or the name of a module. The OC prefix
+# XXX is one of OC, OCAML or the lower-case name of a module. The OC prefix
# is for private variables (i.e. reserved by the compiler's build system),
-# the OCAML prefix is used for variables the user can define to add their
+# the OCAML prefix is used for variables users can define to add their
# own flags and the module-name prefix is for flags that apply only
# to one module.
#
@@ -113,22 +113,22 @@ DEFAULT_BUILD_TARGET = @default_build_target@
# COMMON for the flags shared by all the backends, BYTECODE or NATIVE
# (other backends may be added in the future).
#
-# ZZZ is either CFLAGS (compile-time flags) or LDFLAGS (link-time flags).
-# However, contrary to what is done for C compilers, the flags in the
-# CFLAGS category are not passed at link time, so if a flag is needed
-# at both stages, like e.g. -g, it should be added to both XXX_YYY_CFLAGS and
-# XXX_YYY_LDFLAGS.
+# ZZZ is either COMPFLAGS (compile-time flags) or LINKFLAGS (link-time flags).
+# Countrary to the C convention wrt. CFLAGS and LDFLAGS, the flags in the
+# COMPFLAGS category are not passed at link time, so if a flag is needed
+# at both stages, like e.g. -g, it should be added to both
+# XXX_YYY_COMPFLAGS and XXX_YYY_LINKFLAGS.
-OC_COMMON_CFLAGS = -g -strict-sequence -principal -absname \
+OC_COMMON_COMPFLAGS = -g -strict-sequence -principal -absname \
-w +a-4-9-40-41-42-44-45-48 -warn-error +a -bin-annot \
-strict-formats
-OC_COMMON_LDFLAGS = $(INCLUDES)
+OC_COMMON_LINKFLAGS = $(INCLUDES)
-OC_BYTECODE_LDFLAGS =
+OC_BYTECODE_LINKFLAGS =
-OC_NATIVE_CFLAGS = @oc_native_cflags@
+OC_NATIVE_COMPFLAGS = @oc_native_compflags@
-OC_NATIVE_LDFLAGS = -g
+OC_NATIVE_LINKFLAGS = -g
# Platform-dependent command to create symbolic links
LN = @ln@
diff --git a/Makefile.common b/Makefile.common
index 9bdc162c3c..5f2c4531b4 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -254,7 +254,7 @@ MERGEMANIFESTEXE = $(call if_file_exists, $(1).manifest, \
.SECONDEXPANSION:
LINK_BYTECODE_PROGRAM =\
- $(CAMLC) $(OC_COMMON_LDFLAGS) $(OC_BYTECODE_LDFLAGS)
+ $(CAMLC) $(OC_COMMON_LINKFLAGS) $(OC_BYTECODE_LINKFLAGS)
define OCAML_BYTECODE_PROGRAM
$(eval $(call PROGRAM_SYNONYM,$(1)))
@@ -265,7 +265,7 @@ $(1)$(EXE): \
endef # OCAML_BYTECODE_PROGRAM
LINK_NATIVE_PROGRAM =\
- $(CAMLOPT_CMD) $(OC_COMMON_LDFLAGS) $(OC_NATIVE_LDFLAGS)
+ $(CAMLOPT_CMD) $(OC_COMMON_LINKFLAGS) $(OC_NATIVE_LINKFLAGS)
define OCAML_NATIVE_PROGRAM
$(eval $(call PROGRAM_SYNONYM,$(1)))
diff --git a/Makefile.menhir b/Makefile.menhir
index 1bf961a945..fc13e5e70c 100644
--- a/Makefile.menhir
+++ b/Makefile.menhir
@@ -76,7 +76,7 @@ MENHIRBASICFLAGS := \
MENHIRFLAGS := \
$(MENHIRBASICFLAGS) \
--infer \
- --ocamlc "$(CAMLC) $(OC_COMMON_CFLAGS) $(INCLUDES)" \
+ --ocamlc "$(CAMLC) $(OC_COMMON_COMPFLAGS) $(INCLUDES)" \
--fixed-exception \
--table \
--strategy simplified \
diff --git a/configure b/configure
index c491144386..6d392286ec 100755
--- a/configure
+++ b/configure
@@ -789,7 +789,7 @@ mkdll_ldflags_exp
flexdll_chain
flexlink_cmd
afl
-oc_native_cflags
+oc_native_compflags
function_sections
flat_float_array
windows_unicode
@@ -19429,7 +19429,7 @@ esac
fi
-oc_native_cflags=''
+oc_native_compflags=''
if test x"$enable_function_sections" = "xno"
then :
@@ -19459,7 +19459,7 @@ printf "%s\n" "$as_me: Function sections are not supported
in Clang prior to version 3.5." >&6;} ;; #(
gcc-*|clang-*) :
function_sections=true;
- oc_native_cflags='-function-sections'
+ oc_native_compflags='-function-sections'
internal_cflags="$internal_cflags -ffunction-sections";
printf "%s\n" "#define FUNCTION_SECTIONS 1" >>confdefs.h
;; #(
diff --git a/configure.ac b/configure.ac
index 231d690e12..e4943d23e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -201,7 +201,7 @@ AC_SUBST([cmm_invariants])
AC_SUBST([windows_unicode])
AC_SUBST([flat_float_array])
AC_SUBST([function_sections])
-AC_SUBST([oc_native_cflags])
+AC_SUBST([oc_native_compflags])
AC_SUBST([afl])
AC_SUBST([flexlink_cmd])
AC_SUBST([flexdll_chain])
@@ -2143,7 +2143,7 @@ AS_IF([test x"$enable_mmap_map_stack" = "xyes"],
[with_mmap_map_stack=false])
])
-oc_native_cflags=''
+oc_native_compflags=''
AS_IF([test x"$enable_function_sections" = "xno"],
[function_sections=false],
@@ -2165,7 +2165,7 @@ AS_IF([test x"$enable_function_sections" = "xno"],
in Clang prior to version 3.5.])],
[gcc-*|clang-*],
[function_sections=true;
- oc_native_cflags='-function-sections'
+ oc_native_compflags='-function-sections'
internal_cflags="$internal_cflags -ffunction-sections";
AC_DEFINE([FUNCTION_SECTIONS])],
[*],