summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/asn1/src/Makefile12
-rw-r--r--lib/asn1/src/asn1ct_gen.erl6
-rw-r--r--lib/asn1/test/Makefile1
-rw-r--r--lib/common_test/test/Makefile1
-rw-r--r--lib/compiler/src/Makefile6
-rw-r--r--lib/compiler/test/Makefile1
-rw-r--r--lib/compiler/test/test_lib.erl57
-rw-r--r--lib/debugger/test/Makefile1
-rw-r--r--lib/diameter/src/Makefile12
-rw-r--r--lib/diameter/test/Makefile1
-rw-r--r--lib/edoc/test/Makefile1
-rw-r--r--lib/eldap/test/Makefile1
-rw-r--r--lib/erl_docgen/test/Makefile1
-rw-r--r--lib/eunit/test/Makefile1
-rw-r--r--lib/ftp/test/Makefile1
-rw-r--r--lib/inets/test/Makefile1
-rw-r--r--lib/kernel/test/Makefile1
-rw-r--r--lib/megaco/Makefile10
-rw-r--r--lib/megaco/src/app/megaco.mk6
-rw-r--r--lib/megaco/src/binary/depend.mk4
-rw-r--r--lib/megaco/test/Makefile2
-rw-r--r--lib/mnesia/test/Makefile1
-rw-r--r--lib/observer/test/Makefile1
-rw-r--r--lib/odbc/test/Makefile2
-rw-r--r--lib/os_mon/test/Makefile1
-rw-r--r--lib/parsetools/test/Makefile1
-rw-r--r--lib/parsetools/test/leex_SUITE.erl10
-rw-r--r--lib/parsetools/test/yecc_SUITE.erl10
-rw-r--r--lib/public_key/asn1/Makefile4
-rw-r--r--lib/public_key/test/Makefile1
-rw-r--r--lib/reltool/test/Makefile1
-rw-r--r--lib/runtime_tools/test/Makefile1
-rw-r--r--lib/sasl/test/Makefile1
-rw-r--r--lib/snmp/src/compile/Makefile4
-rw-r--r--lib/snmp/test/Makefile1
-rw-r--r--lib/ssh/test/Makefile1
-rw-r--r--lib/ssl/test/Makefile1
-rw-r--r--lib/stdlib/src/Makefile13
-rw-r--r--lib/stdlib/test/Makefile1
-rw-r--r--lib/syntax_tools/test/Makefile1
-rw-r--r--lib/tftp/test/Makefile1
-rw-r--r--lib/tools/test/Makefile1
-rw-r--r--lib/xmerl/src/Makefile9
-rw-r--r--lib/xmerl/test/Makefile1
44 files changed, 141 insertions, 54 deletions
diff --git a/lib/asn1/src/Makefile b/lib/asn1/src/Makefile
index 6d02075576..9e13d02c8a 100644
--- a/lib/asn1/src/Makefile
+++ b/lib/asn1/src/Makefile
@@ -102,7 +102,13 @@ ERL_COMPILE_FLAGS += \
-I$(ERL_TOP)/lib/stdlib \
-Werror
-YRL_FLAGS =
+ifeq ($(ERL_DETERMINISTIC),yes)
+ YRL_FLAGS = +deterministic
+ DETERMINISM_FLAG = +deterministic
+else
+ YRL_FLAGS =
+ DETERMINISM_FLAG =
+endif
# ----------------------------------------------------
# Targets
@@ -182,10 +188,10 @@ asn1ct_rtt.erl: prepare_templates.$(EMULATOR) $(RT_TEMPLATES_TARGET)
$(RT_TEMPLATES_TARGET)
prepare_templates.$(EMULATOR): prepare_templates.erl
- $(V_ERLC) prepare_templates.erl
+ $(V_ERLC) $(DETERMINISM_FLAG) prepare_templates.erl
asn1rtt_%.$(EMULATOR): asn1rtt_%.erl
- $(V_ERLC) +debug_info $<
+ $(V_ERLC) +debug_info $(DETERMINISM_FLAG) $<
$(EVAL_CT_MODULES:%=%.erl): prepare_templates.$(EMULATOR) \
$(EBIN)/asn1ct_rtt.$(EMULATOR) \
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index 9950438d4f..88dc88487d 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -1331,9 +1331,9 @@ gen_head(#gen{options=Options}=Gen, Mod, Hrl) ->
Options1 =
case Deterministic of
true ->
- % compile:keep_compile_option will filter some of these
- % out of generated .beam files, but this will keep
- % them out of the generated .erl files
+ %% compile:keep_compile_option will filter some of these
+ %% out of generated .beam files, but this will keep
+ %% them out of the generated .erl files
lists:filter(
fun({cwd, _}) -> false;
({outdir, _}) -> false;
diff --git a/lib/asn1/test/Makefile b/lib/asn1/test/Makefile
index 58f7b294f3..de2a38e752 100644
--- a/lib/asn1/test/Makefile
+++ b/lib/asn1/test/Makefile
@@ -138,6 +138,7 @@ RELSYSDIR = $(RELEASE_PATH)/asn1_test
# FLAGS
# ----------------------------------------------------
ERL_COMPILE_FLAGS += +warnings_as_errors +nowarn_export_all
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
# ----------------------------------------------------
diff --git a/lib/common_test/test/Makefile b/lib/common_test/test/Makefile
index 4cc10cbdcc..1af9990bb7 100644
--- a/lib/common_test/test/Makefile
+++ b/lib/common_test/test/Makefile
@@ -99,6 +99,7 @@ RELSYSDIR = $(RELEASE_PATH)/common_test_test
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS +=
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/compiler/src/Makefile b/lib/compiler/src/Makefile
index a9027b3ad8..d801d6baa0 100644
--- a/lib/compiler/src/Makefile
+++ b/lib/compiler/src/Makefile
@@ -138,6 +138,12 @@ ERL_COMPILE_FLAGS += -Werror
ERL_COMPILE_FLAGS += +inline +warn_unused_import \
-I../../stdlib/include -I$(EGEN) -W +warn_missing_spec
+ifeq ($(ERL_DETERMINISTIC),yes)
+ DETERMINISM_FLAG = +deterministic
+else
+ DETERMINISM_FLAG =
+endif
+
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
diff --git a/lib/compiler/test/Makefile b/lib/compiler/test/Makefile
index 37fb570154..8e145ae136 100644
--- a/lib/compiler/test/Makefile
+++ b/lib/compiler/test/Makefile
@@ -168,6 +168,7 @@ RELSYSDIR = $(RELEASE_PATH)/compiler_test
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS += +clint +clint0 +ssalint
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/compiler/test/test_lib.erl b/lib/compiler/test/test_lib.erl
index 39a887834c..7182dd6555 100644
--- a/lib/compiler/test/test_lib.erl
+++ b/lib/compiler/test/test_lib.erl
@@ -82,36 +82,33 @@ uniq() ->
opt_opts(Mod) ->
Comp = Mod:module_info(compile),
- case lists:keyfind(options, 1, Comp) of
- {options,Opts} ->
- lists:filter(fun
- (debug_info) -> true;
- (dialyzer) -> true;
- (deterministic) -> true;
- ({enable_feature,_}) -> true;
- (inline) -> true;
- (no_bs_create_bin) -> true;
- (no_bsm_opt) -> true;
- (no_copt) -> true;
- (no_fun_opt) -> true;
- (no_init_yregs) -> true;
- (no_make_fun3) -> true;
- (no_module_opt) -> true;
- (no_postopt) -> true;
- (no_recv_opt) -> true;
- (no_share_opt) -> true;
- (no_shared_fun_wrappers) -> true;
- (no_ssa_opt_float) -> true;
- (no_ssa_opt_ranges) -> true;
- (no_ssa_opt) -> true;
- (no_stack_trimming) -> true;
- (no_swap) -> true;
- (no_type_opt) -> true;
- (_) -> false
- end, Opts);
- %% `options` may not be set at all if +deterministic is enabled
- false -> []
- end.
+ %% `options` may not be set at all if +deterministic is enabled.
+ Opts = proplists:get_value(options, Comp, []),
+ lists:filter(fun
+ (debug_info) -> true;
+ (dialyzer) -> true;
+ ({feature,_,enable}) -> true;
+ ({feature,_,disable}) -> true;
+ (inline) -> true;
+ (no_bs_create_bin) -> true;
+ (no_bsm_opt) -> true;
+ (no_copt) -> true;
+ (no_fun_opt) -> true;
+ (no_init_yregs) -> true;
+ (no_make_fun3) -> true;
+ (no_module_opt) -> true;
+ (no_postopt) -> true;
+ (no_recv_opt) -> true;
+ (no_share_opt) -> true;
+ (no_shared_fun_wrappers) -> true;
+ (no_ssa_opt_float) -> true;
+ (no_ssa_opt_ranges) -> true;
+ (no_ssa_opt) -> true;
+ (no_stack_trimming) -> true;
+ (no_swap) -> true;
+ (no_type_opt) -> true;
+ (_) -> false
+ end, Opts).
%% Some test suites gets cloned (e.g. to "record_SUITE" to
%% "record_no_opt_SUITE"), but the data directory is not cloned.
diff --git a/lib/debugger/test/Makefile b/lib/debugger/test/Makefile
index 14186798f0..015b5f9c29 100644
--- a/lib/debugger/test/Makefile
+++ b/lib/debugger/test/Makefile
@@ -71,6 +71,7 @@ RELSYSDIR = $(RELEASE_PATH)/debugger_test
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS +=
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/diameter/src/Makefile b/lib/diameter/src/Makefile
index 6dd3667a46..75e23d4191 100644
--- a/lib/diameter/src/Makefile
+++ b/lib/diameter/src/Makefile
@@ -122,6 +122,12 @@ ERL_COMPILE_FLAGS += \
# -pa is to be able to include_lib from the include directory: the
# path must contain the application name.
+ifeq ($(ERL_DETERMINISTIC),yes)
+ DETERMINISM_FLAG = +deterministic
+else
+ DETERMINISM_FLAG =
+endif
+
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
@@ -152,7 +158,7 @@ $(filter-out opt, $(TYPES)):
# The dictionary parser.
gen/$(DICT_YRL).erl: compiler/$(DICT_YRL).yrl
$(yecc_verbose) \
- $(ERLC) -Werror -o $(@D) $<
+ $(ERLC) -Werror $(DETERMINISM_FLAG) -o $(@D) $<
# Generate the app file.
$(APP_TARGET): $(APP_SRC) ../vsn.mk modules.mk
@@ -256,8 +262,8 @@ release_spec: opt
$(INSTALL_DATA) $(EXTERNAL_HRLS:%=../include/%) $(DICT_HRLS) \
"$(RELSYSDIR)/include"
$(INSTALL_DATA) $(DICTS:%=dict/%.dia) "$(RELSYSDIR)/src/dict"
- $(MAKE) $(TARGET_DIRS:%/=release_src_%)
- $(MAKE) $(EXAMPLE_DIRS:%/=release_examples_%)
+ $(MAKE) ERL_DETERMINISTIC=$(ERL_DETERMINISTIC) $(TARGET_DIRS:%/=release_src_%)
+ $(MAKE) ERL_DETERMINISTIC=$(ERL_DETERMINISTIC) $(EXAMPLE_DIRS:%/=release_examples_%)
$(TARGET_DIRS:%/=release_src_%): release_src_%:
$(INSTALL_DIR) "$(RELSYSDIR)/src/$*"
diff --git a/lib/diameter/test/Makefile b/lib/diameter/test/Makefile
index 53b5fd4618..98fb9ff652 100644
--- a/lib/diameter/test/Makefile
+++ b/lib/diameter/test/Makefile
@@ -59,6 +59,7 @@ ERL_COMPILE_FLAGS += +warn_export_vars \
-I ../include \
-I ../src/gen \
$(STRICT_FLAGS)
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
# ----------------------------------------------------
# Targets
diff --git a/lib/edoc/test/Makefile b/lib/edoc/test/Makefile
index 80906a9456..139ba8b8bd 100644
--- a/lib/edoc/test/Makefile
+++ b/lib/edoc/test/Makefile
@@ -27,6 +27,7 @@ RELSYSDIR = $(RELEASE_PATH)/edoc_test
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS +=
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/eldap/test/Makefile b/lib/eldap/test/Makefile
index ba8fe0dfa9..61cad55c64 100644
--- a/lib/eldap/test/Makefile
+++ b/lib/eldap/test/Makefile
@@ -54,6 +54,7 @@ RELSYSDIR = $(RELEASE_PATH)/eldap_test
# FLAGS
# ----------------------------------------------------
ERL_COMPILE_FLAGS += $(INCLUDES) -pa $(ERL_TOP)/lib/eldap/ebin
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/erl_docgen/test/Makefile b/lib/erl_docgen/test/Makefile
index fe45b2a684..9af7824553 100644
--- a/lib/erl_docgen/test/Makefile
+++ b/lib/erl_docgen/test/Makefile
@@ -26,6 +26,7 @@ RELSYSDIR = $(RELEASE_PATH)/erl_docgen_test
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS +=
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/eunit/test/Makefile b/lib/eunit/test/Makefile
index e2fbdf7241..1bd9c0a07c 100644
--- a/lib/eunit/test/Makefile
+++ b/lib/eunit/test/Makefile
@@ -45,6 +45,7 @@ RELSYSDIR = $(RELEASE_PATH)/eunit_test
# ----------------------------------------------------
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS +=
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/ftp/test/Makefile b/lib/ftp/test/Makefile
index 71ddb3bc7c..4686d8f1bd 100644
--- a/lib/ftp/test/Makefile
+++ b/lib/ftp/test/Makefile
@@ -152,6 +152,7 @@ RELTESTSYSBINDIR = $(RELTESTSYSALLDATADIR)/bin
ERL_COMPILE_FLAGS += \
$(INCLUDES) \
$(FTP_FLAGS)
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
# ----------------------------------------------------
# Targets
diff --git a/lib/inets/test/Makefile b/lib/inets/test/Makefile
index 16a1abaee7..414884a535 100644
--- a/lib/inets/test/Makefile
+++ b/lib/inets/test/Makefile
@@ -200,6 +200,7 @@ RELTESTSYSBINDIR = $(RELTESTSYSALLDATADIR)/bin
ERL_COMPILE_FLAGS += \
$(INCLUDES) \
$(INETS_FLAGS)
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
# ----------------------------------------------------
# Targets
diff --git a/lib/kernel/test/Makefile b/lib/kernel/test/Makefile
index 12e6c42f7c..130e626b56 100644
--- a/lib/kernel/test/Makefile
+++ b/lib/kernel/test/Makefile
@@ -159,6 +159,7 @@ RELSYSDIR = $(RELEASE_PATH)/kernel_test
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS +=
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/megaco/Makefile b/lib/megaco/Makefile
index 5dc2955dd8..a1b7adc924 100644
--- a/lib/megaco/Makefile
+++ b/lib/megaco/Makefile
@@ -98,7 +98,13 @@ else
FLEX_SCANNER_REENTRANT_ENABLER = --enable-megaco-reentrant-flex-scanner
endif
-CONFIGURE_OPTS = $(FLEX_SCANNER_LINENO_ENABLER) $(FLEX_SCANNER_REENTRANT_ENABLER)
+ifeq ($(ERL_DETERMINISTIC),yes)
+ ERL_DETERMINISTIC_ENABLER = --enable-deterministic-build
+else
+ ERL_DETERMINISTIC_ENABLER = --disable-deterministic-build
+endif
+
+CONFIGURE_OPTS = $(FLEX_SCANNER_LINENO_ENABLER) $(FLEX_SCANNER_REENTRANT_ENABLER) $(ERL_DETERMINISTIC_ENABLER)
DIA_PLT = ./priv/plt/$(APPLICATION).plt
@@ -115,7 +121,7 @@ include $(ERL_TOP)/make/otp_subdir.mk
reconf:
(cd $(ERL_TOP) && \
- ./otp_build configure && \
+ ./otp_build configure $(ERL_DETERMINISTIC_ENABLER) && \
cd $(ERL_TOP)/../libraries/megaco)
conf: do_configure
diff --git a/lib/megaco/src/app/megaco.mk b/lib/megaco/src/app/megaco.mk
index a887dd42bc..d42fd0d7ed 100644
--- a/lib/megaco/src/app/megaco.mk
+++ b/lib/megaco/src/app/megaco.mk
@@ -42,6 +42,12 @@ ifeq ($(WARN_UNUSED_WARS), true)
ERL_COMPILE_FLAGS += +warn_unused_vars
endif
+ifeq ($(ERL_DETERMINISTIC),yes)
+ERL_COMPILE_FLAGS += +deterministic
+YRL_FLAGS += +deterministic
+XRL_FLAGS += +deterministic
+endif
+
MEGACO_APP_VSN_COMPILE_FLAGS = \
+'{parse_transform,sys_pre_attributes}' \
+'{attribute,insert,app_vsn,$(APP_VSN)}'
diff --git a/lib/megaco/src/binary/depend.mk b/lib/megaco/src/binary/depend.mk
index ca2872975c..d430d157c0 100644
--- a/lib/megaco/src/binary/depend.mk
+++ b/lib/megaco/src/binary/depend.mk
@@ -35,6 +35,10 @@ ifeq ($(MEGACO_INLINE_ASN1_RT),true)
ASN1_CT_OPTS += +inline
endif
+ifeq ($(ERL_DETERMINISTIC),yes)
+ASN1_CT_OPTS += +deterministic
+endif
+
BER_V1_FLAGS = $(ASN1_CT_OPTS) +asn1config
BER_V2_FLAGS = $(ASN1_CT_OPTS) +asn1config
BER_V3_FLAGS = $(ASN1_CT_OPTS) +asn1config
diff --git a/lib/megaco/test/Makefile b/lib/megaco/test/Makefile
index 57437e50a6..eced232a47 100644
--- a/lib/megaco/test/Makefile
+++ b/lib/megaco/test/Makefile
@@ -90,6 +90,8 @@ ERL_COMPILE_FLAGS += $(MEGACO_ERL_COMPILE_FLAGS)
# We have a behaviour in the test catalog (megaco_test_generator)
ERL_COMPILE_FLAGS += -pa ../../megaco/test
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
+
ERL_PATH = -pa ../../megaco/examples/simple \
-pa ../../megaco/ebin \
-pa ../../et/ebin
diff --git a/lib/mnesia/test/Makefile b/lib/mnesia/test/Makefile
index 378bcc44d0..c3fbad88ca 100644
--- a/lib/mnesia/test/Makefile
+++ b/lib/mnesia/test/Makefile
@@ -91,6 +91,7 @@ RELSYSDIR = $(RELEASE_PATH)/mnesia_test
# FLAGS
# ----------------------------------------------------
#ERL_COMPILE_FLAGS +=
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/observer/test/Makefile b/lib/observer/test/Makefile
index 8c7ca2fcfc..114f77400f 100644
--- a/lib/observer/test/Makefile
+++ b/lib/observer/test/Makefile
@@ -52,6 +52,7 @@ RELSYSDIR = $(RELEASE_PATH)/observer_test
# ----------------------------------------------------
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS += +warnings_as_errors +nowarn_export_all
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/odbc/test/Makefile b/lib/odbc/test/Makefile
index 87caa54c61..ab184ac06b 100644
--- a/lib/odbc/test/Makefile
+++ b/lib/odbc/test/Makefile
@@ -72,6 +72,8 @@ RELSYSDIR = $(RELEASE_PATH)/odbc_test
ERL_COMPILE_FLAGS += $(INCLUDES) \
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
+
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
diff --git a/lib/os_mon/test/Makefile b/lib/os_mon/test/Makefile
index d8dc4e57c7..df7b606c06 100644
--- a/lib/os_mon/test/Makefile
+++ b/lib/os_mon/test/Makefile
@@ -55,6 +55,7 @@ RELSYSDIR = $(RELEASE_PATH)/os_mon_test
# ----------------------------------------------------
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/snmp/include
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
# ----------------------------------------------------
# Targets
diff --git a/lib/parsetools/test/Makefile b/lib/parsetools/test/Makefile
index d494953f1e..23cb9709e1 100644
--- a/lib/parsetools/test/Makefile
+++ b/lib/parsetools/test/Makefile
@@ -42,6 +42,7 @@ RELSYSDIR = $(RELEASE_PATH)/parsetools_test
# ----------------------------------------------------
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS +=
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/parsetools/test/leex_SUITE.erl b/lib/parsetools/test/leex_SUITE.erl
index 2d73b58e3c..bef048dc82 100644
--- a/lib/parsetools/test/leex_SUITE.erl
+++ b/lib/parsetools/test/leex_SUITE.erl
@@ -388,12 +388,14 @@ deterministic(Config) when is_list(Config) ->
%% deterministic mode, that include should only use the basename,
%% "leexinc.hrl", but otherwise, it should contain the full path.
- AbsolutePathSuffix = "/lib/parsetools/include/leexinc.hrl",
+ %% Matches when OTP is not installed (e.g. /lib/parsetools/include/leexinc.hrl)
+ %% and when it is (e.g. /lib/parsetools-2.3.2/include/leexinc.hrl)
+ AbsolutePathSuffix = ".*/lib/parsetools.*/include/leexinc\.hrl",
ok = leex:compile(Filename, Scannerfile, #options{specific=[deterministic]}),
{ok, FormsDet} = epp:parse_file(Scannerfile,[]),
?assertMatch(false, search_for_file_attr(AbsolutePathSuffix, FormsDet)),
- ?assertMatch({value, _}, search_for_file_attr("leexinc.hrl", FormsDet)),
+ ?assertMatch({value, _}, search_for_file_attr("leexinc\.hrl", FormsDet)),
file:delete(Scannerfile),
ok = leex:compile(Filename, Scannerfile, #options{}),
@@ -1308,10 +1310,10 @@ extract(File, {error, Es, Ws}) ->
extract(File, Ts) ->
lists:append([T || {F, T} <- Ts, F =:= File]).
-search_for_file_attr(PartialFilePath, Forms) ->
+search_for_file_attr(PartialFilePathRegex, Forms) ->
lists:search(fun
({attribute, _, file, {FileAttr, _}}) ->
- case string:find(FileAttr, PartialFilePath) of
+ case re:run(FileAttr, PartialFilePathRegex) of
nomatch -> false;
_ -> true
end;
diff --git a/lib/parsetools/test/yecc_SUITE.erl b/lib/parsetools/test/yecc_SUITE.erl
index 16a6b47ade..e76b98f0f5 100644
--- a/lib/parsetools/test/yecc_SUITE.erl
+++ b/lib/parsetools/test/yecc_SUITE.erl
@@ -946,12 +946,14 @@ deterministic(Config) when is_list(Config) ->
%% only use the basename, "yeccpre.hrl", but otherwise, it should
%% contain the full path.
- AbsolutePathSuffix = "/lib/parsetools/include/yeccpre.hrl",
+ %% Matches when OTP is not installed (e.g. /lib/parsetools/include/yeccpre.hrl)
+ %% and when it is (e.g. /lib/parsetools-2.3.2/include/yeccpre.hrl)
+ AbsolutePathSuffix = "/lib/parsetools.*/include/yeccpre\.hrl",
ok = yecc:compile(Filename, Parserfile, #options{specific=[deterministic]}),
{ok, FormsDet} = epp:parse_file(Parserfile,[]),
?assertMatch(false, search_for_file_attr(AbsolutePathSuffix, FormsDet)),
- ?assertMatch({value, _}, search_for_file_attr("yeccpre.hrl", FormsDet)),
+ ?assertMatch({value, _}, search_for_file_attr("yeccpre\.hrl", FormsDet)),
file:delete(Parserfile),
ok = yecc:compile(Filename, Parserfile, #options{}),
@@ -2321,10 +2323,10 @@ process_list() ->
safe_second_element({_,Info}) -> Info;
safe_second_element(Other) -> Other.
-search_for_file_attr(PartialFilePath, Forms) ->
+search_for_file_attr(PartialFilePathRegex, Forms) ->
lists:search(fun
({attribute, _, file, {FileAttr, _}}) ->
- case string:find(FileAttr, PartialFilePath) of
+ case re:run(FileAttr, PartialFilePathRegex) of
nomatch -> false;
_ -> true
end;
diff --git a/lib/public_key/asn1/Makefile b/lib/public_key/asn1/Makefile
index d33e13fb14..c1adf58ed4 100644
--- a/lib/public_key/asn1/Makefile
+++ b/lib/public_key/asn1/Makefile
@@ -70,6 +70,10 @@ ERL_COMPILE_FLAGS += $(EXTRA_ERLC_FLAGS)
ASN_FLAGS = -bber +der +noobj +asn1config
+ifeq ($(ERL_DETERMINISTIC),yes)
+ ASN_FLAGS += +deterministic
+endif
+
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
diff --git a/lib/public_key/test/Makefile b/lib/public_key/test/Makefile
index 6c39c534d2..aa42cf281f 100644
--- a/lib/public_key/test/Makefile
+++ b/lib/public_key/test/Makefile
@@ -55,6 +55,7 @@ RELSYSDIR = $(RELEASE_PATH)/public_key_test
# FLAGS
# ----------------------------------------------------
ERL_COMPILE_FLAGS += $(INCLUDES)
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/reltool/test/Makefile b/lib/reltool/test/Makefile
index 789019cf7d..245c9c9f00 100644
--- a/lib/reltool/test/Makefile
+++ b/lib/reltool/test/Makefile
@@ -51,6 +51,7 @@ RELSYSDIR = $(RELEASE_PATH)/reltool_test
# FLAGS
# ----------------------------------------------------
ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/reltool/ebin/
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/runtime_tools/test/Makefile b/lib/runtime_tools/test/Makefile
index f899d53f7f..c9578d376e 100644
--- a/lib/runtime_tools/test/Makefile
+++ b/lib/runtime_tools/test/Makefile
@@ -31,6 +31,7 @@ RELSYSDIR = $(RELEASE_PATH)/runtime_tools_test
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS += -Werror
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/sasl/test/Makefile b/lib/sasl/test/Makefile
index 11c2a9e69f..adc5a927ac 100644
--- a/lib/sasl/test/Makefile
+++ b/lib/sasl/test/Makefile
@@ -58,6 +58,7 @@ RELSYSDIR = $(RELEASE_PATH)/sasl_test
# ----------------------------------------------------
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/sasl/src
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/snmp/src/compile/Makefile b/lib/snmp/src/compile/Makefile
index d37eaf9636..f255237a04 100644
--- a/lib/snmp/src/compile/Makefile
+++ b/lib/snmp/src/compile/Makefile
@@ -85,6 +85,10 @@ ERL_COMPILE_FLAGS += -I../../include \
YRL_FLAGS = -o .
+ifeq ($(ERL_DETERMINISTIC),yes)
+ YRL_FLAGS += +deterministic
+endif
+
# ----------------------------------------------------
# Targets
diff --git a/lib/snmp/test/Makefile b/lib/snmp/test/Makefile
index ac25a0d0b3..8de1b1e80d 100644
--- a/lib/snmp/test/Makefile
+++ b/lib/snmp/test/Makefile
@@ -161,6 +161,7 @@ ERL_COMPILE_FLAGS += -I../../snmp/src/app \
+'{parse_transform,sys_pre_attributes}' \
+'{attribute,insert,app_vsn,$(APP_VSN)}' \
$(SNMP_FLAGS)
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
ERL_SNMP_FLAGS = $(SNMP_MIB_FLAGS) \
-I../priv/mibs
diff --git a/lib/ssh/test/Makefile b/lib/ssh/test/Makefile
index e07806f488..908312f8de 100644
--- a/lib/ssh/test/Makefile
+++ b/lib/ssh/test/Makefile
@@ -98,6 +98,7 @@ RELSYSDIR = $(RELEASE_PATH)/ssh_test
INCLUDES = -I$(ERL_TOP)/lib/ssh/src
ERL_COMPILE_FLAGS += $(INCLUDES) -pa ../ebin
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/ssl/test/Makefile b/lib/ssl/test/Makefile
index 9272ab0988..47ba9adfbd 100644
--- a/lib/ssl/test/Makefile
+++ b/lib/ssl/test/Makefile
@@ -143,6 +143,7 @@ RELSYSDIR = $(RELEASE_PATH)/ssl_test
# running the target "targets".
# ----------------------------------------------------
ERL_COMPILE_FLAGS += $(INCLUDES)
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
# ----------------------------------------------------
# Targets
diff --git a/lib/stdlib/src/Makefile b/lib/stdlib/src/Makefile
index b7b5ead962..47625c0011 100644
--- a/lib/stdlib/src/Makefile
+++ b/lib/stdlib/src/Makefile
@@ -166,6 +166,12 @@ endif
ERL_COMPILE_FLAGS += -Werror
ERL_COMPILE_FLAGS += -I../include -I../../kernel/include
+ifeq ($(ERL_DETERMINISTIC),yes)
+ DETERMINISM_FLAG = +deterministic
+else
+ DETERMINISM_FLAG =
+endif
+
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
@@ -191,16 +197,17 @@ primary_bootstrap_compiler: \
$(BOOTSTRAP_COMPILER)/ebin/io.beam \
$(BOOTSTRAP_COMPILER)/ebin/otp_internal.beam
+
$(BOOTSTRAP_COMPILER)/ebin/erl_parse.beam: erl_parse.yrl
$(gen_verbose)
- $(V_at)$(ERLC) -o $(BOOTSTRAP_COMPILER)/egen erl_parse.yrl
- $(V_at)$(ERLC) -o $(BOOTSTRAP_COMPILER)/ebin $(BOOTSTRAP_COMPILER)/egen/erl_parse.erl
+ $(V_at)$(ERLC) -o $(BOOTSTRAP_COMPILER)/egen $(DETERMINISM_FLAG) erl_parse.yrl
+ $(V_at)$(ERLC) -o $(BOOTSTRAP_COMPILER)/ebin $(DETERMINISM_FLAG) $(BOOTSTRAP_COMPILER)/egen/erl_parse.erl
$(BOOTSTRAP_TOP)/lib/stdlib/egen/erl_parse.erl: erl_parse.yrl
$(yecc_verbose)$(ERLC) $(YRL_FLAGS) -o$(BOOTSTRAP_TOP)/lib/stdlib/egen erl_parse.yrl
$(BOOTSTRAP_COMPILER)/ebin/%.beam: %.erl
- $(V_ERLC) -o $(BOOTSTRAP_COMPILER)/ebin $<
+ $(V_ERLC) -o $(BOOTSTRAP_COMPILER)/ebin $(DETERMINISM_FLAG) $<
# ----------------------------------------------------
# Special Build Targets
diff --git a/lib/stdlib/test/Makefile b/lib/stdlib/test/Makefile
index 18d3a083a3..3ebaefac4e 100644
--- a/lib/stdlib/test/Makefile
+++ b/lib/stdlib/test/Makefile
@@ -120,6 +120,7 @@ RELSYSDIR = $(RELEASE_PATH)/stdlib_test
ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/kernel/include \
-I$(ERL_TOP)/lib/stdlib/include
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/syntax_tools/test/Makefile b/lib/syntax_tools/test/Makefile
index 51fe2417b1..deee5ab814 100644
--- a/lib/syntax_tools/test/Makefile
+++ b/lib/syntax_tools/test/Makefile
@@ -27,6 +27,7 @@ RELSYSDIR = $(RELEASE_PATH)/syntax_tools_test
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS +=
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/tftp/test/Makefile b/lib/tftp/test/Makefile
index 3eb0886f66..a3caf45321 100644
--- a/lib/tftp/test/Makefile
+++ b/lib/tftp/test/Makefile
@@ -152,6 +152,7 @@ RELTESTSYSBINDIR = $(RELTESTSYSALLDATADIR)/bin
ERL_COMPILE_FLAGS += \
$(INCLUDES) \
$(TFTP_FLAGS)
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
# ----------------------------------------------------
# Targets
diff --git a/lib/tools/test/Makefile b/lib/tools/test/Makefile
index 571fdd07e9..984568e4c5 100644
--- a/lib/tools/test/Makefile
+++ b/lib/tools/test/Makefile
@@ -54,6 +54,7 @@ RELSYSDIR = $(RELEASE_PATH)/tools_test
# ----------------------------------------------------
ERL_MAKE_FLAGS +=
ERL_COMPILE_FLAGS +=
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
diff --git a/lib/xmerl/src/Makefile b/lib/xmerl/src/Makefile
index 0a9f8391c7..e7e7c8e978 100644
--- a/lib/xmerl/src/Makefile
+++ b/lib/xmerl/src/Makefile
@@ -127,6 +127,11 @@ ERL_COMPILE_FLAGS += \
# +bin_opt_info
+ifeq ($(ERL_DETERMINISTIC),yes)
+ DETERMINISM_FLAG = +deterministic
+else
+ DETERMINISM_FLAG =
+endif
# ----------------------------------------------------
# Targets
@@ -173,10 +178,10 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
$(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@
xmerl_xpath_parse.erl: xmerl_xpath_parse.yrl
- $(yecc_verbose)$(ERLC) -o $(ESRC) $<
+ $(yecc_verbose)$(ERLC) -o $(ESRC) $(DETERMINISM_FLAG) $<
xmerl_b64Bin.erl: xmerl_b64Bin.yrl
- $(yecc_verbose)$(ERLC) -o $(ESRC) $<
+ $(yecc_verbose)$(ERLC) -o $(ESRC) $(DETERMINISM_FLAG) $<
xmerl_sax_parser_list.erl: xmerl_sax_parser_list.erlsrc xmerl_sax_parser_base.erlsrc
$(gen_verbose)cat xmerl_sax_parser_list.erlsrc xmerl_sax_parser_base.erlsrc >$@
diff --git a/lib/xmerl/test/Makefile b/lib/xmerl/test/Makefile
index 49091a9a54..97180d8051 100644
--- a/lib/xmerl/test/Makefile
+++ b/lib/xmerl/test/Makefile
@@ -86,6 +86,7 @@ RELSYSDIR = $(RELEASE_PATH)/xmerl_test
# ----------------------------------------------------
ERL_COMPILE_FLAGS +=
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
# ----------------------------------------------------