diff options
Diffstat (limited to 'lib')
138 files changed, 1448 insertions, 1815 deletions
diff --git a/lib/appmon/src/Makefile b/lib/appmon/src/Makefile index 9dc47ab84e..c42ce068b4 100644 --- a/lib/appmon/src/Makefile +++ b/lib/appmon/src/Makefile @@ -83,10 +83,10 @@ docs: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/asn1/c_src/Makefile b/lib/asn1/c_src/Makefile index dc926947af..70238335c4 100644 --- a/lib/asn1/c_src/Makefile +++ b/lib/asn1/c_src/Makefile @@ -94,10 +94,10 @@ docs: $(OBJDIR)/%.o: %.c - $(CC) -c $(CFLAGS) -O3 -o $@ $< + $(V_CC) -c $(CFLAGS) -O3 -o $@ $< $(NIF_SHARED_OBJ_FILE): $(NIF_OBJ_FILES) - $(LD) $(LDFLAGS) -o $(NIF_SHARED_OBJ_FILE) $(NIF_OBJ_FILES) $(CLIB_FLAGS) $(LIBS) + $(V_LD) $(LDFLAGS) -o $(NIF_SHARED_OBJ_FILE) $(NIF_OBJ_FILES) $(CLIB_FLAGS) $(LIBS) # ---------------------------------------------------- # Release Target diff --git a/lib/asn1/src/Makefile b/lib/asn1/src/Makefile index 8d9422144e..03e18c565b 100644 --- a/lib/asn1/src/Makefile +++ b/lib/asn1/src/Makefile @@ -136,13 +136,13 @@ info: # ---------------------------------------------------- $(EBIN)/asn1ct.$(EMULATOR):asn1ct.erl - $(ERLC) -b$(EMULATOR) -o$(EBIN) $(ERL_COMPILE_FLAGS) -Dvsn=\"$(VSN)\" $< + $(V_ERLC) -b$(EMULATOR) -o$(EBIN) $(ERL_COMPILE_FLAGS) -Dvsn=\"$(VSN)\" $< $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- diff --git a/lib/common_test/doc/src/notes.xml b/lib/common_test/doc/src/notes.xml index 8c3b13951d..0345fab8e8 100644 --- a/lib/common_test/doc/src/notes.xml +++ b/lib/common_test/doc/src/notes.xml @@ -32,6 +32,122 @@ <file>notes.xml</file> </header> +<section><title>Common_Test 1.7</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + Severe errors detected by <c>test_server</c> (e.g. if log + files directories cannot be created) will now be reported + to <c>common_test</c> and noted in the <c>common_test</c> + logs.</p> + <p> + Own Id: OTP-9769 Aux Id: kunagi-202 [113] </p> + </item> + <item> + <p> + If a busy test case generated lots of error messages, + cth_log_redirect:post_end_per_testcase would crash with a + timeout while waiting for the error logger to finish + handling all error reports. The default timer was 5 + seconds. This has now been extended to 5 minutes.</p> + <p> + Own Id: OTP-10040 Aux Id: kunagi-173 [84] </p> + </item> + <item> + <p> + Some bugfixes in <c>ct_snmp:</c></p> + <p> + <list> <item> ct_snmp will now use the value of the + 'agent_vsns' config variable when setting the 'variables' + parameter to snmp application agent configuration. + Earlier this had to be done separately - i.e. the + supported versions had to be specified twice. </item> + <item> Snmp application failed to write notify.conf since + ct_snmp gave the notify type as a string instead of an + atom. This has been corrected. </item> </list></p> + <p> + Own Id: OTP-10432</p> + </item> + <item> + <p> + Some bugfixes in <c>ct_snmp</c>:</p> + <p> + <list> <item> Functions <c>register_users/2</c>, + <c>register_agents/2</c> and <c>register_usm_users/2</c>, + and the corresponding <c>unregister_*/1</c> functions + were not executable. These are corrected/rewritten. + </item> <item> Function <c>update_usm_users/2</c> is + removed, and an unregister function is added instead. + Update can now be done with unregister_usm_users and then + register_usm_users. </item> <item> Functions + <c>unregister_*/2</c> are added, so specific + users/agents/usm users can be unregistered. </item> + <item> Function <c>unload_mibs/1</c> is added for + completeness. </item> <item> Overriding configuration + files did not work, since the files were written in + priv_dir instead of in the configuration dir + (priv_dir/conf). This has been corrected. </item> <item> + Arguments to <c>register_usm_users/2</c> were faulty + documented. This has been corrected. </item> </list></p> + <p> + Own Id: OTP-10434 Aux Id: kunagi-264 [175] </p> + </item> + <item> + <p> + Faulty exported specs in common test has been corrected + to <c>ct_netconfc:hook_options/0</c> and + <c>inet:hostname/0</c></p> + <p> + Own Id: OTP-10601</p> + </item> + <item> + <p> + The netconf client in common_test did not adjust the + window after receiving data. Due to this, the client + stopped receiving data after a while. This has been + corrected.</p> + <p> + Own Id: OTP-10646</p> + </item> + </list> + </section> + + + <section><title>Known Bugs and Problems</title> + <list> + <item> + <p> + The earlier undocumented cross cover feature for + accumulating cover data over multiple tests has now been + fixed and documented.</p> + <p> + Own Id: OTP-9870 Aux Id: kunagi-206 [117] </p> + </item> + <item> + <p> + CT drops error reason when groups/0 crashes.</p> + <p> + Own Id: OTP-10631 Aux Id: kunagi-345 [256] </p> + </item> + <item> + <p> + Problem opening sftp connection with ct_ssh.</p> + <p> + Own Id: OTP-10632 Aux Id: kunagi-346 [257] </p> + </item> + <item> + <p> + Event handler on a ct_master node causes hanging.</p> + <p> + Own Id: OTP-10634 Aux Id: kunagi-347 [258] </p> + </item> + </list> + </section> + +</section> + <section><title>Common_Test 1.6.3.1</title> <section><title>Known Bugs and Problems</title> diff --git a/lib/common_test/priv/Makefile.in b/lib/common_test/priv/Makefile.in index 4372ab124e..5a9fabbe45 100644 --- a/lib/common_test/priv/Makefile.in +++ b/lib/common_test/priv/Makefile.in @@ -68,15 +68,15 @@ JS = jquery-latest.js jquery.tablesorter.min.js include ../../test_server/vsn.mk debug opt: - sed -e 's;@CT_VSN@;$(VSN);' \ + $(V_at)sed -e 's;@CT_VSN@;$(VSN);' \ -e 's;@TS_VSN@;$(TEST_SERVER_VSN);' \ ../install.sh.in > install.sh - chmod 775 install.sh + $(V_at)chmod 775 install.sh docs: clean: - rm -f $(SCRIPTS) + $(V_at)rm -f $(SCRIPTS) # ---------------------------------------------------- diff --git a/lib/common_test/src/Makefile b/lib/common_test/src/Makefile index dd2923ece9..eb35a43d99 100644 --- a/lib/common_test/src/Makefile +++ b/lib/common_test/src/Makefile @@ -127,10 +127,10 @@ clean: # Special Build Targets # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/common_test/vsn.mk b/lib/common_test/vsn.mk index f9bb22867e..c92fb2ca37 100644 --- a/lib/common_test/vsn.mk +++ b/lib/common_test/vsn.mk @@ -1 +1 @@ -COMMON_TEST_VSN = 1.6.3 +COMMON_TEST_VSN = 1.7 diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index 27d750f929..ddaae2655d 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -816,6 +816,32 @@ pi() -> 3.1416. </section> <section> + <title>Inlining of list functions</title> + <p>The compiler can also inline a variety of list manipulation functions + from the stdlib's lists module.</p> + + <p>This feature must be explicitly enabled with a compiler option or a + <c>-compile()</c> attribute in the source module.</p> + + <p>To enable inlining of list functions, use the <c>inline_list_funcs</c> + option.</p> + + <p>The following functions are inlined:</p> + <list type="bulleted"> + <item><seealso marker="stdlib:lists#all/2">lists:all/2</seealso></item> + <item><seealso marker="stdlib:lists#any/2">lists:any/2</seealso></item> + <item><seealso marker="stdlib:lists#foreach/2">lists:foreach/2</seealso></item> + <item><seealso marker="stdlib:lists#map/2">lists:map/2</seealso></item> + <item><seealso marker="stdlib:lists#flatmap/2">lists:flatmap/2</seealso></item> + <item><seealso marker="stdlib:lists#filter/2">lists:filter/2</seealso></item> + <item><seealso marker="stdlib:lists#foldl/3">lists:foldl/3</seealso></item> + <item><seealso marker="stdlib:lists#foldr/3">lists:foldr/3</seealso></item> + <item><seealso marker="stdlib:lists#mapfoldl/3">lists:mapfoldl/3</seealso></item> + <item><seealso marker="stdlib:lists#mapfoldr/3">lists:mapfoldr/3</seealso></item> + </list> + </section> + + <section> <title>Parse Transformations</title> <p>Parse transformations are used when a programmer wants to use diff --git a/lib/compiler/src/Makefile b/lib/compiler/src/Makefile index cbcbf79839..8d54dffd73 100644 --- a/lib/compiler/src/Makefile +++ b/lib/compiler/src/Makefile @@ -82,7 +82,6 @@ MODULES = \ sys_core_dsetel \ sys_core_fold \ sys_core_inline \ - sys_expand_pmod \ sys_pre_attributes \ sys_pre_expand \ v3_codegen \ @@ -145,19 +144,19 @@ clean: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(EGEN)/beam_opcodes.erl $(EGEN)/beam_opcodes.hrl: genop.tab - $(PERL) $(ERL_TOP)/erts/emulator/utils/beam_makeops -compiler -outdir $(EGEN) $< + $(gen_verbose)$(PERL) $(ERL_TOP)/erts/emulator/utils/beam_makeops -compiler -outdir $(EGEN) $< $(EBIN)/beam_asm.beam: $(ESRC)/beam_asm.erl $(EGEN)/beam_opcodes.hrl - $(ERLC) $(ERL_COMPILE_FLAGS) -DCOMPILER_VSN='"$(VSN)"' -o$(EBIN) $< + $(V_ERLC) $(ERL_COMPILE_FLAGS) -DCOMPILER_VSN='"$(VSN)"' -o$(EBIN) $< $(EBIN)/cerl_inline.beam: $(ESRC)/cerl_inline.erl - $(ERLC) $(ERL_COMPILE_FLAGS) +nowarn_shadow_vars -o$(EBIN) $< + $(V_ERLC) $(ERL_COMPILE_FLAGS) +nowarn_shadow_vars -o$(EBIN) $< # ---------------------------------------------------- # Release Target diff --git a/lib/compiler/src/beam_dict.erl b/lib/compiler/src/beam_dict.erl index 531968b3c8..ff6c7c11dc 100644 --- a/lib/compiler/src/beam_dict.erl +++ b/lib/compiler/src/beam_dict.erl @@ -138,7 +138,17 @@ string(Str, Dict) when is_list(Str) -> -spec lambda(label(), non_neg_integer(), bdict()) -> {non_neg_integer(), bdict()}. -lambda(Lbl, NumFree, #asm{lambdas=Lambdas0}=Dict) -> +lambda(Lbl, 0, #asm{lambdas=Lambdas0}=Dict) -> + case lists:keyfind(Lbl, 1, Lambdas0) of + {Lbl,{OldIndex,_,_,_,_}} -> + {OldIndex,Dict}; + false -> + new_lambda(Lbl, 0, Dict) + end; +lambda(Lbl, NumFree, Dict) -> + new_lambda(Lbl, NumFree, Dict). + +new_lambda(Lbl, NumFree, #asm{lambdas=Lambdas0}=Dict) -> OldIndex = length(Lambdas0), %% Set Index the same as OldIndex. Index = OldIndex, @@ -235,10 +245,12 @@ string_table(#asm{strings=Strings,string_offset=Size}) -> -spec lambda_table(bdict()) -> {non_neg_integer(), [<<_:192>>]}. -lambda_table(#asm{locals=Loc0,lambdas=Lambdas0}) -> +lambda_table(#asm{exports=Ext0,locals=Loc0,lambdas=Lambdas0}) -> Lambdas1 = sofs:relation(Lambdas0), Loc = sofs:relation([{Lbl,{F,A}} || {F,A,Lbl} <- Loc0]), - Lambdas2 = sofs:relative_product1(Lambdas1, Loc), + Ext = sofs:relation([{Lbl,{F,A}} || {F,A,Lbl} <- Ext0]), + All = sofs:union(Loc, Ext), + Lambdas2 = sofs:relative_product1(Lambdas1, All), Lambdas = [<<F:32,A:32,Lbl:32,Index:32,NumFree:32,OldUniq:32>> || {{_,Lbl,Index,NumFree,OldUniq},{F,A}} <- sofs:to_external(Lambdas2)], {length(Lambdas),Lambdas}. diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl index 10e7f5e9ce..5f394f0b65 100644 --- a/lib/compiler/src/compile.erl +++ b/lib/compiler/src/compile.erl @@ -895,7 +895,6 @@ foldl_core_transforms(St, []) -> {ok,St}. %%% Fetches the module name from a list of forms. The module attribute must %%% be present. -get_module([{attribute,_,module,{M,_As}} | _]) -> M; get_module([{attribute,_,module,M} | _]) -> M; get_module([_ | Rest]) -> get_module(Rest). @@ -907,11 +906,8 @@ add_default_base(St, Forms) -> F = St#compile.filename, case F of "" -> - M = case get_module(Forms) of - PackageModule when is_list(PackageModule) -> last(PackageModule); - M0 -> M0 - end, - St#compile{base = atom_to_list(M)}; + M = get_module(Forms), + St#compile{base=atom_to_list(M)}; _ -> St end. diff --git a/lib/compiler/src/compiler.app.src b/lib/compiler/src/compiler.app.src index 94c78e68f9..9a02121d8b 100644 --- a/lib/compiler/src/compiler.app.src +++ b/lib/compiler/src/compiler.app.src @@ -57,7 +57,6 @@ sys_core_dsetel, sys_core_fold, sys_core_inline, - sys_expand_pmod, sys_pre_attributes, sys_pre_expand, v3_codegen, diff --git a/lib/compiler/src/core_lint.erl b/lib/compiler/src/core_lint.erl index b513a8965c..21296a8b66 100644 --- a/lib/compiler/src/core_lint.erl +++ b/lib/compiler/src/core_lint.erl @@ -247,7 +247,8 @@ gbody(E, Def, Rt, St0) -> false -> St1 end. -gexpr(#c_var{name=N}, Def, _Rt, St) -> expr_var(N, Def, St); +gexpr(#c_var{name=N}, Def, _Rt, St) when is_atom(N); is_integer(N) -> + expr_var(N, Def, St); gexpr(#c_literal{}, _Def, _Rt, St) -> St; gexpr(#c_cons{hd=H,tl=T}, Def, _Rt, St) -> gexpr_list([H,T], Def, St); diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl index 18fba7962b..f17b0bd130 100644 --- a/lib/compiler/src/sys_core_fold.erl +++ b/lib/compiler/src/sys_core_fold.erl @@ -686,11 +686,14 @@ call_1(#c_call{anno=Anno}, lists, all, [Arg1,Arg2], Sub) -> C1 = #c_clause{pats=[#c_cons{hd=X, tl=Xs}], guard=#c_literal{val=true}, body=#c_case{arg=#c_apply{anno=Anno, op=F, args=[X]}, clauses = [CC1, CC2, CC3]}}, - C2 = #c_clause{pats=[#c_literal{val=[]}], guard=#c_literal{val=true}, + C2 = #c_clause{pats=[#c_literal{val=[]}], + guard=#c_call{module=#c_literal{val=erlang}, + name=#c_literal{val=is_function}, + args=[F, #c_literal{val=1}]}, body=#c_literal{val=true}}, - Err2 = #c_tuple{es=[#c_literal{val='function_clause'}, Xs]}, + Err2 = #c_tuple{es=[#c_literal{val='function_clause'}, F, Xs]}, C3 = #c_clause{pats=[Xs], guard=#c_literal{val=true}, - body=match_fail(Anno, Err2)}, + body=match_fail([{function_name,{'lists^all',1}}|Anno], Err2)}, Fun = #c_fun{vars=[Xs], body=#c_case{arg=Xs, clauses=[C1, C2, C3]}}, L = #c_var{name='L'}, @@ -713,11 +716,14 @@ call_1(#c_call{anno=Anno}, lists, any, [Arg1,Arg2], Sub) -> C1 = #c_clause{pats=[#c_cons{hd=X, tl=Xs}], guard=#c_literal{val=true}, body=#c_case{arg=#c_apply{anno=Anno, op=F, args=[X]}, clauses = [CC1, CC2, CC3]}}, - C2 = #c_clause{pats=[#c_literal{val=[]}], guard=#c_literal{val=true}, + C2 = #c_clause{pats=[#c_literal{val=[]}], + guard=#c_call{module=#c_literal{val=erlang}, + name=#c_literal{val=is_function}, + args=[F, #c_literal{val=1}]}, body=#c_literal{val=false}}, - Err2 = #c_tuple{es=[#c_literal{val='function_clause'}, Xs]}, + Err2 = #c_tuple{es=[#c_literal{val='function_clause'}, F, Xs]}, C3 = #c_clause{pats=[Xs], guard=#c_literal{val=true}, - body=match_fail(Anno, Err2)}, + body=match_fail([{function_name,{'lists^any',1}}|Anno], Err2)}, Fun = #c_fun{vars=[Xs], body=#c_case{arg=Xs, clauses=[C1, C2, C3]}}, L = #c_var{name='L'}, @@ -733,11 +739,14 @@ call_1(#c_call{anno=Anno}, lists, foreach, [Arg1,Arg2], Sub) -> C1 = #c_clause{pats=[#c_cons{hd=X, tl=Xs}], guard=#c_literal{val=true}, body=#c_seq{arg=#c_apply{anno=Anno, op=F, args=[X]}, body=#c_apply{anno=Anno, op=Loop, args=[Xs]}}}, - C2 = #c_clause{pats=[#c_literal{val=[]}], guard=#c_literal{val=true}, + C2 = #c_clause{pats=[#c_literal{val=[]}], + guard=#c_call{module=#c_literal{val=erlang}, + name=#c_literal{val=is_function}, + args=[F, #c_literal{val=1}]}, body=#c_literal{val=ok}}, - Err = #c_tuple{es=[#c_literal{val='function_clause'}, Xs]}, + Err = #c_tuple{es=[#c_literal{val='function_clause'}, F, Xs]}, C3 = #c_clause{pats=[Xs], guard=#c_literal{val=true}, - body=match_fail(Anno, Err)}, + body=match_fail([{function_name,{'lists^foreach',1}}|Anno], Err)}, Fun = #c_fun{vars=[Xs], body=#c_case{arg=Xs, clauses=[C1, C2, C3]}}, L = #c_var{name='L'}, @@ -756,14 +765,18 @@ call_1(#c_call{anno=Anno}, lists, map, [Arg1,Arg2], Sub) -> op=F, args=[X]}, body=#c_cons{hd=H, + anno=[compiler_generated], tl=#c_apply{anno=Anno, op=Loop, args=[Xs]}}}}, - C2 = #c_clause{pats=[#c_literal{val=[]}], guard=#c_literal{val=true}, + C2 = #c_clause{pats=[#c_literal{val=[]}], + guard=#c_call{module=#c_literal{val=erlang}, + name=#c_literal{val=is_function}, + args=[F, #c_literal{val=1}]}, body=#c_literal{val=[]}}, - Err = #c_tuple{es=[#c_literal{val='function_clause'}, Xs]}, + Err = #c_tuple{es=[#c_literal{val='function_clause'}, F, Xs]}, C3 = #c_clause{pats=[Xs], guard=#c_literal{val=true}, - body=match_fail(Anno, Err)}, + body=match_fail([{function_name,{'lists^map',1}}|Anno], Err)}, Fun = #c_fun{vars=[Xs], body=#c_case{arg=Xs, clauses=[C1, C2, C3]}}, L = #c_var{name='L'}, @@ -780,18 +793,21 @@ call_1(#c_call{anno=Anno}, lists, flatmap, [Arg1,Arg2], Sub) -> C1 = #c_clause{pats=[#c_cons{hd=X, tl=Xs}], guard=#c_literal{val=true}, body=#c_let{vars=[H], arg=#c_apply{anno=Anno, op=F, args=[X]}, - body=#c_call{anno=Anno, + body=#c_call{anno=[compiler_generated|Anno], module=#c_literal{val=erlang}, name=#c_literal{val='++'}, args=[H, #c_apply{anno=Anno, op=Loop, args=[Xs]}]}}}, - C2 = #c_clause{pats=[#c_literal{val=[]}], guard=#c_literal{val=true}, + C2 = #c_clause{pats=[#c_literal{val=[]}], + guard=#c_call{module=#c_literal{val=erlang}, + name=#c_literal{val=is_function}, + args=[F, #c_literal{val=1}]}, body=#c_literal{val=[]}}, - Err = #c_tuple{es=[#c_literal{val='function_clause'}, Xs]}, + Err = #c_tuple{es=[#c_literal{val='function_clause'}, F, Xs]}, C3 = #c_clause{pats=[Xs], guard=#c_literal{val=true}, - body=match_fail(Anno, Err)}, + body=match_fail([{function_name,{'lists^flatmap',1}}|Anno], Err)}, Fun = #c_fun{vars=[Xs], body=#c_case{arg=Xs, clauses=[C1, C2, C3]}}, L = #c_var{name='L'}, @@ -807,7 +823,7 @@ call_1(#c_call{anno=Anno}, lists, filter, [Arg1,Arg2], Sub) -> B = #c_var{name='B'}, Err1 = #c_tuple{es=[#c_literal{val='case_clause'}, X]}, CC1 = #c_clause{pats=[#c_literal{val=true}], guard=#c_literal{val=true}, - body=#c_cons{hd=X, tl=Xs}}, + body=#c_cons{anno=[compiler_generated], hd=X, tl=Xs}}, CC2 = #c_clause{pats=[#c_literal{val=false}], guard=#c_literal{val=true}, body=Xs}, CC3 = #c_clause{pats=[X], guard=#c_literal{val=true}, @@ -821,11 +837,14 @@ call_1(#c_call{anno=Anno}, lists, filter, [Arg1,Arg2], Sub) -> op=Loop, args=[Xs]}, body=Case}}}, - C2 = #c_clause{pats=[#c_literal{val=[]}], guard=#c_literal{val=true}, + C2 = #c_clause{pats=[#c_literal{val=[]}], + guard=#c_call{module=#c_literal{val=erlang}, + name=#c_literal{val=is_function}, + args=[F, #c_literal{val=1}]}, body=#c_literal{val=[]}}, - Err2 = #c_tuple{es=[#c_literal{val='function_clause'}, Xs]}, + Err2 = #c_tuple{es=[#c_literal{val='function_clause'}, F, Xs]}, C3 = #c_clause{pats=[Xs], guard=#c_literal{val=true}, - body=match_fail(Anno, Err2)}, + body=match_fail([{function_name,{'lists^filter',1}}|Anno], Err2)}, Fun = #c_fun{vars=[Xs], body=#c_case{arg=Xs, clauses=[C1, C2, C3]}}, L = #c_var{name='L'}, @@ -845,10 +864,14 @@ call_1(#c_call{anno=Anno}, lists, foldl, [Arg1,Arg2,Arg3], Sub) -> args=[Xs, #c_apply{anno=Anno, op=F, args=[X, A]}]}}, - C2 = #c_clause{pats=[#c_literal{val=[]}], guard=#c_literal{val=true}, body=A}, - Err = #c_tuple{es=[#c_literal{val='function_clause'}, Xs]}, + C2 = #c_clause{pats=[#c_literal{val=[]}], + guard=#c_call{module=#c_literal{val=erlang}, + name=#c_literal{val=is_function}, + args=[F, #c_literal{val=2}]}, + body=A}, + Err = #c_tuple{es=[#c_literal{val='function_clause'}, F, A, Xs]}, C3 = #c_clause{pats=[Xs], guard=#c_literal{val=true}, - body=match_fail(Anno, Err)}, + body=match_fail([{function_name,{'lists^foldl',2}}|Anno], Err)}, Fun = #c_fun{vars=[Xs, A], body=#c_case{arg=Xs, clauses=[C1, C2, C3]}}, L = #c_var{name='L'}, @@ -868,10 +891,14 @@ call_1(#c_call{anno=Anno}, lists, foldr, [Arg1,Arg2,Arg3], Sub) -> args=[X, #c_apply{anno=Anno, op=Loop, args=[Xs, A]}]}}, - C2 = #c_clause{pats=[#c_literal{val=[]}], guard=#c_literal{val=true}, body=A}, - Err = #c_tuple{es=[#c_literal{val='function_clause'}, Xs]}, + C2 = #c_clause{pats=[#c_literal{val=[]}], + guard=#c_call{module=#c_literal{val=erlang}, + name=#c_literal{val=is_function}, + args=[F, #c_literal{val=2}]}, + body=A}, + Err = #c_tuple{es=[#c_literal{val='function_clause'}, F, A, Xs]}, C3 = #c_clause{pats=[Xs], guard=#c_literal{val=true}, - body=match_fail(Anno, Err)}, + body=match_fail([{function_name,{'lists^foldr',2}}|Anno], Err)}, Fun = #c_fun{vars=[Xs, A], body=#c_case{arg=Xs, clauses=[C1, C2, C3]}}, L = #c_var{name='L'}, @@ -901,7 +928,10 @@ call_1(#c_call{anno=Anno}, lists, mapfoldl, [Arg1,Arg2,Arg3], Sub) -> op=Loop, args=[Xs, Avar]}, #c_tuple{es=[Xs, Avar]}, - #c_tuple{es=[#c_cons{hd=X, tl=Xs}, Avar]}) + #c_tuple{anno=[compiler_generated], + es=[#c_cons{anno=[compiler_generated], + hd=X, tl=Xs}, + Avar]}) %%% Multiple-value version %%% #c_let{vars=[Xs,A], %%% %% The tuple here will be optimised @@ -910,14 +940,18 @@ call_1(#c_call{anno=Anno}, lists, mapfoldl, [Arg1,Arg2,Arg3], Sub) -> %%% body=#c_values{es=[#c_cons{hd=X, tl=Xs}, %%% A]}} )}, - C2 = #c_clause{pats=[#c_literal{val=[]}], guard=#c_literal{val=true}, + C2 = #c_clause{pats=[#c_literal{val=[]}], + guard=#c_call{module=#c_literal{val=erlang}, + name=#c_literal{val=is_function}, + args=[F, #c_literal{val=2}]}, %%% Tuple passing version - body=#c_tuple{es=[#c_literal{val=[]}, Avar]}}, + body=#c_tuple{anno=[compiler_generated], + es=[#c_literal{val=[]}, Avar]}}, %%% Multiple-value version %%% body=#c_values{es=[#c_literal{val=[]}, A]}}, - Err = #c_tuple{es=[#c_literal{val='function_clause'}, Xs]}, + Err = #c_tuple{es=[#c_literal{val='function_clause'}, F, Avar, Xs]}, C3 = #c_clause{pats=[Xs], guard=#c_literal{val=true}, - body=match_fail(Anno, Err)}, + body=match_fail([{function_name,{'lists^mapfoldl',2}}|Anno], Err)}, Fun = #c_fun{vars=[Xs, Avar], body=#c_case{arg=Xs, clauses=[C1, C2, C3]}}, L = #c_var{name='L'}, @@ -955,7 +989,9 @@ call_1(#c_call{anno=Anno}, lists, mapfoldr, [Arg1,Arg2,Arg3], Sub) -> #c_tuple{es=[Xs, Avar]}, Match(#c_apply{anno=Anno, op=F, args=[X, Avar]}, #c_tuple{es=[X, Avar]}, - #c_tuple{es=[#c_cons{hd=X, tl=Xs}, Avar]})) + #c_tuple{anno=[compiler_generated], + es=[#c_cons{anno=[compiler_generated], + hd=X, tl=Xs}, Avar]})) %%% Multiple-value version %%% body=#c_let{vars=[Xs,A], %%% %% The tuple will be optimised away @@ -965,14 +1001,18 @@ call_1(#c_call{anno=Anno}, lists, mapfoldr, [Arg1,Arg2,Arg3], Sub) -> %%% #c_values{es=[#c_cons{hd=X, tl=Xs}, %%% A]})} }, - C2 = #c_clause{pats=[#c_literal{val=[]}], guard=#c_literal{val=true}, + C2 = #c_clause{pats=[#c_literal{val=[]}], + guard=#c_call{module=#c_literal{val=erlang}, + name=#c_literal{val=is_function}, + args=[F, #c_literal{val=2}]}, %%% Tuple passing version - body=#c_tuple{es=[#c_literal{val=[]}, Avar]}}, + body=#c_tuple{anno=[compiler_generated], + es=[#c_literal{val=[]}, Avar]}}, %%% Multiple-value version %%% body=#c_values{es=[#c_literal{val=[]}, A]}}, - Err = #c_tuple{es=[#c_literal{val='function_clause'}, Xs]}, + Err = #c_tuple{es=[#c_literal{val='function_clause'}, F, Avar, Xs]}, C3 = #c_clause{pats=[Xs], guard=#c_literal{val=true}, - body=match_fail(Anno, Err)}, + body=match_fail([{function_name,{'lists^mapfoldr',2}}|Anno], Err)}, Fun = #c_fun{vars=[Xs, Avar], body=#c_case{arg=Xs, clauses=[C1, C2, C3]}}, L = #c_var{name='L'}, diff --git a/lib/compiler/src/sys_expand_pmod.erl b/lib/compiler/src/sys_expand_pmod.erl deleted file mode 100644 index da644b4f0b..0000000000 --- a/lib/compiler/src/sys_expand_pmod.erl +++ /dev/null @@ -1,433 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2004-2011. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% --module(sys_expand_pmod). - -%% Expand function definition forms of parameterized module. We assume -%% all record definitions, imports, queries, etc., have been expanded -%% away. Any calls on the form 'foo(...)' must be calls to local -%% functions. Auto-generated functions (module_info,...) have not yet -%% been added to the function definitions, but are listed in 'defined' -%% and 'exports'. The automatic 'new/N' function is neither added to the -%% definitions nor to the 'exports'/'defines' lists yet. - --export([forms/4]). - --record(pmod, {parameters, exports, defined, predef}). - -%% TODO: more abstract handling of predefined/static functions. - -forms(Fs0, Ps, Es0, Ds0) -> - PreDef = [{module_info,0},{module_info,1}], - forms(Fs0, Ps, Es0, Ds0, PreDef). - -forms(Fs0, Ps, Es0, Ds0, PreDef) -> - St0 = #pmod{parameters=Ps,exports=Es0,defined=Ds0, predef=PreDef}, - {Fs1, St1} = forms(Fs0, St0), - Es1 = update_function_names(Es0, St1), - Ds1 = update_function_names(Ds0, St1), - Fs2 = update_forms(Fs1, St1), - {Fs2,Es1,Ds1}. - -%% This is extremely simplistic for now; all functions get an extra -%% parameter, whether they need it or not, except for static functions. - -update_function_names(Es, St) -> - [update_function_name(E, St) || E <- Es]. - -update_function_name(E={F,A}, St) when F =/= new -> - case ordsets:is_element(E, St#pmod.predef) of - true -> E; - false -> {F, A + 1} - end; -update_function_name(E, _St) -> - E. - -update_forms([{function,L,N,A,Cs}|Fs],St) when N =/= new -> - [{function,L,N,A+1,Cs}|update_forms(Fs,St)]; -update_forms([F|Fs],St) -> - [F|update_forms(Fs,St)]; -update_forms([],_St) -> - []. - -%% Process the program forms. - -forms([F0|Fs0],St0) -> - {F1,St1} = form(F0,St0), - {Fs1,St2} = forms(Fs0,St1), - {[F1|Fs1],St2}; -forms([], St0) -> - {[], St0}. - -%% Only function definitions are of interest here. State is not updated. -form({function,Line,Name0,Arity0,Clauses0},St) when Name0 =/= new -> - {Name,Arity,Clauses} = function(Name0, Arity0, Clauses0, St), - {{function,Line,Name,Arity,Clauses},St}; -%% Pass anything else through -form(F,St) -> {F,St}. - -function(Name, Arity, Clauses0, St) -> - Clauses1 = clauses(Clauses0,St), - {Name,Arity,Clauses1}. - -clauses([C|Cs],St) -> - {clause,L,H,G,B} = clause(C,St), - T = {tuple,L,[{var,L,V} || V <- ['_'|St#pmod.parameters]]}, - [{clause,L,H++[{match,L,T,{var,L,'THIS'}}],G,B}|clauses(Cs,St)]; -clauses([],_St) -> []. - -clause({clause,Line,H0,G0,B0},St) -> - H1 = head(H0,St), - G1 = guard(G0,St), - B1 = exprs(B0,St), - {clause,Line,H1,G1,B1}. - -head(Ps,St) -> patterns(Ps,St). - -patterns([P0|Ps],St) -> - P1 = pattern(P0,St), - [P1|patterns(Ps,St)]; -patterns([],_St) -> []. - -string_to_conses([], _Line, Tail) -> - Tail; -string_to_conses([E|Rest], Line, Tail) -> - {cons, Line, {integer, Line, E}, string_to_conses(Rest, Line, Tail)}. - -pattern({var,_Line,_V}=Var,_St) -> Var; -pattern({match,Line,L0,R0},St) -> - L1 = pattern(L0,St), - R1 = pattern(R0,St), - {match,Line,L1,R1}; -pattern({integer,_Line,_I}=Integer,_St) -> Integer; -pattern({char,_Line,_C}=Char,_St) -> Char; -pattern({float,_Line,_F}=Float,_St) -> Float; -pattern({atom,_Line,_A}=Atom,_St) -> Atom; -pattern({string,_Line,_S}=String,_St) -> String; -pattern({nil,_Line}=Nil,_St) -> Nil; -pattern({cons,Line,H0,T0},St) -> - H1 = pattern(H0,St), - T1 = pattern(T0,St), - {cons,Line,H1,T1}; -pattern({tuple,Line,Ps0},St) -> - Ps1 = pattern_list(Ps0,St), - {tuple,Line,Ps1}; -pattern({bin,Line,Fs},St) -> - Fs2 = pattern_grp(Fs,St), - {bin,Line,Fs2}; -pattern({op,_Line,'++',{nil,_},R},St) -> - pattern(R,St); -pattern({op,_Line,'++',{cons,Li,{char,_C2,_I}=Char,T},R},St) -> - pattern({cons,Li,Char,{op,Li,'++',T,R}},St); -pattern({op,_Line,'++',{cons,Li,{integer,_L2,_I}=Integer,T},R},St) -> - pattern({cons,Li,Integer,{op,Li,'++',T,R}},St); -pattern({op,_Line,'++',{string,Li,L},R},St) -> - pattern(string_to_conses(L, Li, R),St); -pattern({op,_Line,_Op,_A}=Op4,_St) -> Op4; -pattern({op,_Line,_Op,_L,_R}=Op5,_St) -> Op5. - -pattern_grp([{bin_element,L1,E1,S1,T1} | Fs],St) -> - S2 = case S1 of - default -> - default; - _ -> - expr(S1,St) - end, - T2 = case T1 of - default -> - default; - _ -> - bit_types(T1) - end, - [{bin_element,L1,expr(E1,St),S2,T2} | pattern_grp(Fs,St)]; -pattern_grp([],_St) -> - []. - -bit_types([]) -> - []; -bit_types([Atom | Rest]) when is_atom(Atom) -> - [Atom | bit_types(Rest)]; -bit_types([{Atom, Integer} | Rest]) when is_atom(Atom), is_integer(Integer) -> - [{Atom, Integer} | bit_types(Rest)]. - -pattern_list([P0|Ps],St) -> - P1 = pattern(P0,St), - [P1|pattern_list(Ps,St)]; -pattern_list([],_St) -> []. - -guard([G0|Gs],St) when is_list(G0) -> - [guard0(G0,St) | guard(Gs,St)]; -guard(L,St) -> - guard0(L,St). - -guard0([G0|Gs],St) -> - G1 = guard_test(G0,St), - [G1|guard0(Gs,St)]; -guard0([],_St) -> []. - -guard_test(Expr={call,Line,{atom,La,F},As0},St) -> - case erl_internal:type_test(F, length(As0)) of - true -> - As1 = gexpr_list(As0,St), - {call,Line,{atom,La,F},As1}; - _ -> - gexpr(Expr,St) - end; -guard_test(Any,St) -> - gexpr(Any,St). - -gexpr({var,_L,_V}=Var,_St) -> Var; -% %% alternative implementation of accessing module parameters -% case index(V,St#pmod.parameters) of -% N when N > 0 -> -% {call,L,{remote,L,{atom,L,erlang},{atom,L,element}}, -% [{integer,L,N+1},{var,L,'THIS'}]}; -% _ -> -% Var -% end; -gexpr({integer,_Line,_I}=Integer,_St) -> Integer; -gexpr({char,_Line,_C}=Char,_St) -> Char; -gexpr({float,_Line,_F}=Float,_St) -> Float; -gexpr({atom,_Line,_A}=Atom,_St) -> Atom; -gexpr({string,_Line,_S}=String,_St) -> String; -gexpr({nil,_Line}=Nil,_St) -> Nil; -gexpr({cons,Line,H0,T0},St) -> - H1 = gexpr(H0,St), - T1 = gexpr(T0,St), - {cons,Line,H1,T1}; -gexpr({tuple,Line,Es0},St) -> - Es1 = gexpr_list(Es0,St), - {tuple,Line,Es1}; -gexpr({call,Line,{atom,_La,F}=Atom,As0},St) -> - true = erl_internal:guard_bif(F, length(As0)), - As1 = gexpr_list(As0,St), - {call,Line,Atom,As1}; -%% Pre-expansion generated calls to erlang:is_record/3 must also be handled -gexpr({call,Line,{remote,La,{atom,Lb,erlang},{atom,Lc,is_record}},[_,_,_]=As0},St) -> - As1 = gexpr_list(As0,St), - {call,Line,{remote,La,{atom,Lb,erlang},{atom,Lc,is_record}},As1}; -%% Guard BIFs can be remote, but only in the module erlang... -gexpr({call,Line,{remote,La,{atom,Lb,erlang},{atom,Lc,F}},As0},St) -> - A = length(As0), - true = - erl_internal:guard_bif(F, A) orelse erl_internal:arith_op(F, A) orelse - erl_internal:comp_op(F, A) orelse erl_internal:bool_op(F, A), - As1 = gexpr_list(As0,St), - {call,Line,{remote,La,{atom,Lb,erlang},{atom,Lc,F}},As1}; -%% Unfortunately, writing calls as {M,F}(...) is also allowed. -gexpr({call,Line,{tuple,La,[{atom,Lb,erlang},{atom,Lc,F}]},As0},St) -> - A = length(As0), - true = - erl_internal:guard_bif(F, A) orelse erl_internal:arith_op(F, A) orelse - erl_internal:comp_op(F, A) orelse erl_internal:bool_op(F, A), - As1 = gexpr_list(As0,St), - {call,Line,{tuple,La,[{atom,Lb,erlang},{atom,Lc,F}]},As1}; -gexpr({bin,Line,Fs},St) -> - Fs2 = pattern_grp(Fs,St), - {bin,Line,Fs2}; -gexpr({op,Line,Op,A0},St) -> - true = erl_internal:arith_op(Op, 1) orelse erl_internal:bool_op(Op, 1), - A1 = gexpr(A0,St), - {op,Line,Op,A1}; -gexpr({op,Line,Op,L0,R0},St) -> - true = - Op =:= 'andalso' orelse Op =:= 'orelse' orelse - erl_internal:arith_op(Op, 2) orelse - erl_internal:bool_op(Op, 2) orelse erl_internal:comp_op(Op, 2), - L1 = gexpr(L0,St), - R1 = gexpr(R0,St), - {op,Line,Op,L1,R1}. - -gexpr_list([E0|Es],St) -> - E1 = gexpr(E0,St), - [E1|gexpr_list(Es,St)]; -gexpr_list([],_St) -> []. - -exprs([E0|Es],St) -> - E1 = expr(E0,St), - [E1|exprs(Es,St)]; -exprs([],_St) -> []. - -expr({var,_L,_V}=Var,_St) -> - Var; -% case index(V,St#pmod.parameters) of -% N when N > 0 -> -% {call,L,{remote,L,{atom,L,erlang},{atom,L,element}}, -% [{integer,L,N+1},{var,L,'THIS'}]}; -% _ -> -% Var -% end; -expr({integer,_Line,_I}=Integer,_St) -> Integer; -expr({float,_Line,_F}=Float,_St) -> Float; -expr({atom,_Line,_A}=Atom,_St) -> Atom; -expr({string,_Line,_S}=String,_St) -> String; -expr({char,_Line,_C}=Char,_St) -> Char; -expr({nil,_Line}=Nil,_St) -> Nil; -expr({cons,Line,H0,T0},St) -> - H1 = expr(H0,St), - T1 = expr(T0,St), - {cons,Line,H1,T1}; -expr({lc,Line,E0,Qs0},St) -> - Qs1 = lc_bc_quals(Qs0,St), - E1 = expr(E0,St), - {lc,Line,E1,Qs1}; -expr({bc,Line,E0,Qs0},St) -> - Qs1 = lc_bc_quals(Qs0,St), - E1 = expr(E0,St), - {bc,Line,E1,Qs1}; -expr({tuple,Line,Es0},St) -> - Es1 = expr_list(Es0,St), - {tuple,Line,Es1}; -expr({block,Line,Es0},St) -> - Es1 = exprs(Es0,St), - {block,Line,Es1}; -expr({'if',Line,Cs0},St) -> - Cs1 = icr_clauses(Cs0,St), - {'if',Line,Cs1}; -expr({'case',Line,E0,Cs0},St) -> - E1 = expr(E0,St), - Cs1 = icr_clauses(Cs0,St), - {'case',Line,E1,Cs1}; -expr({'receive',Line,Cs0},St) -> - Cs1 = icr_clauses(Cs0,St), - {'receive',Line,Cs1}; -expr({'receive',Line,Cs0,To0,ToEs0},St) -> - To1 = expr(To0,St), - ToEs1 = exprs(ToEs0,St), - Cs1 = icr_clauses(Cs0,St), - {'receive',Line,Cs1,To1,ToEs1}; -expr({'try',Line,Es0,Scs0,Ccs0,As0},St) -> - Es1 = exprs(Es0,St), - Scs1 = icr_clauses(Scs0,St), - Ccs1 = icr_clauses(Ccs0,St), - As1 = exprs(As0,St), - {'try',Line,Es1,Scs1,Ccs1,As1}; -expr({'fun',_,{function,_,_,_}}=ExtFun,_St) -> - ExtFun; -expr({'fun',Line,Body,Info},St) -> - case Body of - {clauses,Cs0} -> - Cs1 = fun_clauses(Cs0,St), - {'fun',Line,{clauses,Cs1},Info}; - {function,F,A} = Function -> - {F1,A1} = update_function_name({F,A},St), - if A1 =:= A -> - {'fun',Line,Function,Info}; - true -> - %% Must rewrite local fun-name to a fun that does a - %% call with the extra THIS parameter. - As = make_vars(A, Line), - As1 = As ++ [{var,Line,'THIS'}], - Call = {call,Line,{atom,Line,F1},As1}, - Cs = [{clause,Line,As,[],[Call]}], - {'fun',Line,{clauses,Cs},Info} - end; - {function,_M,_F,_A} = Fun4 -> %This is an error in lint! - {'fun',Line,Fun4,Info} - end; -expr({call,Lc,{atom,_,instance}=Name,As0},St) -> - %% All local functions 'instance(...)' are static by definition, - %% so they do not take a 'THIS' argument when called - As1 = expr_list(As0,St), - {call,Lc,Name,As1}; -expr({call,Lc,{atom,_,new}=Name,As0},St) -> - %% All local functions 'new(...)' are static by definition, - %% so they do not take a 'THIS' argument when called - As1 = expr_list(As0,St), - {call,Lc,Name,As1}; -expr({call,Lc,{atom,_,module_info}=Name,As0},St) - when length(As0) =:= 0; length(As0) =:= 1 -> - %% The module_info/0 and module_info/1 functions are also static. - As1 = expr_list(As0,St), - {call,Lc,Name,As1}; -expr({call,Lc,{atom,_Lf,_F}=Atom,As0},St) -> - %% Local function call - needs THIS parameter. - As1 = expr_list(As0,St), - {call,Lc,Atom,As1 ++ [{var,0,'THIS'}]}; -expr({call,Line,F0,As0},St) -> - %% Other function call - F1 = expr(F0,St), - As1 = expr_list(As0,St), - {call,Line,F1,As1}; -expr({'catch',Line,E0},St) -> - E1 = expr(E0,St), - {'catch',Line,E1}; -expr({match,Line,P0,E0},St) -> - E1 = expr(E0,St), - P1 = pattern(P0,St), - {match,Line,P1,E1}; -expr({bin,Line,Fs},St) -> - Fs2 = pattern_grp(Fs,St), - {bin,Line,Fs2}; -expr({op,Line,Op,A0},St) -> - A1 = expr(A0,St), - {op,Line,Op,A1}; -expr({op,Line,Op,L0,R0},St) -> - L1 = expr(L0,St), - R1 = expr(R0,St), - {op,Line,Op,L1,R1}; -%% The following are not allowed to occur anywhere! -expr({remote,Line,M0,F0},St) -> - M1 = expr(M0,St), - F1 = expr(F0,St), - {remote,Line,M1,F1}. - -expr_list([E0|Es],St) -> - E1 = expr(E0,St), - [E1|expr_list(Es,St)]; -expr_list([],_St) -> []. - -icr_clauses([C0|Cs],St) -> - C1 = clause(C0,St), - [C1|icr_clauses(Cs,St)]; -icr_clauses([],_St) -> []. - -lc_bc_quals([{generate,Line,P0,E0}|Qs],St) -> - E1 = expr(E0,St), - P1 = pattern(P0,St), - [{generate,Line,P1,E1}|lc_bc_quals(Qs,St)]; -lc_bc_quals([{b_generate,Line,P0,E0}|Qs],St) -> - E1 = expr(E0,St), - P1 = pattern(P0,St), - [{b_generate,Line,P1,E1}|lc_bc_quals(Qs,St)]; -lc_bc_quals([E0|Qs],St) -> - E1 = expr(E0,St), - [E1|lc_bc_quals(Qs,St)]; -lc_bc_quals([],_St) -> []. - -fun_clauses([C0|Cs],St) -> - C1 = clause(C0,St), - [C1|fun_clauses(Cs,St)]; -fun_clauses([],_St) -> []. - -%% %% Return index from 1 upwards, or 0 if not in the list. -%% -%% index(X,Ys) -> index(X,Ys,1). -%% -%% index(X,[X|Ys],A) -> A; -%% index(X,[Y|Ys],A) -> index(X,Ys,A+1); -%% index(X,[],A) -> 0. - -make_vars(N, L) -> - make_vars(1, N, L). - -make_vars(N, M, L) when N =< M -> - V = list_to_atom("X"++integer_to_list(N)), - [{var,L,V} | make_vars(N + 1, M, L)]; -make_vars(_, _, _) -> - []. diff --git a/lib/compiler/src/sys_pre_expand.erl b/lib/compiler/src/sys_pre_expand.erl index a8c69c3cb1..7d918a55ed 100644 --- a/lib/compiler/src/sys_pre_expand.erl +++ b/lib/compiler/src/sys_pre_expand.erl @@ -28,13 +28,12 @@ %% Main entry point. -export([module/2]). --import(ordsets, [from_list/1,add_element/2,union/2]). +-import(ordsets, [from_list/1,union/2]). -import(lists, [member/2,foldl/3,foldr/3]). -include("../include/erl_bits.hrl"). -record(expand, {module=[], %Module name - parameters=undefined, %Module parameters exports=[], %Exports imports=[], %Imports compile=[], %Compile flags @@ -74,88 +73,20 @@ module(Fs0, Opts0) -> }, %% Expand the functions. {Tfs,St1} = forms(Fs, define_functions(Fs, St0)), - {Efs,St2} = expand_pmod(Tfs, St1), %% Get the correct list of exported functions. - Exports = case member(export_all, St2#expand.compile) of - true -> gb_sets:to_list(St2#expand.defined); - false -> St2#expand.exports + Exports = case member(export_all, St1#expand.compile) of + true -> gb_sets:to_list(St1#expand.defined); + false -> St1#expand.exports end, %% Generate all functions from stored info. - {Ats,St3} = module_attrs(St2#expand{exports = Exports}), + {Ats,St3} = module_attrs(St1#expand{exports = Exports}), {Mfs,St4} = module_predef_funcs(St3), - {St4#expand.module, St4#expand.exports, Ats ++ Efs ++ Mfs, + {St4#expand.module, St4#expand.exports, Ats ++ Tfs ++ Mfs, St4#expand.compile}. compiler_options(Forms) -> lists:flatten([C || {attribute,_,compile,C} <- Forms]). -expand_pmod(Fs0, St0) -> - case St0#expand.parameters of - undefined -> - {Fs0,St0}; - Ps0 -> - Base = get_base(St0#expand.attributes), - Ps = if is_atom(Base) -> - ['BASE' | Ps0]; - true -> - Ps0 - end, - Def = gb_sets:to_list(St0#expand.defined), - {Fs1,Xs,Ds} = sys_expand_pmod:forms(Fs0, Ps, - St0#expand.exports, - Def), - St1 = St0#expand{exports=Xs,defined=gb_sets:from_list(Ds)}, - {Fs2,St2} = add_instance(Ps, Fs1, St1), - {Fs3,St3} = ensure_new(Base, Ps0, Fs2, St2), - {Fs3,St3#expand{attributes = [{abstract, 0, [true]} - | St3#expand.attributes]}} - end. - -get_base(As) -> - case lists:keyfind(extends, 1, As) of - {extends,_,[Base]} when is_atom(Base) -> - Base; - _ -> - [] - end. - -ensure_new(Base, Ps, Fs, St) -> - case has_new(Fs) of - true -> - {Fs, St}; - false -> - add_new(Base, Ps, Fs, St) - end. - -has_new([{function,_L,new,_A,_Cs} | _Fs]) -> - true; -has_new([_ | Fs]) -> - has_new(Fs); -has_new([]) -> - false. - -add_new(Base, Ps, Fs, St) -> - Vs = [{var,0,V} || V <- Ps], - As = if is_atom(Base) -> - [{call,0,{remote,0,{atom,0,Base},{atom,0,new}},Vs} | Vs]; - true -> - Vs - end, - Body = [{call,0,{atom,0,instance},As}], - add_func(new, Vs, Body, Fs, St). - -add_instance(Ps, Fs, St) -> - Vs = [{var,0,V} || V <- Ps], - AbsMod = [{tuple,0,[{atom,0,St#expand.module}|Vs]}], - add_func(instance, Vs, AbsMod, Fs, St). - -add_func(Name, Args, Body, Fs, St) -> - A = length(Args), - F = {function,0,Name,A,[{clause,0,Args,[],Body}]}, - NA = {Name,A}, - {[F|Fs],St#expand{exports=add_element(NA, St#expand.exports), - defined=gb_sets:add_element(NA, St#expand.defined)}}. - %% define_function(Form, State) -> State. %% Add function to defined if form is a function. @@ -235,10 +166,6 @@ forms([], St) -> {[],St}. %% attribute(Attribute, Value, Line, State) -> State'. %% Process an attribute, this just affects the state. -attribute(module, {Module, As}, _L, St) -> - true = is_atom(Module), - St#expand{module=Module, - parameters=As}; attribute(module, Module, _L, St) -> true = is_atom(Module), St#expand{module=Module}; diff --git a/lib/compiler/src/v3_kernel.erl b/lib/compiler/src/v3_kernel.erl index 8ef71e1346..b1bff47f69 100644 --- a/lib/compiler/src/v3_kernel.erl +++ b/lib/compiler/src/v3_kernel.erl @@ -235,16 +235,8 @@ gexpr_test_add(Ke, St0) -> %% expr(Cexpr, Sub, State) -> {Kexpr,[PreKexpr],State}. %% Convert a Core expression, flattening it at the same time. -expr(#c_var{anno=A,name={_Name,Arity}}=Fname, Sub, St) -> - %% A local in an expression. - %% For now, these are wrapped into a fun by reverse - %% etha-conversion, but really, there should be exactly one - %% such "lambda function" for each escaping local name, - %% instead of one for each occurrence as done now. - Vs = [#c_var{name=list_to_atom("V" ++ integer_to_list(V))} || - V <- integers(1, Arity)], - Fun = #c_fun{anno=A,vars=Vs,body=#c_apply{anno=A,op=Fname,args=Vs}}, - expr(Fun, Sub, St); +expr(#c_var{anno=A,name={Name,Arity}}, Sub, St) -> + {#k_local{anno=A,name=get_fsub(Name, Arity, Sub),arity=Arity},[],St}; expr(#c_var{anno=A,name=V}, Sub, St) -> {#k_var{anno=A,name=get_vsub(V, Sub)},[],St}; expr(#c_literal{anno=A,val=V}, _Sub, St) -> @@ -1663,6 +1655,19 @@ uexpr(#ifun{anno=A,vars=Vs,body=B0}, {break,Rs}, St0) -> #k_int{val=Index},#k_int{val=Uniq}|Fvs], ret=Rs}, Free,add_local_function(Fun, St)}; +uexpr(#k_local{anno=A,name=Name,arity=Arity}, {break,Rs}, St) -> + Fs = get_free(Name, Arity, St), + FsCount = length(Fs), + Free = lit_list_vars(Fs), + %% Set dummy values for Index and Uniq -- the real values will + %% be assigned by beam_asm. + Index = Uniq = 0, + Bif = #k_bif{anno=#k{us=Free,ns=lit_list_vars(Rs),a=A}, + op=#k_internal{name=make_fun,arity=FsCount+3}, + args=[#k_atom{val=Name},#k_int{val=FsCount+Arity}, + #k_int{val=Index},#k_int{val=Uniq}|Fs], + ret=Rs}, + {Bif,Free,St}; uexpr(Lit, {break,Rs0}, St0) -> %% Transform literals to puts here. %%ok = io:fwrite("uexpr ~w:~p~n", [?LINE,Lit]), @@ -1843,12 +1848,6 @@ make_list(Es) -> #c_cons{hd=E,tl=Acc} end, #c_literal{val=[]}, Es). -%% List of integers in interval [N,M]. Empty list if N > M. - -integers(N, M) when N =< M -> - [N|integers(N + 1, M)]; -integers(_, _) -> []. - %% is_in_guard(State) -> true|false. is_in_guard(#kern{guard_refc=Refc}) -> diff --git a/lib/compiler/test/Makefile b/lib/compiler/test/Makefile index 3b065ec3b9..b9c5be09ce 100644 --- a/lib/compiler/test/Makefile +++ b/lib/compiler/test/Makefile @@ -29,7 +29,6 @@ MODULES= \ match_SUITE \ misc_SUITE \ num_bif_SUITE \ - pmod_SUITE \ receive_SUITE \ record_SUITE \ trycatch_SUITE \ diff --git a/lib/compiler/test/inline_SUITE.erl b/lib/compiler/test/inline_SUITE.erl index e2eb6a0dec..6dc7548437 100644 --- a/lib/compiler/test/inline_SUITE.erl +++ b/lib/compiler/test/inline_SUITE.erl @@ -258,6 +258,49 @@ lists(Config) when is_list(Config) -> %% Cleanup. erase(?MODULE), + + {'EXIT',{function_clause,[{?MODULE,_,[_,not_a_list],_}|_]}} = + (catch lists:map(fun (X) -> X end, not_a_list)), + {'EXIT',{function_clause,[{?MODULE,_,[_,not_a_list],_}|_]}} = + (catch lists:flatmap(fun (X) -> X end, not_a_list)), + {'EXIT',{function_clause,[{?MODULE,_,[_,not_a_list],_}|_]}} = + (catch lists:foreach(fun (X) -> X end, not_a_list)), + {'EXIT',{function_clause,[{?MODULE,_,[_,not_a_list],_}|_]}} = + (catch lists:filter(fun (_) -> true end, not_a_list)), + {'EXIT',{function_clause,[{?MODULE,_,[_,not_a_list],_}|_]}} = + (catch lists:any(fun (_) -> false end, not_a_list)), + {'EXIT',{function_clause,[{?MODULE,_,[_,not_a_list],_}|_]}} = + (catch lists:all(fun (_) -> true end, not_a_list)), + {'EXIT',{function_clause,[{?MODULE,_,[_,acc,not_a_list],_}|_]}} = + (catch lists:foldl(fun (X, Acc) -> {X,Acc} end, acc, not_a_list)), + {'EXIT',{function_clause,[{?MODULE,_,[_,acc,not_a_list],_}|_]}} = + (catch lists:foldr(fun (X, Acc) -> {X,Acc} end, acc, not_a_list)), + {'EXIT',{function_clause,[{?MODULE,_,[_,acc,not_a_list],_}|_]}} = + (catch lists:mapfoldl(fun (X, Acc) -> {X,Acc} end, acc, not_a_list)), + {'EXIT',{function_clause,[{?MODULE,_,[_,acc,not_a_list],_}|_]}} = + (catch lists:mapfoldr(fun (X, Acc) -> {X,Acc} end, acc, not_a_list)), + + {'EXIT',{function_clause,[{?MODULE,_,[not_a_function,[]],_}|_]}} = + (catch lists:map(not_a_function, [])), + {'EXIT',{function_clause,[{?MODULE,_,[not_a_function,[]],_}|_]}} = + (catch lists:flatmap(not_a_function, [])), + {'EXIT',{function_clause,[{?MODULE,_,[not_a_function,[]],_}|_]}} = + (catch lists:foreach(not_a_function, [])), + {'EXIT',{function_clause,[{?MODULE,_,[not_a_function,[]],_}|_]}} = + (catch lists:filter(not_a_function, [])), + {'EXIT',{function_clause,[{?MODULE,_,[not_a_function,[]],_}|_]}} = + (catch lists:any(not_a_function, [])), + {'EXIT',{function_clause,[{?MODULE,_,[not_a_function,[]],_}|_]}} = + (catch lists:all(not_a_function, [])), + {'EXIT',{function_clause,[{?MODULE,_,[not_a_function,acc,[]],_}|_]}} = + (catch lists:foldl(not_a_function, acc, [])), + {'EXIT',{function_clause,[{?MODULE,_,[not_a_function,acc,[]],_}|_]}} = + (catch lists:foldr(not_a_function, acc, [])), + {'EXIT',{function_clause,[{?MODULE,_,[not_a_function,acc,[]],_}|_]}} = + (catch lists:mapfoldl(not_a_function, acc, [])), + {'EXIT',{function_clause,[{?MODULE,_,[not_a_function,acc,[]],_}|_]}} = + (catch lists:mapfoldr(not_a_function, acc, [])), + ok. my_apply(M, F, A, Init) -> diff --git a/lib/compiler/test/pmod_SUITE.erl b/lib/compiler/test/pmod_SUITE.erl deleted file mode 100644 index 5dd09a7245..0000000000 --- a/lib/compiler/test/pmod_SUITE.erl +++ /dev/null @@ -1,121 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2004-2011. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% --module(pmod_SUITE). - --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2, - init_per_testcase/2,end_per_testcase/2, - basic/1, otp_8447/1]). - --include_lib("test_server/include/test_server.hrl"). - -suite() -> [{ct_hooks,[ts_install_cth]}]. - -all() -> - test_lib:recompile(?MODULE), - [basic, otp_8447]. - -groups() -> - []. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - - -init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> - Dog = test_server:timetrap(?t:minutes(1)), - [{watchdog,Dog}|Config]. - -end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> - Dog = ?config(watchdog, Config), - ?t:timetrap_cancel(Dog), - ok. - -basic(Config) when is_list(Config) -> - ?line basic_1(Config, []), - ?line basic_1(Config, [inline]), - ?line basic_1(Config, [{inline,500},inline]), - ok. - -basic_1(Config, Opts) -> - io:format("Options: ~p\n", [Opts]), - ?line ok = compile_load(pmod_basic, Config, Opts), - - ?line Prop1 = pmod_basic:new([{a,xb},{b,true},{c,false}]), - ?line Prop2 = pmod_basic:new([{y,zz}]), - ?line io:format("Prop1 = ~p\n", [Prop1]), - ?line io:format("Prop2 = ~p\n", [Prop2]), - - ?line {a,xb} = Prop1:lookup(a), - ?line none = Prop1:lookup(glurf), - ?line false = Prop1:or_props([]), - ?line true = Prop1:or_props([b,c]), - ?line true = Prop1:or_props([b,d]), - ?line false = Prop1:or_props([d]), - - ?line none = Prop2:lookup(kalle), - ?line {y,zz} = Prop2:lookup(y), - ?line {a,xb} = Prop1:lookup(a), - - ?line Prop3 = Prop1:prepend({blurf,true}), - ?line io:format("Prop3 = ~p\n", [Prop3]), - ?line {blurf,true} = Prop3:lookup(blurf), - - Prop4 = Prop3:append(42), - ?line io:format("Prop4 = ~p\n", [Prop4]), - ?line {42,5} = Prop4:stupid_sum(), - - %% Some record guards. - ?line ok = Prop4:bar({s,0}), - ?line ok = Prop4:bar_bar({s,blurf}), - ?line error = Prop4:bar_bar({s,a,b}), - ?line error = Prop4:bar_bar([]), - - %% Call from a fun. - Fun = fun(Arg) -> Prop4:bar(Arg) end, - ?line ok = Fun({s,0}), - - [{y,[1,2]},{x,[5,19]}] = Prop4:collapse([{y,[2,1]},{x,[19,5]}]), - ok. - -otp_8447(Config) when is_list(Config) -> - ?line P = pmod_basic:new(foo), - ?line [0,0,1,1,1,0,0,1] = P:bc1(), - ?line <<10:4>> = P:bc2(), - ok. - -compile_load(Module, Conf, Opts) -> - ?line Dir = ?config(data_dir,Conf), - ?line Src = filename:join(Dir, atom_to_list(Module)), - ?line Out = ?config(priv_dir,Conf), - ?line CompRc = compile:file(Src, [report,{outdir,Out}|Opts]), - ?line {ok,Module} = CompRc, - ?line code:purge(Module), - ?line {module,Module} = - code:load_abs(filename:join(Out, atom_to_list(Module))), - ok. diff --git a/lib/compiler/test/pmod_SUITE_data/pmod_basic.erl b/lib/compiler/test/pmod_SUITE_data/pmod_basic.erl deleted file mode 100644 index 19cce452dc..0000000000 --- a/lib/compiler/test/pmod_SUITE_data/pmod_basic.erl +++ /dev/null @@ -1,83 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2004-2011. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% --module(pmod_basic, [Props]). - --export([lookup/1,or_props/1,prepend/1,append/1,stupid_sum/0]). --export([bar/1,bar_bar/1]). --export([bc1/0, bc2/0]). --export([collapse/1]). - -lookup(Key) -> - proplists:lookup(Key, Props). - -or_props(Keys) -> - Res = or_props_1(Keys, false), - true = is_bool(Res), %is_bool/1 does not use Props. - Res. - -prepend(Term) -> - new([Term|Props]). - -append(Term) -> - pmod_basic:new(Props++[Term]). - -or_props_1([K|Ks], Acc) -> - or_props_1(Ks, proplists:get_bool(K, Props) or Acc); -or_props_1([], Acc) -> Acc. - -is_bool(true) -> true; -is_bool(false) -> true; -is_bool(_) -> false. - -stupid_sum() -> - put(counter, 0), - Res = stupid_sum_1(Props, 0), - {Res,get(counter)}. - -stupid_sum_1([H|T], Sum0) -> - try add(Sum0, H) of - Sum -> stupid_sum_1(T, Sum) - catch - error:_ -> stupid_sum_1(T, Sum0) - after - bump() - end; -stupid_sum_1([], Sum) -> Sum. - -bump() -> - put(counter, get(counter)+1). - -add(A, B) -> - A+B. - --record(s, {a}). - -bar(S) when S#s.a == 0 -> ok. - -bar_bar(S) when is_record(S, s) -> ok; -bar_bar(_) -> error. - -bc1() -> - [A || <<A:1>> <= <<"9">> ]. - -bc2() -> - << <<A:1>> || A <- [1,0,1,0] >>. - -collapse(L) -> - lists:keymap(fun lists:sort/1, 2, L). diff --git a/lib/cosEvent/src/Makefile b/lib/cosEvent/src/Makefile index 7787fad786..2864ee0538 100644 --- a/lib/cosEvent/src/Makefile +++ b/lib/cosEvent/src/Makefile @@ -168,9 +168,9 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) - sed -e 's;%VSN%;$(VSN);' $(APP_SRC) > $(APP_TARGET) + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $(APP_SRC) > $(APP_TARGET) $(APPUP_TARGET): $(APPUP_SRC) - sed -e 's;%VSN%;$(VSN);' $(APPUP_SRC) > $(APPUP_TARGET) + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $(APPUP_SRC) > $(APPUP_TARGET) docs: @@ -179,12 +179,12 @@ docs: # ---------------------------------------------------- IDL-GENERATED: CosEventChannelAdmin.idl cosEventApp.idl CosEventComm.idl - erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosEventChannelAdmin.cfg"}' CosEventChannelAdmin.idl - mv $(GEN_HRL_FILES1) $(EXTERNAL_INC_PATH) - erlc $(ERL_IDL_FLAGS) +'{cfgfile,"cosEventApp.cfg"}' cosEventApp.idl - erlc $(ERL_IDL_FLAGS) CosEventComm.idl - mv $(GEN_HRL_FILES3) $(EXTERNAL_INC_PATH) - >IDL-GENERATED + $(gen_verbose)erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosEventChannelAdmin.cfg"}' CosEventChannelAdmin.idl + $(V_at)mv $(GEN_HRL_FILES1) $(EXTERNAL_INC_PATH) + $(V_at)erlc $(ERL_IDL_FLAGS) +'{cfgfile,"cosEventApp.cfg"}' cosEventApp.idl + $(V_at)erlc $(ERL_IDL_FLAGS) CosEventComm.idl + $(V_at)mv $(GEN_HRL_FILES3) $(EXTERNAL_INC_PATH) + $(V_at)>IDL-GENERATED $(GEN_FILES): IDL-GENERATED diff --git a/lib/cosEventDomain/src/Makefile b/lib/cosEventDomain/src/Makefile index 213d433c72..b4b74bd192 100644 --- a/lib/cosEventDomain/src/Makefile +++ b/lib/cosEventDomain/src/Makefile @@ -141,9 +141,9 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) - sed -e 's;%VSN%;$(VSN);' $(APP_SRC) > $(APP_TARGET) + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $(APP_SRC) > $(APP_TARGET) $(APPUP_TARGET): $(APPUP_SRC) - sed -e 's;%VSN%;$(VSN);' $(APPUP_SRC) > $(APPUP_TARGET) + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $(APPUP_SRC) > $(APPUP_TARGET) docs: @@ -151,9 +151,9 @@ docs: # Special Build Targets # ---------------------------------------------------- IDL-GENERATED: CosEventDomainAdmin.idl - erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosEventDomainAdmin.cfg"}' CosEventDomainAdmin.idl - mv $(GEN_HRL_FILES) $(EXTERNAL_INC_PATH) - >IDL-GENERATED + $(gen_verbose)erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosEventDomainAdmin.cfg"}' CosEventDomainAdmin.idl + $(V_at)mv $(GEN_HRL_FILES) $(EXTERNAL_INC_PATH) + $(V_at)>IDL-GENERATED $(GEN_FILES): IDL-GENERATED diff --git a/lib/cosFileTransfer/src/Makefile b/lib/cosFileTransfer/src/Makefile index d552349ede..9d3abb9bba 100644 --- a/lib/cosFileTransfer/src/Makefile +++ b/lib/cosFileTransfer/src/Makefile @@ -151,10 +151,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: @@ -162,9 +162,9 @@ docs: # Special Build Targets # ---------------------------------------------------- IDL-GENERATED: CosFileTransfer.idl - erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosFileTransfer.cfg"}' CosFileTransfer.idl - mv $(LOCAL_HRL_FILES) $(EXTERNAL_INC_PATH) - >IDL-GENERATED + $(gen_verbose)erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosFileTransfer.cfg"}' CosFileTransfer.idl + $(V_at)mv $(LOCAL_HRL_FILES) $(EXTERNAL_INC_PATH) + $(V_at)>IDL-GENERATED $(GEN_FILES): IDL-GENERATED diff --git a/lib/cosNotification/src/Makefile b/lib/cosNotification/src/Makefile index decf598bbf..13153bd7a1 100644 --- a/lib/cosNotification/src/Makefile +++ b/lib/cosNotification/src/Makefile @@ -332,10 +332,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: @@ -344,16 +344,16 @@ docs: # ---------------------------------------------------- IDL-GENERATED: CosNotification.idl CosNotifyChannelAdmin.idl \ CosNotifyFilter.idl cosNotificationAppComm.idl CosNotifyComm.idl - erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosNotification.cfg"}' CosNotification.idl - mv $(GEN_NOTIFICATION_HRL_FILES) $(EXTERNAL_INC_PATH) - erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosNotifyChannelAdmin.cfg"}' CosNotifyChannelAdmin.idl - mv $(GEN_CHANNELADMIN_HRL_FILES) $(EXTERNAL_INC_PATH) - erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosNotifyFilter.cfg"}' CosNotifyFilter.idl - mv $(GEN_NOTIFYFILTER_HRL_FILES) $(EXTERNAL_INC_PATH) - erlc $(ERL_IDL_FLAGS) +'{cfgfile,"cosNotificationComm.cfg"}' cosNotificationAppComm.idl - erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosNotifyComm.cfg"}' CosNotifyComm.idl - mv $(GEN_NOTIFYCOMM_HRL_FILES) $(EXTERNAL_INC_PATH) - >IDL-GENERATED + $(gen_verbose)erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosNotification.cfg"}' CosNotification.idl + $(V_at)mv $(GEN_NOTIFICATION_HRL_FILES) $(EXTERNAL_INC_PATH) + $(V_at)erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosNotifyChannelAdmin.cfg"}' CosNotifyChannelAdmin.idl + $(V_at)mv $(GEN_CHANNELADMIN_HRL_FILES) $(EXTERNAL_INC_PATH) + $(V_at)erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosNotifyFilter.cfg"}' CosNotifyFilter.idl + $(V_at)mv $(GEN_NOTIFYFILTER_HRL_FILES) $(EXTERNAL_INC_PATH) + $(V_at)erlc $(ERL_IDL_FLAGS) +'{cfgfile,"cosNotificationComm.cfg"}' cosNotificationAppComm.idl + $(V_at)erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosNotifyComm.cfg"}' CosNotifyComm.idl + $(V_at)mv $(GEN_NOTIFYCOMM_HRL_FILES) $(EXTERNAL_INC_PATH) + $(V_at)>IDL-GENERATED $(IDL_GEN_ERL_FILES) $(IDL_GEN_HRL_FILES): IDL-GENERATED diff --git a/lib/cosProperty/src/Makefile b/lib/cosProperty/src/Makefile index 54d1b6021c..d7b75d8bc5 100644 --- a/lib/cosProperty/src/Makefile +++ b/lib/cosProperty/src/Makefile @@ -151,10 +151,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: @@ -162,9 +162,9 @@ docs: # Special Build Targets # ---------------------------------------------------- IDL-GENERATED: CosProperty.idl - erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosProperty.cfg"}' CosProperty.idl - mv $(LOCAL_HRL_FILES) $(EXTERNAL_INC_PATH) - >IDL-GENERATED + $(gen_verbose)erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosProperty.cfg"}' CosProperty.idl + $(V_at)mv $(LOCAL_HRL_FILES) $(EXTERNAL_INC_PATH) + $(V_at)>IDL-GENERATED $(GEN_FILES): IDL-GENERATED diff --git a/lib/cosTime/src/Makefile b/lib/cosTime/src/Makefile index e8536a3f0a..0ab2b414ce 100644 --- a/lib/cosTime/src/Makefile +++ b/lib/cosTime/src/Makefile @@ -166,10 +166,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: @@ -177,13 +177,13 @@ docs: # Special Build Targets # ---------------------------------------------------- IDL-GENERATED: TimeBase.idl CosTime.idl CosTimerEvent.idl - erlc $(ERL_IDL_FLAGS) TimeBase.idl - mv $(GEN_TIMEBASE_HRL_FILES) $(EXTERNAL_INC_PATH) - erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosTime.cfg"}' CosTime.idl - mv $(GEN_COSTIME_HRL_FILES) $(EXTERNAL_INC_PATH) - erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosTimerEvent.cfg"}' CosTimerEvent.idl - mv $(GEN_COSTIMEREVENT_HRL_FILES) $(EXTERNAL_INC_PATH) - >IDL-GENERATED + $(gen_verbose)erlc $(ERL_IDL_FLAGS) TimeBase.idl + $(V_at)mv $(GEN_TIMEBASE_HRL_FILES) $(EXTERNAL_INC_PATH) + $(V_at)erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosTime.cfg"}' CosTime.idl + $(V_at)mv $(GEN_COSTIME_HRL_FILES) $(EXTERNAL_INC_PATH) + $(V_at)erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosTimerEvent.cfg"}' CosTimerEvent.idl + $(V_at)mv $(GEN_COSTIMEREVENT_HRL_FILES) $(EXTERNAL_INC_PATH) + $(V_at)>IDL-GENERATED $(GEN_FILES): IDL-GENERATED diff --git a/lib/cosTransactions/src/Makefile b/lib/cosTransactions/src/Makefile index 1d935c4d1d..7b4a9cf858 100644 --- a/lib/cosTransactions/src/Makefile +++ b/lib/cosTransactions/src/Makefile @@ -145,10 +145,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) - sed -e 's;%VSN%;$(VSN);' $(APP_SRC) > $(APP_TARGET) + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $(APP_SRC) > $(APP_TARGET) $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: @@ -156,9 +156,9 @@ docs: # Special Build Targets # ---------------------------------------------------- IDL-GENERATED: CosTransactions.idl - erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosTransactions.cfg"}' CosTransactions.idl - mv $(GEN_HRL_FILES) $(EXTERNAL_INC_PATH) - >IDL-GENERATED + $(gen_verbose)erlc $(ERL_IDL_FLAGS) +'{cfgfile,"CosTransactions.cfg"}' CosTransactions.idl + $(V_at)mv $(GEN_HRL_FILES) $(EXTERNAL_INC_PATH) + $(V_at)>IDL-GENERATED $(GEN_FILES): IDL-GENERATED diff --git a/lib/crypto/c_src/Makefile.in b/lib/crypto/c_src/Makefile.in index e19d6617f3..a20ddff05c 100644 --- a/lib/crypto/c_src/Makefile.in +++ b/lib/crypto/c_src/Makefile.in @@ -108,16 +108,16 @@ _create_dirs := $(shell mkdir -p $(OBJDIR) $(LIBDIR)) debug opt valgrind: $(NIF_LIB) $(CALLBACK_LIB) $(OBJDIR)/%$(TYPEMARKER).o: %.c - $(INSTALL_DIR) $(OBJDIR) - $(CC) -c -o $@ $(ALL_CFLAGS) $< + $(V_at)$(INSTALL_DIR) $(OBJDIR) + $(V_CC) -c -o $@ $(ALL_CFLAGS) $< $(LIBDIR)/crypto$(TYPEMARKER).so: $(CRYPTO_OBJS) - $(INSTALL_DIR) $(LIBDIR) - $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(CRYPTO_LINK_LIB) + $(V_at)$(INSTALL_DIR) $(LIBDIR) + $(V_LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(CRYPTO_LINK_LIB) $(LIBDIR)/crypto$(TYPEMARKER).dll: $(CRYPTO_OBJS) - $(INSTALL_DIR) $(LIBDIR) - $(LD) $(LDFLAGS) -o $@ $(SSL_DED_LD_RUNTIME_LIBRARY_PATH) -L$(SSL_LIBDIR) $(CRYPTO_OBJS) -l$(SSL_CRYPTO_LIBNAME) -l$(SSL_SSL_LIBNAME) + $(V_at)$(INSTALL_DIR) $(LIBDIR) + $(V_LD) $(LDFLAGS) -o $@ $(SSL_DED_LD_RUNTIME_LIBRARY_PATH) -L$(SSL_LIBDIR) $(CRYPTO_OBJS) -l$(SSL_CRYPTO_LIBNAME) -l$(SSL_SSL_LIBNAME) ifeq ($(DYNAMIC_CRYPTO_LIB),yes) $(LIBDIR)/crypto_callback$(TYPEMARKER).so: $(CALLBACK_OBJS) diff --git a/lib/crypto/src/Makefile b/lib/crypto/src/Makefile index 910e89363c..5c200742ac 100644 --- a/lib/crypto/src/Makefile +++ b/lib/crypto/src/Makefile @@ -70,10 +70,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: diff --git a/lib/debugger/src/Makefile b/lib/debugger/src/Makefile index e8b350c0c7..cadde8cd1b 100644 --- a/lib/debugger/src/Makefile +++ b/lib/debugger/src/Makefile @@ -112,10 +112,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: diff --git a/lib/dialyzer/src/Makefile b/lib/dialyzer/src/Makefile index 63cc1c98f1..bb2edd419a 100644 --- a/lib/dialyzer/src/Makefile +++ b/lib/dialyzer/src/Makefile @@ -108,22 +108,22 @@ clean: # ---------------------------------------------------- $(EBIN)/dialyzer_cl_parse.$(EMULATOR): dialyzer_cl_parse.erl ../vsn.mk - erlc -W $(ERL_COMPILE_FLAGS) -DVSN="\"v$(VSN)\"" -o$(EBIN) dialyzer_cl_parse.erl + $(erlc_verbose)erlc -W $(ERL_COMPILE_FLAGS) -DVSN="\"v$(VSN)\"" -o$(EBIN) dialyzer_cl_parse.erl $(EBIN)/dialyzer_plt.$(EMULATOR): dialyzer_plt.erl ../vsn.mk - erlc -W $(ERL_COMPILE_FLAGS) -DVSN="\"v$(VSN)\"" -o$(EBIN) dialyzer_plt.erl + $(erlc_verbose)erlc -W $(ERL_COMPILE_FLAGS) -DVSN="\"v$(VSN)\"" -o$(EBIN) dialyzer_plt.erl $(EBIN)/dialyzer_gui.$(EMULATOR): dialyzer_gui.erl ../vsn.mk - erlc -W $(ERL_COMPILE_FLAGS) -DVSN="\"v$(VSN)\"" -o$(EBIN) dialyzer_gui.erl + $(erlc_verbose)erlc -W $(ERL_COMPILE_FLAGS) -DVSN="\"v$(VSN)\"" -o$(EBIN) dialyzer_gui.erl $(EBIN)/dialyzer_gui_wx.$(EMULATOR): dialyzer_gui_wx.erl ../vsn.mk - erlc -W $(ERL_COMPILE_FLAGS) -DVSN="\"v$(VSN)\"" -o$(EBIN) dialyzer_gui_wx.erl + $(erlc_verbose)erlc -W $(ERL_COMPILE_FLAGS) -DVSN="\"v$(VSN)\"" -o$(EBIN) dialyzer_gui_wx.erl $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # --------------------------------------------------------------------- # dependencies -- I wish they were somehow automatically generated diff --git a/lib/diameter/doc/src/Makefile b/lib/diameter/doc/src/Makefile index 8ad38ba0d5..0cbe1f000f 100644 --- a/lib/diameter/doc/src/Makefile +++ b/lib/diameter/doc/src/Makefile @@ -173,8 +173,8 @@ release_spec: depend.mk: depend.sed Makefile seealso.ent \ $(XML_REF_FILES) $(XML_CHAPTER_FILES) - sed -f seehere.sed seealso.ent > seehere.ent - (for f in $(XML_REF_FILES) $(XML_CHAPTER_FILES); do \ + $(gen_verbose)sed -f seehere.sed seealso.ent > seehere.ent + $(V_at)(for f in $(XML_REF_FILES) $(XML_CHAPTER_FILES); do \ sed -f $< $$f | sed "s@%FILE%@`basename $$f .xml`@g"; \ done) \ > $@ diff --git a/lib/diameter/doc/src/notes.xml b/lib/diameter/doc/src/notes.xml index d448b01eba..d241e2bd19 100644 --- a/lib/diameter/doc/src/notes.xml +++ b/lib/diameter/doc/src/notes.xml @@ -42,6 +42,22 @@ first.</p> <!-- ===================================================================== --> +<section><title>Diameter 1.3.1</title> + + <section><title>Known Bugs and Problems</title> + <list> + <item> + <p> + Fix function clause resulting from use of an eval + callback.</p> + <p> + Own Id: OTP-10685</p> + </item> + </list> + </section> + +</section> + <section><title>Diameter 1.3</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/diameter/src/Makefile b/lib/diameter/src/Makefile index 060659bce9..60bb7e6a10 100644 --- a/lib/diameter/src/Makefile +++ b/lib/diameter/src/Makefile @@ -119,7 +119,7 @@ ERL_COMPILE_FLAGS += \ # erl/hrl from dictionary file. gen/diameter_gen_%.erl gen/diameter_gen_%.hrl: dict/%.dia - ../bin/diameterc -o gen -i $(EBIN) $< + $(dia_verbose)../bin/diameterc -o gen -i $(EBIN) $< opt: $(TARGET_FILES) @@ -128,17 +128,17 @@ debug: # The dictionary parser. gen/$(DICT_YRL).erl: compiler/$(DICT_YRL).yrl - $(ERLC) -Werror -o $(@D) $< + $(yecc_verbose)$(ERLC) -Werror -o $(@D) $< # Generate the app file. $(APP_TARGET): $(APP_SRC) ../vsn.mk modules.mk - M=`echo $(notdir $(APP_MODULES)) | tr ' ' ,`; \ + $(gen_verbose)M=`echo $(notdir $(APP_MODULES)) | tr ' ' ,`; \ sed -e 's;%VSN%;$(VSN);' \ -e "s;%MODULES%;$$M;" \ $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ app: $(APP_TARGET) $(APPUP_TARGET) dict: $(DICT_ERLS) @@ -254,7 +254,7 @@ depend: depend.mk # Generate dependencies makefile. depend.mk: depend.sed $(MODULES:%=%.erl) Makefile - (for f in $(MODULES); do \ + $(gen_verbose)(for f in $(MODULES); do \ (echo $$f; cat $$f.erl) | sed -f $<; \ done) \ > $@ diff --git a/lib/diameter/src/base/diameter.appup.src b/lib/diameter/src/base/diameter.appup.src index 5655f98c1b..a04a387918 100644 --- a/lib/diameter/src/base/diameter.appup.src +++ b/lib/diameter/src/base/diameter.appup.src @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010-2012. All Rights Reserved. +%% Copyright Ericsson AB 2010-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -24,27 +24,9 @@ {"0.10", [{restart_application, diameter}]}, {"1.0", [{restart_application, diameter}]}, {"1.1", [{restart_application, diameter}]}, - {"1.2", [{load, diameter}, - {load, diameter_capx}, - {load, diameter_codec}, - {load, diameter_peer}, - {load, diameter_reg}, - %% order significant from here - {load, diameter_session}, - {load, diameter_peer_fsm}, - {load, diameter_service}, - {load, diameter_watchdog}, - {load, diameter_config}]}, - {"1.2.1", [{load, diameter}, - {load, diameter_capx}, - {load, diameter_peer}, - {load, diameter_reg}, - %% order significant from here - {load, diameter_session}, - {load, diameter_peer_fsm}, - {load, diameter_service}, - {load, diameter_watchdog}, - {load, diameter_config}]} + {"1.2", [{restart_application, diameter}]}, + {"1.2.1", [{restart_application, diameter}]}, + {"1.3", [{load_module, diameter_service}]} ], [ {"0.9", [{restart_application, diameter}]}, @@ -52,6 +34,7 @@ {"1.0", [{restart_application, diameter}]}, {"1.1", [{restart_application, diameter}]}, {"1.2", [{restart_application, diameter}]}, - {"1.2.1", [{restart_application, diameter}]} + {"1.2.1", [{restart_application, diameter}]}, + {"1.3", [{load_module, diameter_service}]} ] }. diff --git a/lib/diameter/src/base/diameter_codec.erl b/lib/diameter/src/base/diameter_codec.erl index a94d37f7a8..0b0bfe3f0a 100644 --- a/lib/diameter/src/base/diameter_codec.erl +++ b/lib/diameter/src/base/diameter_codec.erl @@ -193,9 +193,11 @@ encode_avps(Avps) -> msg_header(Mod, 'answer-message' = MsgName, Header) -> ?BASE = Mod, - #diameter_header{cmd_code = Code} = Header, - {_, Flags, ApplId} = ?BASE:msg_header(MsgName), - {Code, Flags, ApplId}; + #diameter_header{application_id = Aid, + cmd_code = Code} + = Header, + {-1, Flags, ?DIAMETER_APP_ID_COMMON} = ?BASE:msg_header(MsgName), + {Code, Flags, Aid}; msg_header(Mod, MsgName, _) -> Mod:msg_header(MsgName). diff --git a/lib/diameter/src/base/diameter_peer_fsm.erl b/lib/diameter/src/base/diameter_peer_fsm.erl index c4320fcb99..858870566f 100644 --- a/lib/diameter/src/base/diameter_peer_fsm.erl +++ b/lib/diameter/src/base/diameter_peer_fsm.erl @@ -388,8 +388,9 @@ transition({diameter, {recv, Pkt}}, S) -> recv(Pkt, S); %% Timeout when still in the same state ... -transition({timeout, PS}, #state{state = PS}) -> - {stop, {capx(PS), timeout}}; +transition({timeout = T, PS}, #state{state = PS} = S) -> + close({capx(PS), T}, S), + stop; %% ... or not. transition({timeout, _}, _) -> diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index 91384b8b91..b5584ca0d0 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010-2012. All Rights Reserved. +%% Copyright Ericsson AB 2010-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -859,10 +859,10 @@ i(SvcName) -> true = ets:insert_new(?STATE_TABLE, S), %% Start fsms for each transport. + send_event(SvcName, start), lists:foreach(fun(T) -> start_fsm(T,S) end, CL), init_shared(S), - send_event(SvcName, start), S. cfg_acc({SvcName, #diameter_service{applications = Apps} = Rec, Opts}, @@ -1457,7 +1457,7 @@ make_prepare_packet(Mask, #diameter_packet{header = Hdr} = Pkt) -> make_prepare_packet(Mask, Msg) -> make_prepare_packet(Mask, #diameter_packet{msg = Msg}). -%% make_prepare_header/1 +%% make_prepare_header/2 make_prepare_header(Mask, undefined) -> Seq = diameter_session:sequence(Mask), @@ -1465,10 +1465,11 @@ make_prepare_header(Mask, undefined) -> hop_by_hop_id = Seq}); make_prepare_header(Mask, #diameter_header{end_to_end_id = undefined, - hop_by_hop_id = undefined}) -> + hop_by_hop_id = undefined} + = H) -> Seq = diameter_session:sequence(Mask), - make_prepare_header(#diameter_header{end_to_end_id = Seq, - hop_by_hop_id = Seq}); + make_prepare_header(H#diameter_header{end_to_end_id = Seq, + hop_by_hop_id = Seq}); make_prepare_header(Mask, #diameter_header{end_to_end_id = undefined} = H) -> Seq = diameter_session:sequence(Mask), @@ -2053,15 +2054,21 @@ request_cb({eval_packet, RC, F}, App, Mask, T, TC, Fs, Pkt) -> request_cb(RC, App, Mask, T, TC, [F|Fs], Pkt); request_cb({eval, RC, F}, App, Mask, T, TC, Fs, Pkt) -> - request_cb(RC, App, Mask, T, TC, Pkt, Fs), + request_cb(RC, App, Mask, T, TC, Fs, Pkt), diameter_lib:eval(F). %% protocol_error/5 protocol_error(RC, {_, OH, OR}, TPid, Fs, Pkt) -> - #diameter_packet{avps = Avps} = Pkt, + #diameter_packet{avps = Avps, errors = Es} = Pkt, ?LOG({error, RC}, Pkt), - reply(answer_message({OH, OR, RC}, Avps), ?BASE, TPid, Fs, Pkt). + reply(answer_message({OH, OR, RC}, Avps), + ?BASE, + TPid, + Fs, + Pkt#diameter_packet{errors = [RC | Es]}). +%% Note that reply/5 may set the result code once more. It's set in +%% answer_message/2 in case reply/5 doesn't. %% protocol_error/4 @@ -2174,7 +2181,8 @@ is_loop(Code, Vid, OH, Avps) -> %% %% Send a locally originating reply. -%% Skip the setting of Result-Code and Failed-AVP's below. +%% Skip the setting of Result-Code and Failed-AVP's below. This is +%% currently undocumented. reply([Msg], Dict, TPid, Fs, Pkt) when is_list(Msg); is_tuple(Msg) -> @@ -2242,6 +2250,9 @@ rc(RC) -> %% rc/4 +rc(#diameter_packet{msg = Rec} = Pkt, RC, Failed, Dict) -> + Pkt#diameter_packet{msg = rc(Rec, RC, Failed, Dict)}; + rc(Rec, RC, Failed, Dict) when is_integer(RC) -> set(Rec, diff --git a/lib/diameter/test/diameter_event_SUITE.erl b/lib/diameter/test/diameter_event_SUITE.erl new file mode 100644 index 0000000000..7c1c76f22a --- /dev/null +++ b/lib/diameter/test/diameter_event_SUITE.erl @@ -0,0 +1,182 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2013. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%% +%% Tests of events sent as a consequence of diameter:subscribe/1. +%% Watchdog events are dealt with more extensively in the watchdog +%% suite. +%% + +-module(diameter_event_SUITE). + +-export([suite/0, + all/0, + init_per_testcase/2, + end_per_testcase/2]). + +%% testcases +-export([start/1, + start_server/1, + up/1, + down/1, + cea_timeout/1, + stop/1]). + +-include("diameter.hrl"). + +%% =========================================================================== + +-define(util, diameter_util). + +-define(ADDR, {127,0,0,1}). +-define(REALM, "REALM"). + +-define(SERVER, "SERVER.SERVER-REALM"). +-define(CLIENT, "CLIENT.CLIENT-REALM"). + +-define(DICT_COMMON, ?DIAMETER_DICT_COMMON). +-define(DICT_ACCT, ?DIAMETER_DICT_ACCOUNTING). + +-define(SERVER_CAPX_TMO, 6000). + +%% Config for diameter:start_service/2. +-define(SERVICE(Host, Dicts), + [{'Origin-Host', Host}, + {'Origin-Realm', realm(Host)}, + {'Host-IP-Address', [?ADDR]}, + {'Vendor-Id', 12345}, + {'Product-Name', "OTP/diameter"}, + {'Acct-Application-Id', [D:id() || D <- Dicts]} + | [{application, [{dictionary, D}, + {module, #diameter_callback{}}]} + || D <- Dicts]]). + +%% Diameter Result-Code's: +-define(NO_COMMON_APP, 5010). + +%% =========================================================================== + +suite() -> + [{timetrap, {seconds, 60}}]. + +all() -> + [start, + start_server, + up, + down, + cea_timeout, + stop]. + +init_per_testcase(Name, Config) -> + [{name, Name} | Config]. + +end_per_testcase(_, _) -> + ok. + +%% =========================================================================== +%% start/stop testcases + +start(_Config) -> + ok = diameter:start(). + +start_server(Config) -> + diameter:subscribe(?SERVER), + ok = diameter:start_service(?SERVER, ?SERVICE(?SERVER, [?DICT_COMMON])), + LRef = ?util:listen(?SERVER, tcp, [{capabilities_cb, fun capx_cb/2}, + {capx_timeout, ?SERVER_CAPX_TMO}]), + [PortNr] = ?util:lport(tcp, LRef, 20), + ?util:write_priv(Config, portnr, PortNr), + start = event(?SERVER). + +%% Connect with matching capabilities and expect the connection to +%% come up. +up(Config) -> + {Svc, Ref} = connect(Config, []), + start = event(Svc), + {up, Ref, {_,_Caps}, _Config, #diameter_packet{}} = event(Svc), + {watchdog, Ref, _, {initial, okay}, _} = event(Svc). + +%% Connect with non-matching capabilities and expect CEA from the peer +%% to indicate as much and then for the transport to be restarted +%% (after reconnect_timer). +down(Config) -> + {Svc, Ref} = connect(Config, [{capabilities, [{'Acct-Application-Id', + [?DICT_ACCT:id()]}]}, + {applications, [?DICT_ACCT]}, + {reconnect_timer, 5000}]), + start = event(Svc), + {watchdog, Ref, _, {initial, down}, _} = event(Svc), + {closed, Ref, {'CEA', ?NO_COMMON_APP, _, #diameter_packet{}}, _} + = event(Svc), + {reconnect, Ref, _} = event(Svc). + +%% Connect with matching capabilities but have the server delay its +%% CEA and cause the client to timeout. +cea_timeout(Config) -> + {Svc, Ref} = connect(Config, [{capx_timeout, ?SERVER_CAPX_TMO div 2}, + {reconnect_timer, 2*?SERVER_CAPX_TMO}]), + start = event(Svc), + {watchdog, Ref, _, {initial, down}, _} = event(Svc), + {closed, Ref, {'CEA', timeout}, _} = event(Svc). + +stop(_Config) -> + ok = diameter:stop(). + +%% ---------------------------------------- + +%% Keep the server from sending CEA until the client has timed out. +capx_cb(_, #diameter_caps{origin_host = {_, "cea_timeout-" ++ _}}) -> + receive after ?SERVER_CAPX_TMO -> ok end; + +%% Or not. +capx_cb(_, _Caps) -> + ok. + +%% ---------------------------------------- + +%% Use the testcase name to construct Origin-Host of the client so +%% that the server can match on it in capx_cb/2. +connect(Config, Opts) -> + Pre = atom_to_list(proplists:get_value(name, Config)), + Name = Pre ++ uniq() ++ ?CLIENT, + diameter:subscribe(Name), + ok = start_service(Name, ?SERVICE(Name, [?DICT_COMMON, ?DICT_ACCT])), + {ok, Ref} = diameter:add_transport(Name, opts(Config, Opts)), + {Name, Ref}. + +uniq() -> + {MS,S,US} = now(), + lists:flatten(io_lib:format("-~p-~p-~p-", [MS,S,US])). + +event(Name) -> + receive #diameter_event{service = Name, info = T} -> T end. + +start_service(Name, Opts) -> + diameter:start_service(Name, [{monitor, self()} | Opts]). + +opts(Config, Opts) -> + PortNr = ?util:read_priv(Config, portnr), + + {connect, [{transport_module, diameter_tcp}, + {transport_config, [{ip, ?ADDR}, {port, 0}, + {raddr, ?ADDR}, {rport, PortNr}]} + | Opts]}. + +realm(Host) -> + tl(lists:dropwhile(fun(C) -> C /= $. end, Host)). diff --git a/lib/diameter/test/diameter_traffic_SUITE.erl b/lib/diameter/test/diameter_traffic_SUITE.erl index c157b0e304..b03a9ce4d1 100644 --- a/lib/diameter/test/diameter_traffic_SUITE.erl +++ b/lib/diameter/test/diameter_traffic_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010-2012. All Rights Reserved. +%% Copyright Ericsson AB 2010-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -38,7 +38,9 @@ result_codes/1, send_ok/1, send_nok/1, + send_eval/1, send_bad_answer/1, + send_protocol_error/1, send_arbitrary/1, send_unknown/1, send_unknown_mandatory/1, @@ -47,6 +49,9 @@ send_unsupported_app/1, send_error_bit/1, send_unsupported_version/1, + send_invalid_avp_bits/1, + send_invalid_avp_length/1, + send_invalid_reject/1, send_long/1, send_nopeer/1, send_noapp/1, @@ -112,17 +117,23 @@ %% Sequence mask for End-to-End and Hop-by-Hop identifiers. -define(CLIENT_MASK, {1,26}). %% 1 in top 6 bits -%% Run tests cases in different encoding variants. Send outgoing -%% messages as lists or records. +%% How to construct messages, as record or list. -define(ENCODINGS, [list, record]). -%% Identifers for client connections. --define(CONNECTIONS, [c1,c2,c3]). +%% How to send answers, in a diameter_packet or not. +-define(CONTAINERS, [pkt, msg]). + +%% Send over multiple connections that are mapped onto +%% [{E,P} || E <- ?ENCODINGS, P <- ?CONTAINERS]. +-define(CONNECTIONS, [c0,c1,c2,c3]). %% Not really what we should be setting unless the message is sent in %% the common application but diameter doesn't care. -define(APP_ID, ?DIAMETER_APP_ID_COMMON). +%% An Application-ID the server doesn't support. +-define(BAD_APP, 42). + %% Config for diameter:start_service/2. -define(SERVICE(Name), [{'Origin-Host', Name ++ "." ++ ?REALM}, @@ -158,6 +169,8 @@ ?'DIAMETER_BASE_RESULT-CODE_DIAMETER_REALM_NOT_SERVED'). -define(UNABLE_TO_DELIVER, ?'DIAMETER_BASE_RESULT-CODE_DIAMETER_UNABLE_TO_DELIVER'). +-define(INVALID_AVP_LENGTH, + ?'DIAMETER_BASE_RESULT-CODE_DIAMETER_INVALID_AVP_LENGTH'). -define(EVENT_RECORD, ?'DIAMETER_BASE_ACCOUNTING-RECORD-TYPE_EVENT_RECORD'). @@ -170,6 +183,8 @@ ?'DIAMETER_BASE_TERMINATION-CAUSE_DIAMETER_LOGOUT'). -define(BAD_ANSWER, ?'DIAMETER_BASE_TERMINATION-CAUSE_DIAMETER_BAD_ANSWER'). +-define(USER_MOVED, + ?'DIAMETER_BASE_TERMINATION-CAUSE_DIAMETER_USER_MOVED'). -define(A, list_to_atom). -define(L, atom_to_list). @@ -183,14 +198,17 @@ suite() -> all() -> [start, start_services, add_transports, result_codes] - ++ [{group, ?util:name([E,C]), P} || E <- ?ENCODINGS, - C <- ?CONNECTIONS, - P <- [[], [parallel]]] + ++ [{group, ?util:name([R,C,A]), P} || R <- ?ENCODINGS, + C <- ?CONTAINERS, + A <- ?ENCODINGS, + P <- [[], [parallel]]] ++ [remove_transports, stop_services, stop]. groups() -> Ts = tc(), - [{?util:name([E,C]), [], Ts} || E <- ?ENCODINGS, C <- ?CONNECTIONS]. + [{?util:name([R,C,A]), [], Ts} || R <- ?ENCODINGS, + C <- ?CONTAINERS, + A <- ?ENCODINGS]. init_per_group(Name, Config) -> [{group, Name} | Config]. @@ -209,7 +227,9 @@ end_per_testcase(_, _) -> tc() -> [send_ok, send_nok, + send_eval, send_bad_answer, + send_protocol_error, send_arbitrary, send_unknown, send_unknown_mandatory, @@ -218,6 +238,9 @@ tc() -> send_unsupported_app, send_error_bit, send_unsupported_version, + send_invalid_avp_bits, + send_invalid_avp_length, + send_invalid_reject, send_long, send_nopeer, send_noapp, @@ -260,7 +283,9 @@ start_services(_Config) -> add_transports(Config) -> LRef = ?util:listen(?SERVER, tcp, [{capabilities_cb, fun capx/2}]), - Cs = [?util:connect(?CLIENT, tcp, LRef, [{id, C}]) || C <- ?CONNECTIONS], + Cs = [?util:connect(?CLIENT, tcp, LRef, [{id, C}, + {capabilities, [osi(C)]}]) + || C <- ?CONNECTIONS], ?util:write_priv(Config, "transport", [LRef | Cs]). remove_transports(Config) -> @@ -278,11 +303,15 @@ capx(_, #diameter_caps{origin_host = {OH,DH}}) -> io:format("connection: ~p -> ~p~n", [DH,OH]), ok. +osi(Id) -> + [$c,N] = atom_to_list(Id), + {'Origin-State-Id', N - $0}. + %% =========================================================================== %% Ensure that result codes have the expected values. result_codes(_Config) -> - {2001, 3001, 3002, 3003, 3004, 3007, 3008, 3009, 5001, 5011} + {2001, 3001, 3002, 3003, 3004, 3007, 3008, 3009, 5001, 5011, 5014} = {?SUCCESS, ?COMMAND_UNSUPPORTED, ?UNABLE_TO_DELIVER, @@ -292,13 +321,14 @@ result_codes(_Config) -> ?INVALID_HDR_BITS, ?INVALID_AVP_BITS, ?AVP_UNSUPPORTED, - ?UNSUPPORTED_VERSION}. + ?UNSUPPORTED_VERSION, + ?INVALID_AVP_LENGTH}. %% Send an ACR and expect success. send_ok(Config) -> Req = ['ACR', {'Accounting-Record-Type', ?EVENT_RECORD}, {'Accounting-Record-Number', 1}], - + #diameter_base_accounting_ACA{'Result-Code' = ?SUCCESS} = call(Config, Req). @@ -306,10 +336,18 @@ send_ok(Config) -> send_nok(Config) -> Req = ['ACR', {'Accounting-Record-Type', ?EVENT_RECORD}, {'Accounting-Record-Number', 0}], - + #'diameter_base_answer-message'{'Result-Code' = ?INVALID_AVP_BITS} = call(Config, Req). +%% Send an ACR and expect success. +send_eval(Config) -> + Req = ['ACR', {'Accounting-Record-Type', ?EVENT_RECORD}, + {'Accounting-Record-Number', 3}], + + #diameter_base_accounting_ACA{'Result-Code' = ?SUCCESS} + = call(Config, Req). + %% Send an accounting ACR that the server tries to answer with an %% inappropriate header, resulting in no answer being sent and the %% request timing out. @@ -318,6 +356,15 @@ send_bad_answer(Config) -> {'Accounting-Record-Number', 2}], {error, timeout} = call(Config, Req). +%% Send an ACR that the server callback answers explicitly with a +%% protocol error. +send_protocol_error(Config) -> + Req = ['ACR', {'Accounting-Record-Type', ?EVENT_RECORD}, + {'Accounting-Record-Number', 4}], + + #'diameter_base_answer-message'{'Result-Code' = ?TOO_BUSY} + = call(Config, Req). + %% Send an ASR with an arbitrary AVP and expect success and the same %% AVP in the reply. send_arbitrary(Config) -> @@ -385,6 +432,29 @@ send_unsupported_version(Config) -> #diameter_base_STA{'Result-Code' = ?UNSUPPORTED_VERSION} = call(Config, Req). +%% Send a request containing an incorrect AVP length. +send_invalid_avp_bits(Config) -> + Req = ['STR', {'Termination-Cause', ?LOGOUT}], + + #'diameter_base_answer-message'{'Result-Code' = ?INVALID_AVP_BITS} + = call(Config, Req). + +%% Send a request containing an AVP length that doesn't match the +%% AVP's type. +send_invalid_avp_length(Config) -> + Req = ['STR', {'Termination-Cause', ?LOGOUT}], + + #'diameter_base_STA'{'Result-Code' = ?INVALID_AVP_LENGTH} + = call(Config, Req). + +%% Send a request containing 5xxx errors that the server rejects with +%% 3xxx. +send_invalid_reject(Config) -> + Req = ['STR', {'Termination-Cause', ?USER_MOVED}], + + #'diameter_base_answer-message'{'Result-Code' = ?TOO_BUSY} + = call(Config, Req). + %% Send something long that will be fragmented by TCP. send_long(Config) -> Req = ['STR', {'Termination-Cause', ?LOGOUT}, @@ -559,21 +629,44 @@ call(Config, Req) -> call(Config, Req, Opts) -> Name = proplists:get_value(testcase, Config), - [Encoding, Client] = ?util:name(proplists:get_value(group, Config)), + [Encoding, C, E] = ?util:name(proplists:get_value(group, Config)), diameter:call(?CLIENT, dict(Req), - req(Req, Encoding), - [{extra, [Name, Client]} | Opts]). + msg(Req, Encoding), + [{extra, [Name, client(E,C)]} | Opts]). + +client(E, C) -> + list_to_atom([$c, $0 + 2*codec(E) + container(C)]). + +client(N) -> + {codec(N bsr 1), container(N rem 2)}. -req(['ACR' = H | T], record) -> +codec(record) -> 0; +codec(list) -> 1; +codec(0) -> record; +codec(1) -> list. + +%% Here we're just mapping booleans but the readable atoms are part of +%% (constructed) group names, so it's good that they're readable. + +container(pkt) -> 0; +container(msg) -> 1; +container(0) -> pkt; +container(1) -> msg. + +msg([H|T], record) + when H == 'ACR'; + H == 'ACA' -> ?ACCT:'#new-'(?ACCT:msg2rec(H), T); -req([H|T], record) -> +msg([H|T], record) -> ?BASE:'#new-'(?BASE:msg2rec(H), T); -req(T, _) -> +msg(T, _) -> T. dict(['ACR' | _]) -> ?ACCT; +dict(#diameter_base_accounting_ACR{}) -> + ?ACCT; dict(_) -> ?BASE. @@ -647,6 +740,40 @@ prepare_request(Pkt, ?CLIENT, {_Ref, Caps}, send_detach, _, _) -> log(#diameter_packet{} = P, T) -> io:format("~p: ~p~n", [T,P]). +%% prepare/3 + +prepare(Pkt, Caps, send_invalid_avp_bits) -> + Req = prepare(Pkt, Caps), + %% Last AVP in our STR is Termination-Cause of type Unsigned32: + %% set its length improperly. + #diameter_packet{header = #diameter_header{length = L}, + bin = B} + = E + = diameter_codec:encode(?BASE, Pkt#diameter_packet{msg = Req}), + Offset = L - 7, %% to AVP Length + <<H:Offset/binary, 12:24/integer, T:4/binary>> = B, + E#diameter_packet{bin = <<H/binary, 13:24/integer, T/binary>>}; + +prepare(Pkt, Caps, N) + when N == send_invalid_avp_length; + N == send_invalid_reject -> + Req = prepare(Pkt, Caps), + %% Second last AVP in our STR is Auth-Application-Id of type + %% Unsigned32: Send a value of length 8. + #diameter_packet{header = #diameter_header{length = L}, + bin = B0} + = E + = diameter_codec:encode(?BASE, Pkt#diameter_packet{msg = Req}), + Offset = L - 7 - 12, %% to AVP Length + <<H0:Offset/binary, 12:24/integer, T:16/binary>> = B0, + <<V, L:24/integer, H/binary>> = H0, %% assert + E#diameter_packet{bin = <<V, + (L+4):24/integer, + H/binary, + 16:24/integer, + 0:32/integer, + T/binary>>}; + prepare(Pkt, Caps, send_unsupported) -> Req = prepare(Pkt, Caps), #diameter_packet{bin = <<H:5/binary, _CmdCode:3/binary, T/binary>>} @@ -659,7 +786,7 @@ prepare(Pkt, Caps, send_unsupported_app) -> #diameter_packet{bin = <<H:8/binary, _ApplId:4/binary, T/binary>>} = E = diameter_codec:encode(?BASE, Pkt#diameter_packet{msg = Req}), - E#diameter_packet{bin = <<H/binary, 42:32/integer, T/binary>>}; + E#diameter_packet{bin = <<H/binary, ?BAD_APP:32/integer, T/binary>>}; prepare(Pkt, Caps, send_error_bit) -> #diameter_packet{header = Hdr} = Pkt, @@ -678,6 +805,8 @@ prepare(Pkt, Caps, send_anything) -> prepare(Pkt, Caps, _Name) -> prepare(Pkt, Caps). +%% prepare/2 + prepare(#diameter_packet{msg = Req}, Caps) when is_record(Req, diameter_base_accounting_ACR); 'ACR' == hd(Req) -> @@ -741,9 +870,26 @@ handle_answer(Pkt, Req, ?CLIENT, Peer, Name, _Id) -> handle_answer(Pkt, _Req, ?CLIENT, _Peer, send_detach, _Id, {Pid, Ref}) -> Pid ! {Ref, Pkt}. -answer(#diameter_packet{msg = Rec, errors = []}, _Req, _Peer, _) -> +answer(Pkt, Req, _Peer, Name) -> + #diameter_packet{header = H, msg = Rec, errors = Es} = Pkt, + ApplId = app(Req, Name), + #diameter_header{application_id = ApplId} = H, %% assert + answer(Rec, Es, Name). + +answer(Rec, [_|_], N) + when N == send_invalid_avp_bits; + N == send_invalid_avp_length; + N == send_invalid_reject -> + Rec; +answer(Rec, [], _) -> Rec. +app(_, send_unsupported_app) -> + ?BAD_APP; +app(Req, _) -> + Dict = dict(Req), + Dict:id(). + %% handle_error/6 handle_error(Reason, _Req, ?CLIENT, _Peer, _Name, _Id) -> @@ -761,12 +907,24 @@ handle_request(#diameter_packet{header = H, msg = M}, ?SERVER, {_Ref, Caps}) -> {V,B} = ?CLIENT_MASK, V = EI bsr B, %% assert V = HI bsr B, %% - request(M, Caps). + #diameter_caps{origin_state_id = {_,[N]}} = Caps, + answer(client(N), request(M, Caps)). + +answer(T, {Tag, Action, Post}) -> + {Tag, answer(T, Action), Post}; +answer({E,C}, {reply, Ans}) -> + answer(C, {reply, msg(Ans, E)}); +answer(pkt, {reply, Ans}) -> + {reply, #diameter_packet{msg = Ans}}; +answer(_, T) -> + T. +%% send_nok request(#diameter_base_accounting_ACR{'Accounting-Record-Number' = 0}, _) -> {eval_packet, {protocol_error, ?INVALID_AVP_BITS}, [fun log/2, invalid]}; +%% send_bad_answer request(#diameter_base_accounting_ACR{'Session-Id' = SId, 'Accounting-Record-Type' = RT, 'Accounting-Record-Number' = 2 = RN}, @@ -779,12 +937,27 @@ request(#diameter_base_accounting_ACR{'Session-Id' = SId, {'Accounting-Record-Type', RT}, {'Accounting-Record-Number', RN}], - {reply, #diameter_packet{header = #diameter_header{is_error = true},%% not + {reply, #diameter_packet{header = #diameter_header{is_error = true},%% NOT msg = Ans}}; +%% send_eval +request(#diameter_base_accounting_ACR{'Session-Id' = SId, + 'Accounting-Record-Type' = RT, + 'Accounting-Record-Number' = 3 = RN}, + #diameter_caps{origin_host = {OH, _}, + origin_realm = {OR, _}}) -> + Ans = ['ACA', {'Result-Code', ?SUCCESS}, + {'Session-Id', SId}, + {'Origin-Host', OH}, + {'Origin-Realm', OR}, + {'Accounting-Record-Type', RT}, + {'Accounting-Record-Number', RN}], + {eval, {reply, Ans}, {erlang, now, []}}; + +%% send_ok request(#diameter_base_accounting_ACR{'Session-Id' = SId, 'Accounting-Record-Type' = RT, - 'Accounting-Record-Number' = RN}, + 'Accounting-Record-Number' = 1 = RN}, #diameter_caps{origin_host = {OH, _}, origin_realm = {OR, _}}) -> {reply, ['ACA', {'Result-Code', ?SUCCESS}, @@ -794,26 +967,42 @@ request(#diameter_base_accounting_ACR{'Session-Id' = SId, {'Accounting-Record-Type', RT}, {'Accounting-Record-Number', RN}]}; +%% send_protocol_error +request(#diameter_base_accounting_ACR{'Accounting-Record-Number' = 4}, + #diameter_caps{origin_host = {OH, _}, + origin_realm = {OR, _}}) -> + Ans = ['answer-message', {'Result-Code', ?TOO_BUSY}, + {'Origin-Host', OH}, + {'Origin-Realm', OR}], + {reply, Ans}; + request(#diameter_base_ASR{'Session-Id' = SId, 'AVP' = Avps}, #diameter_caps{origin_host = {OH, _}, origin_realm = {OR, _}}) -> - {reply, #diameter_base_ASA{'Result-Code' = ?SUCCESS, - 'Session-Id' = SId, - 'Origin-Host' = OH, - 'Origin-Realm' = OR, - 'AVP' = Avps}}; + {reply, ['ASA', {'Result-Code', ?SUCCESS}, + {'Session-Id', SId}, + {'Origin-Host', OH}, + {'Origin-Realm', OR}, + {'AVP', Avps}]}; + +%% send_invalid_reject +request(#diameter_base_STR{'Termination-Cause' = ?USER_MOVED}, _Caps) -> + {protocol_error, ?TOO_BUSY}; +%% send_noreply request(#diameter_base_STR{'Termination-Cause' = T}, _Caps) when T /= ?LOGOUT -> discard; +%% send_destination_5 request(#diameter_base_STR{'Destination-Realm'= R}, #diameter_caps{origin_realm = {OR, _}}) when R /= undefined, R /= OR -> {protocol_error, ?REALM_NOT_SERVED}; +%% send_destination_6 request(#diameter_base_STR{'Destination-Host'= [H]}, #diameter_caps{origin_host = {OH, _}}) when H /= OH -> @@ -822,11 +1011,12 @@ request(#diameter_base_STR{'Destination-Host'= [H]}, request(#diameter_base_STR{'Session-Id' = SId}, #diameter_caps{origin_host = {OH, _}, origin_realm = {OR, _}}) -> - {reply, #diameter_base_STA{'Result-Code' = ?SUCCESS, - 'Session-Id' = SId, - 'Origin-Host' = OH, - 'Origin-Realm' = OR}}; + {reply, ['STA', {'Result-Code', ?SUCCESS}, + {'Session-Id', SId}, + {'Origin-Host', OH}, + {'Origin-Realm', OR}]}; +%% send_error request(#diameter_base_RAR{}, _Caps) -> receive after 2000 -> ok end, {protocol_error, ?TOO_BUSY}. diff --git a/lib/diameter/test/modules.mk b/lib/diameter/test/modules.mk index 5898e125ae..80b1769d04 100644 --- a/lib/diameter/test/modules.mk +++ b/lib/diameter/test/modules.mk @@ -40,7 +40,8 @@ MODULES = \ diameter_relay_SUITE \ diameter_tls_SUITE \ diameter_failover_SUITE \ - diameter_dpr_SUITE + diameter_dpr_SUITE \ + diameter_event_SUITE HRL_FILES = \ diameter_ct.hrl diff --git a/lib/diameter/vsn.mk b/lib/diameter/vsn.mk index c9f74ffcec..7b2208137b 100644 --- a/lib/diameter/vsn.mk +++ b/lib/diameter/vsn.mk @@ -2,7 +2,7 @@ # %CopyrightBegin% # -# Copyright Ericsson AB 2010-2012. All Rights Reserved. +# Copyright Ericsson AB 2010-2013. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -18,7 +18,7 @@ # %CopyrightEnd% APPLICATION = diameter -DIAMETER_VSN = 1.3 +DIAMETER_VSN = 1.3.1 PRE_VSN = APP_VSN = "$(APPLICATION)-$(DIAMETER_VSN)$(PRE_VSN)" diff --git a/lib/edoc/priv/Makefile b/lib/edoc/priv/Makefile index 73c42c05eb..9873136201 100644 --- a/lib/edoc/priv/Makefile +++ b/lib/edoc/priv/Makefile @@ -27,8 +27,11 @@ GEN_SCRIPT_SRC = edoc_generate.src GEN_SCRIPT = edoc_generate PRIV_FILES = stylesheet.css erlang.png edoc.dtd -debug opt: - sed -e "s/%EDOC_VSN%/$(EDOC_VSN)/g" \ +debug opt: $(GEN_SCRIPT) + +$(GEN_SCRIPT): ../vsn.mk ../../xmerl/vsn.mk ../../syntax_tools/vsn.mk \ + $(GEN_SCRIPT_SRC) + $(vsn_verbose)sed -e "s/%EDOC_VSN%/$(EDOC_VSN)/g" \ -e "s/%XMERL_VSN%/$(XMERL_VSN)/g" \ -e "s/%SYNTAX_TOOLS_VSN%/$(SYNTAX_TOOLS_VSN)/g" \ $(GEN_SCRIPT_SRC) > $(GEN_SCRIPT) diff --git a/lib/edoc/src/Makefile b/lib/edoc/src/Makefile index 72354ac711..4e5a4182da 100644 --- a/lib/edoc/src/Makefile +++ b/lib/edoc/src/Makefile @@ -67,17 +67,17 @@ distclean: clean realclean: clean $(EBIN)/%.$(EMULATOR):%.erl - erlc -W $(ERL_COMPILE_FLAGS) -o$(EBIN) $< + $(erlc_verbose)erlc -W $(ERL_COMPILE_FLAGS) -o$(EBIN) $< # ---------------------------------------------------- # Special Build Targets # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/eldap/src/Makefile b/lib/eldap/src/Makefile index 46fb805bcc..ad93e1087a 100644 --- a/lib/eldap/src/Makefile +++ b/lib/eldap/src/Makefile @@ -75,10 +75,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(ELDAP_VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(ELDAP_VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(ELDAP_VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(ELDAP_VSN);' $< > $@ docs: @@ -88,7 +88,7 @@ $(TARGET_FILES): $(HRL_FILES) # Special Build Targets # ---------------------------------------------------- $(ASN1_HRL): ../asn1/$(ASN1_FILES) - $(ERLC) -o $(EBIN) -bber $(ERL_COMPILE_FLAGS) ../asn1/ELDAPv3.asn1 + $(asn_verbose)$(ERLC) -o $(EBIN) -bber $(ERL_COMPILE_FLAGS) ../asn1/ELDAPv3.asn1 # ---------------------------------------------------- # Release Target diff --git a/lib/erl_docgen/src/Makefile b/lib/erl_docgen/src/Makefile index 6c8b438b25..ef96f5dbf2 100644 --- a/lib/erl_docgen/src/Makefile +++ b/lib/erl_docgen/src/Makefile @@ -78,10 +78,10 @@ docs: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/erl_interface/aclocal.m4 b/lib/erl_interface/aclocal.m4 index 5d555a5123..918e30a886 100644 --- a/lib/erl_interface/aclocal.m4 +++ b/lib/erl_interface/aclocal.m4 @@ -1861,17 +1861,16 @@ dnl Usage example LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) dnl dnl AC_DEFUN([LM_TRY_ENABLE_CFLAG], [ - AC_MSG_CHECKING([if we can add $1 to CFLAGS]) + AC_MSG_CHECKING([if we can add $1 to $2 (via CFLAGS)]) saved_CFLAGS=$CFLAGS; - CFLAGS="$1 $CFLAGS"; + CFLAGS="$1 $$2"; AC_TRY_COMPILE([],[return 0;],can_enable_flag=true,can_enable_flag=false) CFLAGS=$saved_CFLAGS; if test "X$can_enable_flag" = "Xtrue"; then AC_MSG_RESULT([yes]) - AS_VAR_SET($2, "$1 $CFLAGS") + AS_VAR_SET($2, "$1 $$2") else AC_MSG_RESULT([no]) - AS_VAR_SET($2, "$CFLAGS") fi ]) diff --git a/lib/erl_interface/src/Makefile b/lib/erl_interface/src/Makefile index 5f0367bec1..03e2ce14f0 100644 --- a/lib/erl_interface/src/Makefile +++ b/lib/erl_interface/src/Makefile @@ -22,10 +22,11 @@ # FIXME let configure put in this last part TARGET +include $(ERL_TOP)/make/output.mk include $(ERL_TOP)/make/target.mk debug opt shared purify quantify purecov gcov: - $(MAKE) -f $(TARGET)/Makefile TYPE=$@ + $(make_verbose)$(MAKE) -f $(TARGET)/Makefile TYPE=$@ clean depend docs release release_docs tests release_tests check: - $(MAKE) -f $(TARGET)/Makefile $@ + $(make_verbose)$(MAKE) -f $(TARGET)/Makefile $@ diff --git a/lib/erl_interface/src/Makefile.in b/lib/erl_interface/src/Makefile.in index cb41391fe9..ebacc1cee0 100644 --- a/lib/erl_interface/src/Makefile.in +++ b/lib/erl_interface/src/Makefile.in @@ -38,6 +38,8 @@ TARGET = @TARGET@ include ../vsn.mk include $(TARGET)/eidefs.mk +include $(ERL_TOP)/make/output.mk + USING_MINGW=@MIXED_CYGWIN_MINGW@ USING_MSYS_VC==@MIXED_MSYS_VC@ USING_CYGWIN_VC==@MIXED_MSYS_VC@ @@ -98,6 +100,12 @@ LD = @LD@ AR = @AR@ RANLIB = @RANLIB@ +ifeq ($(V),0) +AR_FLAGS=rc +else +AR_FLAGS=rcv +endif + INCFLAGS = -I. -I../include -Iconnect -Iencode -Idecode -Imisc -Iepmd \ -Iregistry -I$(TARGET) @@ -552,16 +560,18 @@ distclean: clean ifeq ($(findstring vxworks,$(TARGET)),vxworks) $(TARGET)/config.h: - echo "/* Generated by Makefile */" > $@ - echo "#define HAVE_STRERROR 1" >> $@ - echo "#define HAVE_SOCKLEN_T 1" >> $@ + $(gen_verbose) + $(V_at)echo "/* Generated by Makefile */" > $@ + $(V_at)echo "#define HAVE_STRERROR 1" >> $@ + $(V_at)echo "#define HAVE_SOCKLEN_T 1" >> $@ endif ifeq ($(findstring ose,$(TARGET)),ose) $(TARGET)/config.h: - echo "/* Generated by Makefile */" > $@ - echo "#define HAVE_STRERROR 1" >> $@ - echo "#define HAVE_SOCKLEN_T 1" >> $@ + $(gen_verbose) + $(V_at)echo "/* Generated by Makefile */" > $@ + $(V_at)echo "#define HAVE_STRERROR 1" >> $@ + $(V_at)echo "#define HAVE_SOCKLEN_T 1" >> $@ endif ########################################################################### @@ -569,19 +579,19 @@ endif ########################################################################### $(ST_OBJDIR)/%.o: %.c - $(CC) $(CFLAGS) -c $< -o $@ + $(V_CC) $(CFLAGS) -c $< -o $@ $(MT_OBJDIR)/%.o: %.c - $(CC) $(MTFLAG) $(CFLAGS) $(THR_DEFS) -c $< -o $@ + $(V_CC) $(MTFLAG) $(CFLAGS) $(THR_DEFS) -c $< -o $@ $(MD_OBJDIR)/%.o: %.c - $(CC) -MD $(CFLAGS) $(THR_DEFS) -c $< -o $@ + $(V_CC) -MD $(CFLAGS) $(THR_DEFS) -c $< -o $@ $(MD_OBJDIR)/%.o: %.c - $(CC) -MD $(CFLAGS) $(THR_DEFS) -c $< -o $@ + $(V_CC) -MD $(CFLAGS) $(THR_DEFS) -c $< -o $@ $(MDD_OBJDIR)/%.o: %.c - $(CC) -MDd $(CFLAGS) $(THR_DEFS) -c $< -o $@ + $(V_CC) -MDd $(CFLAGS) $(THR_DEFS) -c $< -o $@ ########################################################################### # Create directories @@ -598,67 +608,67 @@ ifeq ($(TARGET),win32) # Windows archive creation $(ST_EILIB) : $(ST_EIOBJECTS) - $(AR) -out:$@ $(ST_EIOBJECTS) - $(RANLIB) $@ + $(V_AR) -out:$@ $(ST_EIOBJECTS) + $(V_RANLIB) $@ $(ST_ERLLIB) : $(ST_ERLOBJECTS) - $(AR) -out:$@ $(ST_ERLOBJECTS) - $(RANLIB) $@ + $(V_AR) -out:$@ $(ST_ERLOBJECTS) + $(V_RANLIB) $@ $(MT_EILIB) : $(MT_EIOBJECTS) - $(AR) -out:$@ $(MT_EIOBJECTS) - $(RANLIB) $@ + $(V_AR) -out:$@ $(MT_EIOBJECTS) + $(V_RANLIB) $@ $(MT_ERLLIB) : $(MT_ERLOBJECTS) - $(AR) -out:$@ $(MT_ERLOBJECTS) - $(RANLIB) $@ + $(V_AR) -out:$@ $(MT_ERLOBJECTS) + $(V_RANLIB) $@ $(MD_EILIB) : $(MD_EIOBJECTS) - $(AR) -out:$@ $(MD_EIOBJECTS) - $(RANLIB) $@ + $(V_AR) -out:$@ $(MD_EIOBJECTS) + $(V_RANLIB) $@ $(MD_ERLLIB) : $(MD_ERLOBJECTS) - $(AR) -out:$@ $(MD_ERLOBJECTS) - $(RANLIB) $@ + $(V_AR) -out:$@ $(MD_ERLOBJECTS) + $(V_RANLIB) $@ $(MDD_EILIB) : $(MDD_EIOBJECTS) - $(AR) -out:$@ $(MDD_EIOBJECTS) - $(RANLIB) $@ + $(V_AR) -out:$@ $(MDD_EIOBJECTS) + $(V_RANLIB) $@ $(MDD_ERLLIB) : $(MDD_ERLOBJECTS) - $(AR) -out:$@ $(MDD_ERLOBJECTS) - $(RANLIB) $@ + $(V_AR) -out:$@ $(MDD_ERLOBJECTS) + $(V_RANLIB) $@ else # Unix archive creation $(ST_EILIB) : $(ST_EIOBJECTS) - rm -f $@ - $(AR) rcv $@ $(ST_EIOBJECTS) + $(V_at)rm -f $@ + $(V_AR) $(AR_FLAGS) $@ $(ST_EIOBJECTS) ifdef RANLIB - $(RANLIB) $@ + $(V_RANLIB) $@ endif $(ST_ERLLIB) : $(ST_ERLOBJECTS) - rm -f $@ - $(AR) rcv $@ $(ST_ERLOBJECTS) + $(V_at)rm -f $@ + $(V_AR) $(AR_FLAGS) $@ $(ST_ERLOBJECTS) ifdef RANLIB - $(RANLIB) $@ + $(V_RANLIB) $@ endif $(MT_EILIB) : $(MT_EIOBJECTS) - rm -f $@ - $(AR) rcv $@ $(MT_EIOBJECTS) + $(V_at)rm -f $@ + $(V_AR) $(AR_FLAGS) $@ $(MT_EIOBJECTS) ifdef RANLIB - $(RANLIB) $@ + $(V_RANLIB) $@ endif $(MT_ERLLIB) : $(MT_ERLOBJECTS) - rm -f $@ - $(AR) rcv $@ $(MT_ERLOBJECTS) + $(V_at)rm -f $@ + $(V_AR) $(AR_FLAGS) $@ $(MT_ERLOBJECTS) ifdef RANLIB - $(RANLIB) $@ + $(V_RANLIB) $@ endif endif @@ -669,18 +679,18 @@ endif ifeq ($(TARGET),win32) $(ERL_CALL): $(ERLCALL) ../include/ei.h $(MD_EILIB) - $(PURIFY) $(CC) -MD $(PROG_CFLAGS) $(THR_DEFS) -o $@ $(ERLCALL) \ + $(ld_verbose)$(PURIFY) $(CC) -MD $(PROG_CFLAGS) $(THR_DEFS) -o $@ $(ERLCALL) \ -L$(OBJDIR) -lei_md $(THR_LIBS) $(LIBS) -lsocket else ifeq ($(findstring vxworks,$(TARGET)),vxworks) $(ERL_CALL): $(ST_OBJDIR)/erl_call.o $(ST_OBJDIR)/erl_start.o ../include/ei.h $(ST_EILIB) - $(LD) -r -d -o $@ $(ST_OBJDIR)/erl_call.o $(ST_OBJDIR)/erl_start.o -L$(OBJDIR) -lei $(LIBS) + $(V_LD) -r -d -o $@ $(ST_OBJDIR)/erl_call.o $(ST_OBJDIR)/erl_start.o -L$(OBJDIR) -lei $(LIBS) $(ST_OBJDIR)/erl_call.o: prog/erl_call.c - $(CC) $(CFLAGS) -c $< -o $@ + $(V_CC) $(CFLAGS) -c $< -o $@ $(ST_OBJDIR)/erl_start.o: prog/erl_start.c - $(CC) $(CFLAGS) -c $< -o $@ + $(V_CC) $(CFLAGS) -c $< -o $@ else ifeq ($(findstring ose,$(TARGET)),ose) @@ -688,11 +698,11 @@ $(ERL_CALL): else ifdef THR_DEFS $(ERL_CALL): $(ERLCALL) ../include/ei.h $(MT_EILIB) - $(PURIFY) $(CC) $(PROG_CFLAGS) $(THR_DEFS) $(LDFLAGS) -o $@ $(ERLCALL) \ + $(ld_verbose)$(PURIFY) $(CC) $(PROG_CFLAGS) $(THR_DEFS) $(LDFLAGS) -o $@ $(ERLCALL) \ -L$(OBJDIR) -lei $(THR_LIBS) $(LIBS) else $(ERL_CALL): $(ERLCALL) ../include/ei.h $(ST_EILIB) - $(PURIFY) $(CC) $(PROG_CFLAGS) $(LDFLAGS) -o $@ $(ERLCALL) \ + $(ld_verbose)$(PURIFY) $(CC) $(PROG_CFLAGS) $(LDFLAGS) -o $@ $(ERLCALL) \ -L$(OBJDIR) -lei $(LIBS) endif endif @@ -707,36 +717,36 @@ check: $(FAKE_TARGETS) ifndef THR_DEFS $(ST_OBJDIR)/erl_fake_prog_st$(EXE): prog/erl_fake_prog.c $(ST_ERLLIB) $(ST_EILIB) - $(CC) $(PROG_CFLAGS) -o $@ $< -L$(OBJDIR) -lerl_interface -lei \ + $(V_CC) $(PROG_CFLAGS) -o $@ $< -L$(OBJDIR) -lerl_interface -lei \ $(LIBS) $(ST_OBJDIR)/ei_fake_prog_st$(EXE): prog/ei_fake_prog.c $(ST_EILIB) - $(CC) $(PROG_CFLAGS) -o $@ $< -L$(OBJDIR) -lei $(LIBS) + $(V_CC) $(PROG_CFLAGS) -o $@ $< -L$(OBJDIR) -lei $(LIBS) $(ST_OBJDIR)/erl_fake_prog_cxx_st$(EXE): prog/erl_fake_prog.c \ $(ST_ERLLIB) $(ST_EILIB) - $(CC) $(PROG_CFLAGS) -o $@ -xc++ $< -L$(OBJDIR) \ + $(V_CC) $(PROG_CFLAGS) -o $@ -xc++ $< -L$(OBJDIR) \ -lerl_interface -lei $(LIBS) $(ST_OBJDIR)/ei_fake_prog_cxx_st$(EXE): prog/ei_fake_prog.c $(ST_EILIB) - $(CC) $(PROG_CFLAGS) -o $@ -xc++ $< -L$(OBJDIR) -lei $(LIBS) + $(V_CC) $(PROG_CFLAGS) -o $@ -xc++ $< -L$(OBJDIR) -lei $(LIBS) else $(ST_OBJDIR)/erl_fake_prog_st$(EXE): prog/erl_fake_prog.c $(ST_ERLLIB) $(ST_EILIB) - $(CC) $(PROG_CFLAGS) -o $@ $< -L$(OBJDIR) -lerl_interface_st -lei_st \ + $(V_CC) $(PROG_CFLAGS) -o $@ $< -L$(OBJDIR) -lerl_interface_st -lei_st \ $(LIBS) $(ST_OBJDIR)/ei_fake_prog_st$(EXE): prog/ei_fake_prog.c $(ST_EILIB) - $(CC) $(PROG_CFLAGS) -o $@ $< -L$(OBJDIR) -lei_st $(LIBS) + $(V_CC) $(PROG_CFLAGS) -o $@ $< -L$(OBJDIR) -lei_st $(LIBS) $(ST_OBJDIR)/erl_fake_prog_cxx_st$(EXE): prog/erl_fake_prog.c \ $(ST_ERLLIB) $(ST_EILIB) - $(CC) $(PROG_CFLAGS) -o $@ -xc++ $< -L$(OBJDIR) \ + $(V_CC) $(PROG_CFLAGS) -o $@ -xc++ $< -L$(OBJDIR) \ -lerl_interface_st -lei_st $(LIBS) $(ST_OBJDIR)/ei_fake_prog_cxx_st$(EXE): prog/ei_fake_prog.c $(ST_EILIB) - $(CC) $(PROG_CFLAGS) -o $@ -xc++ $< -L$(OBJDIR) -lei_st $(LIBS) + $(V_CC) $(PROG_CFLAGS) -o $@ -xc++ $< -L$(OBJDIR) -lei_st $(LIBS) endif @@ -744,63 +754,63 @@ endif $(MT_OBJDIR)/erl_fake_prog_mt$(EXE): prog/erl_fake_prog.c \ $(MT_ERLLIB) $(MT_EILIB) - $(CC) $(MTFLAG) $(PROG_CFLAGS) $(THR_DEFS) -o $@ $< -L$(OBJDIR) \ + $(V_CC) $(MTFLAG) $(PROG_CFLAGS) $(THR_DEFS) -o $@ $< -L$(OBJDIR) \ -lerl_interface -lei $(THR_LIBS) $(LIBS) $(MT_OBJDIR)/ei_fake_prog_mt$(EXE): prog/ei_fake_prog.c $(MT_EILIB) - $(CC) $(MTFLAG) $(PROG_CFLAGS) $(THR_DEFS) -o $@ $< \ + $(V_CC) $(MTFLAG) $(PROG_CFLAGS) $(THR_DEFS) -o $@ $< \ -L$(OBJDIR) -lei $(THR_LIBS) $(LIBS) $(MT_OBJDIR)/erl_fake_prog_mt_cxx$(EXE): prog/erl_fake_prog.c \ $(MT_ERLLIB) $(MT_EILIB) - $(CC) $(MTFLAG) $(PROG_CFLAGS) $(THR_DEFS) -o $@ -xc++ $< \ + $(V_CC) $(MTFLAG) $(PROG_CFLAGS) $(THR_DEFS) -o $@ -xc++ $< \ -L$(OBJDIR) -lerl_interface -lei \ $(THR_LIBS) $(LIBS) $(MT_OBJDIR)/ei_fake_prog_mt_cxx$(EXE): prog/ei_fake_prog.c $(MT_EILIB) - $(CC) $(MTFLAG) $(PROG_CFLAGS) $(THR_DEFS) -o $@ -xc++ $< \ + $(V_CC) $(MTFLAG) $(PROG_CFLAGS) $(THR_DEFS) -o $@ -xc++ $< \ -L$(OBJDIR) -lei $(THR_LIBS) $(LIBS) #### $(MD_OBJDIR)/erl_fake_prog_md$(EXE): prog/erl_fake_prog.c \ $(MD_ERLLIB) $(MD_EILIB) - $(CC) -MD $(PROG_CFLAGS) $(THR_DEFS) -o $@ $< -L$(OBJDIR) \ + $(V_CC) -MD $(PROG_CFLAGS) $(THR_DEFS) -o $@ $< -L$(OBJDIR) \ -lerl_interface_r -lei_r $(THR_LIBS) $(LIBS) $(MD_OBJDIR)/ei_fake_prog_md$(EXE): prog/ei_fake_prog.c $(MD_EILIB) - $(CC) -MD $(PROG_CFLAGS) $(THR_DEFS) -o $@ $< \ + $(V_CC) -MD $(PROG_CFLAGS) $(THR_DEFS) -o $@ $< \ -L$(OBJDIR) -lei_r $(THR_LIBS) $(LIBS) $(MD_OBJDIR)/erl_fake_prog_md_cxx$(EXE): prog/erl_fake_prog.c \ $(MD_ERLLIB) $(MD_EILIB) - $(CC) -MD $(PROG_CFLAGS) $(THR_DEFS) -o $@ -xc++ $< \ + $(V_CC) -MD $(PROG_CFLAGS) $(THR_DEFS) -o $@ -xc++ $< \ -L$(OBJDIR) -lerl_interface_r -lei_r \ $(THR_LIBS) $(LIBS) $(MD_OBJDIR)/ei_fake_prog_md_cxx$(EXE): prog/ei_fake_prog.c $(MD_EILIB) - $(CC) -MD $(PROG_CFLAGS) $(THR_DEFS) -o $@ -xc++ $< \ + $(V_CC) -MD $(PROG_CFLAGS) $(THR_DEFS) -o $@ -xc++ $< \ -L$(OBJDIR) -lei_r $(THR_LIBS) $(LIBS) #### $(MDD_OBJDIR)/erl_fake_prog_mdd$(EXE): prog/erl_fake_prog.c \ $(MDD_ERLLIB) $(MDD_EILIB) - $(CC) -MDD $(PROG_CFLAGS) $(THR_DEFS) -o $@ $< -L$(OBJDIR) \ + $(V_CC) -MDD $(PROG_CFLAGS) $(THR_DEFS) -o $@ $< -L$(OBJDIR) \ -lerl_interface_r -lei_r $(THR_LIBS) $(LIBS) $(MDD_OBJDIR)/ei_fake_prog_mdd$(EXE): prog/ei_fake_prog.c $(MDD_EILIB) - $(CC) -MDD $(PROG_CFLAGS) $(THR_DEFS) -o $@ $< \ + $(V_CC) -MDD $(PROG_CFLAGS) $(THR_DEFS) -o $@ $< \ -L$(OBJDIR) -lei_r $(THR_LIBS) $(LIBS) $(MDD_OBJDIR)/erl_fake_prog_mdd_cxx$(EXE): prog/erl_fake_prog.c \ $(MDD_ERLLIB) $(MDD_EILIB) - $(CC) -MDD $(PROG_CFLAGS) $(THR_DEFS) -o $@ -xc++ $< \ + $(V_CC) -MDD $(PROG_CFLAGS) $(THR_DEFS) -o $@ -xc++ $< \ -L$(OBJDIR) -lerl_interface_r -lei_r \ $(THR_LIBS) $(LIBS) $(MDD_OBJDIR)/ei_fake_prog_mdd_cxx$(EXE): prog/ei_fake_prog.c $(MDD_EILIB) - $(CC) -MDD $(PROG_CFLAGS) $(THR_DEFS) -o $@ -xc++ $< \ + $(V_CC) -MDD $(PROG_CFLAGS) $(THR_DEFS) -o $@ -xc++ $< \ -L$(OBJDIR) -lei_r $(THR_LIBS) $(LIBS) ########################################################################### @@ -808,9 +818,10 @@ $(MDD_OBJDIR)/ei_fake_prog_mdd_cxx$(EXE): prog/ei_fake_prog.c $(MDD_EILIB) ########################################################################### depend: - @echo "Generating dependency file depend.mk..." + $(gen_verbose) + $(V_colon)@echo "Generating dependency file depend.mk..." @echo "# Generated dependency rules" > depend.mk; \ - $(CC) $(CFLAGS) -MM $(SOURCES) | \ + $(V_CC) $(CFLAGS) -MM $(SOURCES) | \ sed 's&$(TARGET)&\$$\(TARGET\)&g' | \ sed 's/^.*:/\$$\(ST_OBJDIR\)\/&/' >> depend.mk; \ echo >> depend.mk; \ diff --git a/lib/et/src/Makefile b/lib/et/src/Makefile index c68a3f4efd..386169fe95 100644 --- a/lib/et/src/Makefile +++ b/lib/et/src/Makefile @@ -92,10 +92,10 @@ docs: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/eunit/src/Makefile b/lib/eunit/src/Makefile index 0a2e71cf7b..e88e28df83 100644 --- a/lib/eunit/src/Makefile +++ b/lib/eunit/src/Makefile @@ -104,10 +104,10 @@ $(OBJECTS): $(PARSE_TRANSFORM_BIN) # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/gs/contribs/bonk/Makefile b/lib/gs/contribs/bonk/Makefile index a630deaf24..d160ca8b73 100644 --- a/lib/gs/contribs/bonk/Makefile +++ b/lib/gs/contribs/bonk/Makefile @@ -81,12 +81,12 @@ clean: # ---------------------------------------------------- $(EBIN)/$(TOOLNAME).gif: $(TOOLNAME).gif - rm -f $@ - cp $(TOOLNAME).gif $@ + $(gen_verbose)rm -f $@ + $(V_at)cp $(TOOLNAME).gif $@ $(EBIN)/$(TOOLNAME).tool: $(TOOLNAME).tool - rm -f $@ - cp $(TOOLNAME).tool $@ + $(gen_verbose)rm -f $@ + $(V_at)cp $(TOOLNAME).tool $@ # ---------------------------------------------------- # Release Target diff --git a/lib/gs/contribs/cols/Makefile b/lib/gs/contribs/cols/Makefile index 3af91e1dae..3036e9565e 100644 --- a/lib/gs/contribs/cols/Makefile +++ b/lib/gs/contribs/cols/Makefile @@ -74,16 +74,16 @@ clean: # ---------------------------------------------------- $(EBIN)/$(TOOLNAME).gif: $(TOOLNAME).gif - rm -f $@ - cp $(TOOLNAME).gif $@ + $(gen_verbose)rm -f $@ + $(V_at)cp $(TOOLNAME).gif $@ $(EBIN)/$(TOOLNAME).tool: $(TOOLNAME).tool - rm -f $@ - cp $(TOOLNAME).tool $@ + $(gen_verbose)rm -f $@ + $(V_at)cp $(TOOLNAME).tool $@ $(EBIN)/help.gif: help.gif - rm -f $@ - cp help.gif $@ + $(gen_verbose)rm -f $@ + $(V_at)cp help.gif $@ # ---------------------------------------------------- # Release Target diff --git a/lib/gs/contribs/mandel/Makefile b/lib/gs/contribs/mandel/Makefile index 5f0b047955..308ba0cbb0 100644 --- a/lib/gs/contribs/mandel/Makefile +++ b/lib/gs/contribs/mandel/Makefile @@ -73,16 +73,16 @@ clean: # ---------------------------------------------------- $(EBIN)/$(TOOLNAME).gif: $(TOOLNAME).gif - rm -f $@ - cp $(TOOLNAME).gif $@ + $(gen_verbose)rm -f $@ + $(V_at)cp $(TOOLNAME).gif $@ $(EBIN)/$(TOOLNAME).tool: $(TOOLNAME).tool - rm -f $@ - cp $(TOOLNAME).tool $@ + $(gen_verbose)rm -f $@ + $(V_at)cp $(TOOLNAME).tool $@ $(EBIN)/help.gif: help.gif - rm -f $@ - cp help.gif $@ + $(gen_verbose)rm -f $@ + $(V_at)cp help.gif $@ # ---------------------------------------------------- # Release Target diff --git a/lib/gs/contribs/othello/Makefile b/lib/gs/contribs/othello/Makefile index 5f37d164f5..f9d131c315 100644 --- a/lib/gs/contribs/othello/Makefile +++ b/lib/gs/contribs/othello/Makefile @@ -76,12 +76,12 @@ clean: # ---------------------------------------------------- $(EBIN)/$(TOOLNAME).gif: $(TOOLNAME).gif - rm -f $@ - cp $(TOOLNAME).gif $@ + $(gen_verbose)rm -f $@ + $(V_at)cp $(TOOLNAME).gif $@ $(EBIN)/$(TOOLNAME).tool: $(TOOLNAME).tool - rm -f $@ - cp $(TOOLNAME).tool $@ + $(gen_verbose)rm -f $@ + $(V_at)cp $(TOOLNAME).tool $@ # ---------------------------------------------------- # Release Target diff --git a/lib/gs/src/Makefile b/lib/gs/src/Makefile index 4b7a4523b9..0a63d5466e 100644 --- a/lib/gs/src/Makefile +++ b/lib/gs/src/Makefile @@ -91,13 +91,13 @@ clean: # ---------------------------------------------------- gstk_generic.hrl: gs_make.erl ../ebin/gs_make.$(EMULATOR) ../ebin/gs.$(EMULATOR) - $(ERL) -pa $(EBIN) -s gs_make -s erlang halt -noshell + $(gen_verbose)$(ERL) -pa $(EBIN) -s gs_make -s erlang halt -noshell $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(GSTK_GENERIC_TARGET): gstk_generic.hrl diff --git a/lib/hipe/Makefile b/lib/hipe/Makefile index 2294f98158..a9e24f4d17 100644 --- a/lib/hipe/Makefile +++ b/lib/hipe/Makefile @@ -57,20 +57,20 @@ edocs: fi all-subdirs: - for dir in $(SUB_DIRECTORIES); do \ + $(V_at)for dir in $(SUB_DIRECTORIES); do \ (cd $$dir; $(MAKE) $(MAKETARGET) EBIN=$(EBIN); cd ..); \ done # distclean and realclean should clean the bootstrap files all-subdirs-x: - for dir in $(SUB_DIRECTORIES); do \ + $(V_at)for dir in $(SUB_DIRECTORIES); do \ (cd $$dir; $(MAKE) $(MAKETARGET) EBIN=../boot_ebin; cd ..); \ done clean: - $(MAKE) MAKETARGET="clean" all-subdirs all-subdirs-x + $(V_at)$(MAKE) MAKETARGET="clean" all-subdirs all-subdirs-x distclean: - $(MAKE) MAKETARGET="distclean" all-subdirs all-subdirs-x + $(V_at)$(MAKE) MAKETARGET="distclean" all-subdirs all-subdirs-x realclean: - $(MAKE) MAKETARGET="realclean" all-subdirs all-subdirs-x + $(V_at)$(MAKE) MAKETARGET="realclean" all-subdirs all-subdirs-x diff --git a/lib/hipe/main/Makefile b/lib/hipe/main/Makefile index 673431a175..66e4c3e39a 100644 --- a/lib/hipe/main/Makefile +++ b/lib/hipe/main/Makefile @@ -76,7 +76,7 @@ ERL_COMPILE_FLAGS += +nowarn_shadow_vars +warn_missing_spec +warn_untyped_record # ---------------------------------------------------- hipe.hrl: ../vsn.mk hipe.hrl.src - sed -e "s;%VSN%;$(HIPE_VSN);" ../../hipe/main/hipe.hrl.src > ../../hipe/main/hipe.hrl + $(vsn_verbose)sed -e "s;%VSN%;$(HIPE_VSN);" ../../hipe/main/hipe.hrl.src > ../../hipe/main/hipe.hrl $(EBIN)/hipe.beam: hipe.hrl ../../compiler/src/beam_disasm.hrl $(EBIN)/hipe_main.beam: hipe.hrl ../icode/hipe_icode.hrl #../rtl/hipe_rtl.hrl @@ -97,17 +97,17 @@ distclean: clean realclean: clean $(DOCS)/%.html:%.erl - erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop + $(gen_verbose)erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop # ---------------------------------------------------- # Special Build Targets # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/hipe/rtl/Makefile b/lib/hipe/rtl/Makefile index 426d1bd3ee..7852a2172b 100644 --- a/lib/hipe/rtl/Makefile +++ b/lib/hipe/rtl/Makefile @@ -134,13 +134,13 @@ HIPE_MKLITERALS=$(ERL_TOP)/bin/$(TARGET)/hipe_mkliterals$(TYPE_STR)$(FLAVOR_STR) hipe_literals.hrl: $(HIPE_MKLITERALS) - $(HIPE_MKLITERALS) $(MKLIT_FLAGS) -e > hipe_literals.hrl + $(gen_verbose)$(HIPE_MKLITERALS) $(MKLIT_FLAGS) -e > hipe_literals.hrl # Need to generate hipe.hrl from one and only one target in one and only # one makefile; otherwise, clearmake will force rebuilds of hipe over and # over again. ../main/hipe.hrl: ../vsn.mk ../main/hipe.hrl.src - (cd ../main && $(MAKE) hipe.hrl) + $(V_at)(cd ../main && $(MAKE) hipe.hrl) # 2012-02-24. Please keep these dependencies up to date. They tend to rot. # grep ^-include *.erl says a lot, but you need to dig further, e.g: diff --git a/lib/ic/c_src/Makefile.in b/lib/ic/c_src/Makefile.in index de46eadb3b..856823b1b3 100644 --- a/lib/ic/c_src/Makefile.in +++ b/lib/ic/c_src/Makefile.in @@ -67,7 +67,11 @@ ifeq ($(findstring solaris,$(HOST_OS)),solaris) SKIP_BUILDING_BINARIES := true endif else +ifeq ($(V),0) +AR_OUT = rc +else AR_OUT = rcv +endif CC_FLAGS = @DED_CFLAGS@ LIBRARY = $(LIBDIR)/libic.a SKIP_BUILDING_BINARIES := false @@ -128,11 +132,13 @@ docs: _create_dirs := $(shell mkdir -p $(OBJDIR) $(LIBDIR)) $(LIBRARY): $(OBJ_FILES) - -$(AR) $(AR_OUT) $@ $(OBJ_FILES) + $(ar_verbose) + -$(AR) $(AR_OUT) $@ $(OBJ_FILES) + $(ranlib_verbose) -$(RANLIB) $@ $(OBJDIR)/%.o: %.c - $(CC) $(CC_FLAGS) -c -o $@ $(ALL_CFLAGS) $< + $(V_CC) $(CC_FLAGS) -c -o $@ $(ALL_CFLAGS) $< # ---------------------------------------------------- # Release Target diff --git a/lib/ic/examples/pre_post_condition/Makefile b/lib/ic/examples/pre_post_condition/Makefile index d18f81fec9..53e647e793 100644 --- a/lib/ic/examples/pre_post_condition/Makefile +++ b/lib/ic/examples/pre_post_condition/Makefile @@ -109,9 +109,9 @@ test: $(TEST_TARGET_FILES) IDL-GENERATED: ex.idl - erlc $(ERL_LOCAL_FLAGS) +'{precond,{tracer,pre}}' \ + $(gen_verbose)erlc $(ERL_LOCAL_FLAGS) +'{precond,{tracer,pre}}' \ +'{{postcond,"m::i::f"},{tracer,post}}' ex.idl - >IDL-GENERATED + $(V_at)>IDL-GENERATED $(GEN_ERL_MODULES:%=%.erl) $(GEN_HRL_FILES): IDL-GENERATED diff --git a/lib/ic/java_src/com/ericsson/otp/ic/Makefile b/lib/ic/java_src/com/ericsson/otp/ic/Makefile index cf4c353f3f..273614e8d9 100644 --- a/lib/ic/java_src/com/ericsson/otp/ic/Makefile +++ b/lib/ic/java_src/com/ericsson/otp/ic/Makefile @@ -85,7 +85,10 @@ JAR= jar JAVADOCFLAGS=-d $(DOCDIR) JAVAFLAGS=-d $(JAVA_DEST_ROOT) -JARFLAGS= -cvf +JARFLAGS= -cf +ifneq ($(V),0) +JARFLAGS= -cfv +endif JAVA_OPTIONS = diff --git a/lib/ic/src/Makefile b/lib/ic/src/Makefile index 280d86a8a4..e8769d2335 100644 --- a/lib/ic/src/Makefile +++ b/lib/ic/src/Makefile @@ -175,7 +175,7 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: @@ -183,7 +183,7 @@ docs: # Special Build Targets # ---------------------------------------------------- ../ebin/icparse.beam: icparse.erl - $(ERLC) $(ERL_COMPILE_FLAGS) +nowarn_unused_vars +nowarn_unused_function -o$(EBIN) +pj $< + $(V_ERLC) $(ERL_COMPILE_FLAGS) +nowarn_unused_vars +nowarn_unused_function -o$(EBIN) +pj $< icparse.erl: icparse.yrl icyeccpre.hrl diff --git a/lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src b/lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src index 3143ab427b..a2440adc92 100644 --- a/lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src +++ b/lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src @@ -86,15 +86,15 @@ clean: java_erl_test.built_erl java_erl_test.built_java java_erl_test.built_java: java_erl_test.idl - $(ERLC) -I $(IC_INCLUDE_PATH) "+{be,java}" java_erl_test.idl - echo done > java_erl_test.built_java + $(gen_verbose)$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,java}" java_erl_test.idl + $(V_at)echo done > java_erl_test.built_java $(CLASS_FILES) : $(JAVA_FILES) - $(JAVAC) -classpath $(CLASSPATH) $(JAVA_FILES) + $(V_JAVAC) -classpath $(CLASSPATH) $(JAVA_FILES) java_erl_test.built_erl: java_erl_test.idl - $(ERLC) -I $(IC_INCLUDE_PATH) "+{be,erl_genserv}" java_erl_test.idl - echo done > java_erl_test.built_erl + $(gen_verbose)$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,erl_genserv}" java_erl_test.idl + $(V_at)echo done > java_erl_test.built_erl .erl.@EMULATOR@: - $(ERLC) -I $(IC_INCLUDE_PATH) $< + $(V_ERLC) -I $(IC_INCLUDE_PATH) $< diff --git a/lib/inets/src/inets_app/Makefile b/lib/inets/src/inets_app/Makefile index 7d68145287..22426eee79 100644 --- a/lib/inets/src/inets_app/Makefile +++ b/lib/inets/src/inets_app/Makefile @@ -99,10 +99,10 @@ docs: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- diff --git a/lib/jinterface/java_src/Makefile b/lib/jinterface/java_src/Makefile index 19f99831eb..0aa9c09548 100644 --- a/lib/jinterface/java_src/Makefile +++ b/lib/jinterface/java_src/Makefile @@ -47,7 +47,7 @@ POM_SRC= $(POM_FILE).src # ---------------------------------------------------- $(POM_TARGET): $(POM_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ include $(ERL_TOP)/make/otp_subdir.mk diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/Makefile b/lib/jinterface/java_src/com/ericsson/otp/erlang/Makefile index 8ae63a1561..f476d4594d 100644 --- a/lib/jinterface/java_src/com/ericsson/otp/erlang/Makefile +++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/Makefile @@ -61,7 +61,10 @@ CLASSPATH = $(JAVA_SRC_ROOT) JAVADOCFLAGS=-d $(DOCDIR) JAVAFLAGS=-d $(JAVA_DEST_ROOT) -JARFLAGS=-cvf +JARFLAGS=-cf +ifneq ($(V),0) +JARFLAGS=-cfv +endif JAVA_OPTIONS = @@ -79,13 +82,13 @@ endif debug opt: make_dirs $(JAVA_DEST_ROOT)$(JARFILE) make_dirs: - if [ ! -d "$(JAVA_DEST_ROOT)" ];then mkdir "$(JAVA_DEST_ROOT)"; fi + $(V_at)if [ ! -d "$(JAVA_DEST_ROOT)" ];then mkdir "$(JAVA_DEST_ROOT)"; fi $(JAVA_DEST_ROOT)$(JARFILE): $(TARGET_FILES) @(cd $(JAVA_DEST_ROOT) ; $(JAR) $(JARFLAGS) $(JARFILE) $(JAVA_CLASS_SUBDIR)) clean: - rm -f $(TARGET_FILES) *~ + $(V_at)rm -f $(TARGET_FILES) *~ docs: @@ -96,13 +99,13 @@ docs: # include $(ERL_TOP)/make/otp_release_targets.mk release release_docs release_tests release_html: - $(MAKE) $(MFLAGS) RELEASE_PATH="$(RELEASE_PATH)" $(TARGET_MAKEFILE) $@_spec + $(V_at)$(MAKE) $(MFLAGS) RELEASE_PATH="$(RELEASE_PATH)" $(TARGET_MAKEFILE) $@_spec release_spec: opt - $(INSTALL_DIR) "$(RELSYSDIR)/java_src/com/ericsson/otp/erlang" - $(INSTALL_DATA) $(JAVA_SRC) "$(RELSYSDIR)/java_src/com/ericsson/otp/erlang" - $(INSTALL_DIR) "$(RELSYSDIR)/priv" - $(INSTALL_DATA) $(JAVA_DEST_ROOT)$(JARFILE) "$(RELSYSDIR)/priv" + $(V_at)$(INSTALL_DIR) "$(RELSYSDIR)/java_src/com/ericsson/otp/erlang" + $(V_at)$(INSTALL_DATA) $(JAVA_SRC) "$(RELSYSDIR)/java_src/com/ericsson/otp/erlang" + $(V_at)$(INSTALL_DIR) "$(RELSYSDIR)/priv" + $(V_at)$(INSTALL_DATA) $(JAVA_DEST_ROOT)$(JARFILE) "$(RELSYSDIR)/priv" release_docs_spec: diff --git a/lib/kernel/doc/src/application.xml b/lib/kernel/doc/src/application.xml index 51a3311ec2..9f19efc793 100644 --- a/lib/kernel/doc/src/application.xml +++ b/lib/kernel/doc/src/application.xml @@ -121,6 +121,15 @@ </desc> </func> <func> + <name name="get_env" arity="3"/> + <fsummary>Get the value of a configuration parameter using a default</fsummary> + <desc> + <p>Works like <seealso marker="#get_env/2">get_env/2</seealso> but returns + <c><anno>Def</anno></c> value when configuration parameter + <c><anno>Par</anno></c> does not exist.</p> + </desc> + </func> + <func> <name name="get_key" arity="1"/> <name name="get_key" arity="2"/> <fsummary>Get the value of an application specification key</fsummary> diff --git a/lib/kernel/doc/src/error_handler.xml b/lib/kernel/doc/src/error_handler.xml index acbf9a2c6e..610b65f0a2 100644 --- a/lib/kernel/doc/src/error_handler.xml +++ b/lib/kernel/doc/src/error_handler.xml @@ -43,19 +43,39 @@ A (possibly empty) list of arguments <c>Arg1,..,ArgN</c> </type_desc> <desc> - <p>This function is evaluated if a call is made to + <p>This function is called by the run-time system if a call is made to <c><anno>Module</anno>:<anno>Function</anno>(Arg1,.., ArgN)</c> and <c><anno>Module</anno>:<anno>Function</anno>/N</c> is undefined. Note that <c>undefined_function/3</c> is evaluated inside the process making the original call.</p> - <p>If <c><anno>Module</anno></c> is interpreted, the interpreter is invoked - and the return value of the interpreted - <c><anno>Function</anno>(Arg1,.., ArgN)</c> call is returned.</p> - <p>Otherwise, it returns, if possible, the value of - <c>apply(<anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>)</c> after an attempt has been - made to autoload <c><anno>Module</anno></c>. If this is not possible, the - call to <c><anno>Module</anno>:<anno>Function</anno>(Arg1,.., ArgN)</c> fails with - exit reason <c>undef</c>.</p> + + <p>This function will first attempt to autoload + <c><anno>Module</anno></c>. If that is not possible, + an <c>undef</c> exception will be raised.</p> + + <p>If it was possible to load <c><anno>Module</anno></c> + and the function <c><anno>Function</anno>/N</c> is exported, + it will be called.</p> + + <p>Otherwise, if the function <c>'$handle_undefined_function'/2</c> + is exported, it will be called as + <c>'$handle_undefined_function'(</c><anno>Function</anno>, + <anno>Args</anno>). + </p> + <p>Otherwise an <c>undef</c> exception will be raised.</p> + </desc> + </func> + <func> + <name name="raise_undef_exception" arity="3"/> + <fsummary>Raise an undef exception</fsummary> + <type_desc variable="Args"> + A (possibly empty) list of arguments <c>Arg1,..,ArgN</c> + </type_desc> + <desc> + <p>Raise an <c>undef</c> exception with a stacktrace indicating + that <c><anno>Module</anno>:<anno>Function</anno>/N</c> is + undefined. + </p> </desc> </func> <func> diff --git a/lib/kernel/doc/src/packages.xml b/lib/kernel/doc/src/packages.xml deleted file mode 100644 index 8a82b91a90..0000000000 --- a/lib/kernel/doc/src/packages.xml +++ /dev/null @@ -1,208 +0,0 @@ -<?xml version="1.0" encoding="latin1" ?> -<!DOCTYPE erlref SYSTEM "erlref.dtd"> - -<erlref> - <header> - <copyright> - <year>2004</year><year>2012</year> - <holder>Ericsson AB. All Rights Reserved.</holder> - </copyright> - <legalnotice> - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. - - </legalnotice> - - <title>packages</title> - <prepared>Kenneth Lundin</prepared> - <responsible>Kenneth Lundin</responsible> - <docno>1</docno> - <approved>Kenneth Lundin</approved> - <checked></checked> - <date>2004-09-07</date> - <rev>A</rev> - <file>packages.sgml</file> - </header> - <module>packages</module> - <modulesummary>Packages in Erlang</modulesummary> - <description> - <warning><p> - Packages has since it was introduced more than 5 years ago been an - experimental feature. Use it at your own risk, we do not - actively maintain and develop this feature. It might however be - supported some - day. - </p> - <p> - In spite of this packages work quite well, but there are some - known issues in tools and other parts where packages don't work well. - </p> - </warning> - <p><em>Introduction</em></p> - <p>Packages are simply namespaces for modules. - All old Erlang modules automatically belong to the top level - ("empty-string") namespace, and do not need any changes.</p> - <p>The full name of a packaged module is written as e.g. - "<c>fee.fie.foe.foo</c>", - i.e., as atoms separated by periods, - where the package name is the part up to - but not including the last period; - in this case "<c>fee.fie.foe</c>". - A more concrete example is the module <c>erl.lang.term</c>, - which is in the - package <c>erl.lang</c>. - Package names can have any number of segments, as in - <c>erl.lang.list.sort</c>. - The atoms in the name can be quoted, as in <c>foo.'Bar'.baz</c>, - or even the - whole name, as in <c>'foo.bar.baz'</c> but the concatenation of - atoms and - periods must not contain two consecutive period characters or - end with a period, - as in <c>'foo..bar'</c>, <c>foo.'.bar'</c>, or <c>foo.'bar.'</c>. - The periods must not be followed by whitespace.</p> - <p>The code loader maps module names onto the file system directory - structure. - E.g., the module <c>erl.lang.term</c> corresponds to a file - <c>.../erl/lang/term.beam</c> - in the search path. - Note that the name of the actual object file corresponds to - the last part only of the full module name. - (Thus, old existing modules such as <c>lists</c> - simply map to <c>.../lists.beam</c>, exactly as before.)</p> - <p>A packaged module in a file "<c>foo/bar/fred.erl</c>" is declared - as:</p> - <code type="none"> --module(foo.bar.fred).</code> - <p>This can be compiled and loaded from the Erlang shell using - <c>c(fred)</c>, if - your current directory is the same as that of the file. - The object file will be named <c>fred.beam</c>.</p> - <p>The Erlang search path works exactly as before, - except that the package segments will be appended to each - directory in the path in order to find the - file. E.g., assume the path is <c>["/usr/lib/erl", "/usr/local/lib/otp/legacy/ebin", "/home/barney/erl"]</c>. - Then, the code for a module named <c>foo.bar.fred</c> will be - searched for - first as <c>"/usr/lib/erl/foo/bar/fred.beam"</c>, then - <c>"/usr/local/lib/otp/legacy/ebin/foo/bar/fred.beam"</c> - and lastly <c>"/home/barney/erl/foo/bar/fred.beam"</c>. - A module - like <c>lists</c>, which is in the top-level package, - will be looked for as <c>"/usr/lib/erl/lists.beam"</c>, - <c>"/usr/local/lib/otp/legacy/ebin/lists.beam"</c> and - <c>"/home/barney/erl/lists.beam"</c>.</p> - <p><em>Programming</em></p> - <p>Normally, if a call is made from one module to another, - it is assumed that the - called module belongs to the same package as the source module. - The compiler - automatically expands such calls. E.g., in:</p> - <code type="none"> --module(foo.bar.m1). --export([f/1]). - -f(X) -> m2:g(X).</code> - <p><c>m2:g(X)</c> becomes a call to <c>foo.bar.m2</c> - If this is not what was intended, the call can be written - explicitly, as in</p> - <code type="none"> --module(foo.bar.m1). --export([f/1]). - -f(X) -> fee.fie.foe.m2:g(X).</code> - <p>Because the called module is given with an explicit package name, - no expansion is done in this case.</p> - <p>If a module from another package is used repeatedly in a module, - an import declaration can make life easier:</p> - <code type="none"> --module(foo.bar.m1). --export([f/1, g/1]). --import(fee.fie.foe.m2). - -f(X) -> m2:g(X). -g(X) -> m2:h(X).</code> - <p>will make the calls to <c>m2</c> refer to <c>fee.fie.foe.m2</c>. - More generally, a declaration <c>-import(Package.Module).</c> - will cause calls to <c>Module</c> - to be expanded to <c>Package.Module</c>.</p> - <p>Old-style function imports work as normal (but full module - names must be - used); e.g.:</p> - <code type="none"> --import(fee.fie.foe.m2, [g/1, h/1]).</code> - <p>however, it is probably better to avoid this form of import - altogether in new - code, since it makes it hard to see what calls are really "remote".</p> - <p>If it is necessary to call a module in the top-level package - from within a - named package, the module name can be written either with an - initial period as - in e.g. "<c>.lists</c>", or with an empty initial atom, as in - "<c>''.lists</c>". - However, the best way is to use an import declaration - - this is most obvious to - the eye, and makes sure we don't forget adding a period somewhere:</p> - <code type="none"> --module(foo.bar.fred). --export([f/1]). --import(lists). - -f(X) -> lists:reverse(X).</code> - <p>The dot-syntax for module names can be used in any expression. - All segments must - be constant atoms, and the result must be a well-formed - package/module name. - E.g.:</p> - <code type="none"> -spawn(foo.bar.fred, f, [X])</code> - <p>is equivalent to <c>spawn('foo.bar.fred', f, [X])</c>.</p> - <p><em>The Erlang Shell</em></p> - <p>The shell also automatically expands remote calls, - however currently no - expansions are made by default. - The user can change the behaviour by using the <c>import/1</c> - shell command (or its abbreviation <c>use/1</c>). E.g.:</p> - <pre> -1> <input>import(foo.bar.m).</input> -ok -2> <input>m:f().</input></pre> - <p>will evaluate <c>foo.bar.m:f()</c>. - If a new import is made of the same name, - this overrides any previous import. - (It is likely that in the future, some - system packages will be pre-imported.)</p> - <p>In addition, the shell command <c>import_all/1</c> - (and its alias <c>use_all/1</c>) - imports all modules currently found in the path for a given - package name. E.g., - assuming the files "<c>.../foo/bar/fred.beam</c>", - "<c>.../foo/bar/barney.beam</c>" - and "<c>.../foo/bar/bambam.beam</c>" can be found from our current - path,</p> - <pre> -1> <input>import_all(foo.bar).</input></pre> - <p>will make <c>fred</c>, <c>barney</c> and <c>bambam</c> - expand to <c>foo.bar.fred</c>, - <c>foo.bar.barney</c> and <c>foo.bar.bambam</c>, respectively.</p> - <p>Note: The compiler does not have an "import all" directive, for the - reason that Erlang has no compile time type checking. - E.g. if the wrong search - path is used at compile time, a call <c>m:f(...)</c> - could be expanded to <c>foo.bar.m:f(...)</c> - without any warning, instead of the intended - <c>frob.ozz.m:f(...)</c>, if - package <c>foo.bar</c> happens to be found first in the path. - Explicitly - declaring each use of a module makes for safe code.</p> - </description> -</erlref> - diff --git a/lib/kernel/doc/src/ref_man.xml b/lib/kernel/doc/src/ref_man.xml index 9ef0959271..67d91ba585 100644 --- a/lib/kernel/doc/src/ref_man.xml +++ b/lib/kernel/doc/src/ref_man.xml @@ -64,6 +64,5 @@ <xi:include href="zlib_stub.xml"/> <xi:include href="app.xml"/> <xi:include href="config.xml"/> - <xi:include href="packages.xml"/> </application> diff --git a/lib/kernel/src/Makefile b/lib/kernel/src/Makefile index 60291bbce6..eaced4861a 100644 --- a/lib/kernel/src/Makefile +++ b/lib/kernel/src/Makefile @@ -170,13 +170,13 @@ docs: # ---------------------------------------------------- ../../hipe/main/hipe.hrl: ../../hipe/vsn.mk ../../hipe/main/hipe.hrl.src - sed -e "s;%VSN%;$(HIPE_VSN);" ../../hipe/main/hipe.hrl.src > ../../hipe/main/hipe.hrl + $(vsn_verbose)sed -e "s;%VSN%;$(HIPE_VSN);" ../../hipe/main/hipe.hrl.src > ../../hipe/main/hipe.hrl $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(KERNEL_VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(KERNEL_VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(KERNEL_VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(KERNEL_VSN);' $< > $@ EPMD_FLAGS = -Depmd_port_no=$(EPMD_PORT_NO) \ @@ -186,10 +186,10 @@ EPMD_FLAGS = -Depmd_port_no=$(EPMD_PORT_NO) \ -Derlang_daemon_port=$(EPMD_PORT_NO) $(ESRC)/inet_dns_record_adts.hrl: $(ESRC)/inet_dns_record_adts.pl - LANG=C $(PERL) $< > $@ + $(gen_verbose)LANG=C $(PERL) $< > $@ $(EBIN)/erl_epmd.beam: $(ESRC)/erl_epmd.erl - $(ERLC) $(ERL_COMPILE_FLAGS) $(EPMD_FLAGS) -o$(EBIN) $< + $(V_ERLC) $(ERL_COMPILE_FLAGS) $(EPMD_FLAGS) -o$(EBIN) $< # ---------------------------------------------------- # Release Target diff --git a/lib/kernel/src/application.erl b/lib/kernel/src/application.erl index 9b7c4aa7b8..4e65883be7 100644 --- a/lib/kernel/src/application.erl +++ b/lib/kernel/src/application.erl @@ -23,7 +23,7 @@ which_applications/0, which_applications/1, loaded_applications/0, permit/2]). -export([set_env/3, set_env/4, unset_env/2, unset_env/3]). --export([get_env/1, get_env/2, get_all_env/0, get_all_env/1]). +-export([get_env/1, get_env/2, get_env/3, get_all_env/0, get_all_env/1]). -export([get_key/1, get_key/2, get_all_key/0, get_all_key/1]). -export([get_application/0, get_application/1, info/0]). -export([start_type/0]). @@ -264,6 +264,20 @@ get_env(Key) -> get_env(Application, Key) -> application_controller:get_env(Application, Key). +-spec get_env(Application, Par, Def) -> Val when + Application :: atom(), + Par :: atom(), + Def :: term(), + Val :: term(). + +get_env(Application, Key, Def) -> + case get_env(Application, Key) of + {ok, Val} -> + Val; + undefined -> + Def + end. + -spec get_all_env() -> Env when Env :: [{Par :: atom(), Val :: term()}]. diff --git a/lib/kernel/src/error_handler.erl b/lib/kernel/src/error_handler.erl index f8bc5f499c..a3aa1f1dcf 100644 --- a/lib/kernel/src/error_handler.erl +++ b/lib/kernel/src/error_handler.erl @@ -23,10 +23,12 @@ %% "error_handler: add no_native compiler directive" -compile(no_native). -%% A simple error handler. +%% Callbacks called from the run-time system. +-export([undefined_function/3,undefined_lambda/3,breakpoint/3]). --export([undefined_function/3, undefined_lambda/3, stub_function/3, - breakpoint/3]). +%% Exported utility functions. +-export([raise_undef_exception/3]). +-export([stub_function/3]). -spec undefined_function(Module, Function, Args) -> any() when @@ -41,12 +43,7 @@ undefined_function(Module, Func, Args) -> true -> apply(Module, Func, Args); false -> - case check_inheritance(Module, Args) of - {value, Base, Args1} -> - apply(Base, Func, Args1); - none -> - crash(Module, Func, Args) - end + call_undefined_function_handler(Module, Func, Args) end; {module, _} -> crash(Module, Func, Args); @@ -77,6 +74,14 @@ undefined_lambda(Module, Fun, Args) -> breakpoint(Module, Func, Args) -> (int()):eval(Module, Func, Args). +-spec raise_undef_exception(Module, Function, Args) -> no_return() when + Module :: atom(), + Function :: atom(), + Args :: list(). + +raise_undef_exception(Module, Func, Args) -> + crash({Module,Func,Args,[]}). + %% Used to make the call to the 'int' module a "weak" one, to avoid %% building strong components in xref or dialyzer. @@ -130,27 +135,11 @@ ensure_loaded(Module) -> stub_function(Mod, Func, Args) -> exit({undef,[{Mod,Func,Args,[]}]}). -check_inheritance(Module, Args) -> - Attrs = erlang:get_module_info(Module, attributes), - case lists:keyfind(extends, 1, Attrs) of - {extends, [Base]} when is_atom(Base), Base =/= Module -> - %% This is just a heuristic for detecting abstract modules - %% with inheritance so they can be handled; it would be - %% much better to do it in the emulator runtime - case lists:keyfind(abstract, 1, Attrs) of - {abstract, [true]} -> - case lists:reverse(Args) of - [M|Rs] when tuple_size(M) > 1, - element(1,M) =:= Module, - tuple_size(element(2,M)) > 0, - is_atom(element(1,element(2,M))) -> - {value, Base, lists:reverse(Rs, [element(2,M)])}; - _ -> - {value, Base, Args} - end; - _ -> - {value, Base, Args} - end; - _ -> - none +call_undefined_function_handler(Module, Func, Args) -> + Handler = '$handle_undefined_function', + case erlang:function_exported(Module, Handler, 2) of + false -> + crash(Module, Func, Args); + true -> + Module:Handler(Func, Args) end. diff --git a/lib/kernel/test/Makefile b/lib/kernel/test/Makefile index 7fd3afe93c..8d2d55777b 100644 --- a/lib/kernel/test/Makefile +++ b/lib/kernel/test/Makefile @@ -48,6 +48,7 @@ MODULES= \ erl_distribution_SUITE \ erl_distribution_wb_SUITE \ erl_prim_loader_SUITE \ + error_handler_SUITE \ error_logger_SUITE \ error_logger_warn_SUITE \ file_SUITE \ diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl index f469a0af98..2ca8840e1f 100644 --- a/lib/kernel/test/application_SUITE.erl +++ b/lib/kernel/test/application_SUITE.erl @@ -27,7 +27,7 @@ otp_1586/1, otp_2078/1, otp_2012/1, otp_2718/1, otp_2973/1, otp_3002/1, otp_3184/1, otp_4066/1, otp_4227/1, otp_5363/1, otp_5606/1, - start_phases/1, get_key/1, + start_phases/1, get_key/1, get_env/1, permit_false_start_local/1, permit_false_start_dist/1, script_start/1, nodedown_start/1, init2973/0, loop2973/0, loop5606/1]). @@ -49,7 +49,7 @@ all() -> [failover, failover_comp, permissions, load, load_use_cache, {group, reported_bugs}, start_phases, script_start, nodedown_start, permit_false_start_local, - permit_false_start_dist, get_key, + permit_false_start_dist, get_key, get_env, {group, distr_changed}, config_change, shutdown_func, shutdown_timeout]. groups() -> @@ -1503,6 +1503,15 @@ loop5606(Pid) -> Pid ! {self(), Res} end. +get_env(suite) -> []; +get_env(doc) -> + ["Tests get_env/* functions"]; +get_env(Conf) when is_list(Conf) -> + {ok, _} = application:get_env(kernel, error_logger), + undefined = application:get_env(undefined_app, a), + undefined = application:get_env(kernel, error_logger_xyz), + default = application:get_env(kernel, error_logger_xyz, default), + ok. %%----------------------------------------------------------------- %% Should be started in a CC view with: diff --git a/lib/kernel/test/error_handler_SUITE.erl b/lib/kernel/test/error_handler_SUITE.erl new file mode 100644 index 0000000000..2a86d39b74 --- /dev/null +++ b/lib/kernel/test/error_handler_SUITE.erl @@ -0,0 +1,68 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2013. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +-module(error_handler_SUITE). + +-export([all/0,suite/0,groups/0,init_per_suite/1,end_per_suite/1, + init_per_group/2,end_per_group/2, + undefined_function_handler/1]). + +%% Callback from error_handler. +-export(['$handle_undefined_function'/2]). + +suite() -> [{ct_hooks,[ts_install_cth]}]. + +all() -> + [undefined_function_handler]. + +groups() -> + []. + +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +%%----------------------------------------------------------------- + +undefined_function_handler(_) -> + 42 = ?MODULE:forty_two(), + 42 = (id(?MODULE)):forty_two(), + {ok,{a,b,c}} = ?MODULE:one_arg({a,b,c}), + {ok,{a,b,c}} = (id(?MODULE)):one_arg({a,b,c}), + {'EXIT',{undef,[{?MODULE,undef_and_not_handled,[[1,2,3]],[]}|_]}} = + (catch ?MODULE:undef_and_not_handled([1,2,3])), + ok. + +'$handle_undefined_function'(forty_two, []) -> + 42; +'$handle_undefined_function'(one_arg, [Arg]) -> + {ok,Arg}; +'$handle_undefined_function'(Func, Args) -> + error_handler:raise_undef_exception(?MODULE, Func, Args). + +id(I) -> + I. diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl index b40c50f79f..9428a38660 100644 --- a/lib/kernel/test/global_SUITE.erl +++ b/lib/kernel/test/global_SUITE.erl @@ -91,27 +91,9 @@ end_per_group(_GroupName, Config) -> Config. init_per_suite(Config) -> - - %% Copied from test_server_ctrl ln 647, we have to do this here as - %% the test_server only does this when run without common_test - global:sync(), - case global:whereis_name(test_server) of - undefined -> - io:format(user, "Registering test_server globally!~n",[]), - global:register_name(test_server, whereis(test_server_ctrl)); - Pid -> - case node() of - N when N == node(Pid) -> - io:format(user, "Warning: test_server already running!\n", []), - global:re_register_name(test_server,self()); - _ -> - ok - end - end, Config. end_per_suite(_Config) -> - global:unregister_name(test_server), ok. @@ -135,8 +117,7 @@ end_per_testcase(_Case, Config) -> ?line write_high_level_trace(Config), ?line _ = gen_server:call(global_name_server, high_level_trace_stop, infinity), - ?line[global:unregister_name(N) || N <- global:registered_names(), - N =/= test_server], + [global:unregister_name(N) || N <- global:registered_names()], ?line InitRegistered = ?registered, ?line Registered = registered(), ?line [io:format("~s local names: ~p~n", [What, N]) || @@ -1840,16 +1821,16 @@ do_otp_3162(StartFun, Config) -> ?line ?UNTIL ([Cp3] =:= lists:sort(rpc:call(Cp1, erlang, nodes, [])) -- [node()]), - ?line ?UNTIL([kalle, test_server, vera] =:= + ?UNTIL([kalle, vera] =:= lists:sort(rpc:call(Cp1, global, registered_names, []))), ?line ?UNTIL ([Cp3] =:= lists:sort(rpc:call(Cp2, erlang, nodes, [])) -- [node()]), - ?line ?UNTIL([stina, test_server, vera] =:= + ?UNTIL([stina, vera] =:= lists:sort(rpc:call(Cp2, global, registered_names, []))), ?line ?UNTIL ([Cp1, Cp2] =:= lists:sort(rpc:call(Cp3, erlang, nodes, [])) -- [node()]), - ?line ?UNTIL([kalle, stina, test_server, vera] =:= + ?UNTIL([kalle, stina, vera] =:= lists:sort(rpc:call(Cp3, global, registered_names, []))), ?line pong = rpc:call(Cp2, net_adm, ping, [Cp1]), @@ -1860,17 +1841,17 @@ do_otp_3162(StartFun, Config) -> ?line ?UNTIL(begin NN = lists:sort(rpc:call(Cp1, global, registered_names, [])), - [kalle, stina, test_server, vera] =:= NN + [kalle, stina, vera] =:= NN end), ?line ?UNTIL ([Cp1, Cp3] =:= lists:sort(rpc:call(Cp2, erlang, nodes, [])) -- [node()]), - ?line ?UNTIL([kalle, stina, test_server, vera] =:= + ?UNTIL([kalle, stina, vera] =:= lists:sort(rpc:call(Cp2, global, registered_names, []))), ?line ?UNTIL ([Cp1, Cp2] =:= lists:sort(rpc:call(Cp3, erlang, nodes, [])) -- [node()]), - ?line ?UNTIL([kalle, stina, test_server, vera] =:= + ?UNTIL([kalle, stina, vera] =:= lists:sort(rpc:call(Cp3, global, registered_names, []))), write_high_level_trace(Config), @@ -4154,7 +4135,7 @@ init_condition(Config) -> {"Global Locks (ETS)", global_locks}, {"Global Pid Names (ETS)", global_pid_names}, {"Global Pid Ids (ETS)", global_pid_ids}]], - ?UNTIL([test_server] =:= global:registered_names()), + ?UNTIL([] =:= global:registered_names()), ?UNTIL([] =:= nodes()), ?UNTIL([node()] =:= get_known(node())), ok. diff --git a/lib/megaco/aclocal.m4 b/lib/megaco/aclocal.m4 index 5d555a5123..918e30a886 100644 --- a/lib/megaco/aclocal.m4 +++ b/lib/megaco/aclocal.m4 @@ -1861,17 +1861,16 @@ dnl Usage example LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) dnl dnl AC_DEFUN([LM_TRY_ENABLE_CFLAG], [ - AC_MSG_CHECKING([if we can add $1 to CFLAGS]) + AC_MSG_CHECKING([if we can add $1 to $2 (via CFLAGS)]) saved_CFLAGS=$CFLAGS; - CFLAGS="$1 $CFLAGS"; + CFLAGS="$1 $$2"; AC_TRY_COMPILE([],[return 0;],can_enable_flag=true,can_enable_flag=false) CFLAGS=$saved_CFLAGS; if test "X$can_enable_flag" = "Xtrue"; then AC_MSG_RESULT([yes]) - AS_VAR_SET($2, "$1 $CFLAGS") + AS_VAR_SET($2, "$1 $$2") else AC_MSG_RESULT([no]) - AS_VAR_SET($2, "$CFLAGS") fi ]) diff --git a/lib/megaco/configure.in b/lib/megaco/configure.in index 9c3858f562..643267a154 100644 --- a/lib/megaco/configure.in +++ b/lib/megaco/configure.in @@ -162,6 +162,11 @@ else fi AC_SUBST(OTP_EXTRA_FLAGS) +if test "x$GCC" = xyes; then + # Treat certain GCC warnings as errors + LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) +fi + dnl dnl If ${ERL_TOP}/make/otp_ded.mk.in exists and contains DED_MK_VSN > 0, dnl every thing releted to compiling Dynamic Erlang Drivers can be found @@ -273,11 +278,6 @@ if test "$PERL" = no_perl; then AC_MSG_ERROR([Perl is required to build the flex scanner!]) fi -if test "x$GCC" = xyes; then - # Treat certain GCC warnings as errors - LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) -fi - AC_OUTPUT(examples/meas/Makefile:examples/meas/Makefile.in) AC_OUTPUT(src/flex/$host/Makefile:src/flex/Makefile.in) diff --git a/lib/megaco/examples/meas/Makefile.in b/lib/megaco/examples/meas/Makefile.in index c517fd21cf..91e342cd9a 100644 --- a/lib/megaco/examples/meas/Makefile.in +++ b/lib/megaco/examples/meas/Makefile.in @@ -147,12 +147,12 @@ release_docs_spec: # ---------------------------------------------------- meas.sh.skel: meas.sh.skel.src - @echo "transforming $< to $@" - $(PERL) -p -e 's?%VSN%?$(VSN)? ' < $< > $@ + $(V_colon)@echo "transforming $< to $@" + $(vsn_verbose)$(PERL) -p -e 's?%VSN%?$(VSN)? ' < $< > $@ mstone1.sh.skel: mstone1.sh.skel.src - @echo "transforming $< to $@" - $(PERL) -p -e 's?%VSN%?$(VSN)? ' < $< > $@ + $(V_colon)@echo "transforming $< to $@" + $(vsn_verbose)$(PERL) -p -e 's?%VSN%?$(VSN)? ' < $< > $@ megaco_codec_transform.$(EMULATOR): megaco_codec_transform.erl diff --git a/lib/megaco/src/app/Makefile b/lib/megaco/src/app/Makefile index 42030c5b1c..d18da5326a 100644 --- a/lib/megaco/src/app/Makefile +++ b/lib/megaco/src/app/Makefile @@ -94,10 +94,10 @@ info: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ diff --git a/lib/megaco/src/binary/Makefile b/lib/megaco/src/binary/Makefile index 660713605e..c1fd66b848 100644 --- a/lib/megaco/src/binary/Makefile +++ b/lib/megaco/src/binary/Makefile @@ -129,12 +129,13 @@ opt: prebuild $(TARGET_FILES) prebuild: prebuild.skip prebuild.skip: - @echo "Building prebuild.skip\c" + $(gen_verbose) + $(V_colon)@echo "Building prebuild.skip\c" @touch prebuild.skip @for a in $(SPEC_ASN1DB); do \ echo $$a >> prebuild.skip; \ done - @echo "" + $(V_colon)@echo "" v1: $(V2_SPEC_BINS) diff --git a/lib/megaco/src/binary/depend.mk b/lib/megaco/src/binary/depend.mk index a1318079be..2dce45981f 100644 --- a/lib/megaco/src/binary/depend.mk +++ b/lib/megaco/src/binary/depend.mk @@ -53,8 +53,8 @@ PER_V3_FLAGS = $(ASN1_CT_OPTS) $(BER_ASN1_V1_SPEC).erl: \ $(BER_ASN1_V1_SPEC).set.asn \ $(ASN1_V1_SPEC).asn - @echo "$(BER_ASN1_V1_SPEC):" - $(ERLC) -bber $(BER_V1_FLAGS) $(BER_ASN1_V1_SPEC).set.asn + $(V_colon)@echo "$(BER_ASN1_V1_SPEC):" + $(asn_verbose)$(ERLC) -bber $(BER_V1_FLAGS) $(BER_ASN1_V1_SPEC).set.asn $(EBIN)/$(BER_ASN1_V1_SPEC).$(EMULATOR): \ $(BER_ASN1_V1_SPEC).erl @@ -62,8 +62,8 @@ $(EBIN)/$(BER_ASN1_V1_SPEC).$(EMULATOR): \ $(PER_ASN1_V1_SPEC).erl: \ $(PER_ASN1_V1_SPEC).set.asn \ $(ASN1_V1_SPEC).asn - @echo "$(PER_ASN1_V1_SPEC):" - $(ERLC) -bper $(PER_V1_FLAGS) $(PER_ASN1_V1_SPEC).set.asn + $(V_colon)@echo "$(PER_ASN1_V1_SPEC):" + $(asn_verbose)$(ERLC) -bper $(PER_V1_FLAGS) $(PER_ASN1_V1_SPEC).set.asn $(EBIN)/$(PER_ASN1_V1_SPEC).$(EMULATOR): \ $(PER_ASN1_V1_SPEC).erl @@ -74,8 +74,8 @@ $(EBIN)/$(PER_ASN1_V1_SPEC).$(EMULATOR): \ $(BER_ASN1_V2_SPEC).erl: \ $(BER_ASN1_V2_SPEC).set.asn \ $(ASN1_V2_SPEC).asn - @echo "$(BER_ASN1_V2_SPEC):" - $(ERLC) -bber $(BER_V2_FLAGS) $(BER_ASN1_V2_SPEC).set.asn + $(V_colon)@echo "$(BER_ASN1_V2_SPEC):" + $(asn_verbose)$(ERLC) -bber $(BER_V2_FLAGS) $(BER_ASN1_V2_SPEC).set.asn $(EBIN)/$(BER_ASN1_V2_SPEC).$(EMULATOR): \ $(BER_ASN1_V2_SPEC).erl @@ -83,8 +83,8 @@ $(EBIN)/$(BER_ASN1_V2_SPEC).$(EMULATOR): \ $(PER_ASN1_V2_SPEC).erl: \ $(PER_ASN1_V2_SPEC).set.asn \ $(ASN1_V2_SPEC).asn - @echo "$(PER_ASN1_V2_SPEC):" - $(ERLC) -bper $(PER_V2_FLAGS) $(PER_ASN1_V2_SPEC).set.asn + $(V_colon)@echo "$(PER_ASN1_V2_SPEC):" + $(asn_verbose)$(ERLC) -bper $(PER_V2_FLAGS) $(PER_ASN1_V2_SPEC).set.asn $(EBIN)/$(PER_ASN1_V2_SPEC).$(EMULATOR): \ $(PER_ASN1_V2_SPEC).erl @@ -96,8 +96,8 @@ $(EBIN)/$(PER_ASN1_V2_SPEC).$(EMULATOR): \ $(BER_ASN1_PREV3A_SPEC).erl: \ $(BER_ASN1_PREV3A_SPEC).set.asn \ $(ASN1_PREV3A_SPEC).asn - @echo "$(BER_ASN1_PREV3A_SPEC):" - $(ERLC) -bber $(BER_PREV3A_FLAGS) $(BER_ASN1_PREV3A_SPEC).set.asn + $(V_colon)@echo "$(BER_ASN1_PREV3A_SPEC):" + $(asn_verbose)$(ERLC) -bber $(BER_PREV3A_FLAGS) $(BER_ASN1_PREV3A_SPEC).set.asn $(EBIN)/$(BER_ASN1_PREV3A_SPEC).$(EMULATOR): \ $(BER_ASN1_PREV3A_SPEC).erl @@ -105,8 +105,8 @@ $(EBIN)/$(BER_ASN1_PREV3A_SPEC).$(EMULATOR): \ $(PER_ASN1_PREV3A_SPEC).erl: \ $(PER_ASN1_PREV3A_SPEC).set.asn \ $(ASN1_PREV3A_SPEC).asn - @echo "$(PER_ASN1_PREV3A_SPEC):" - $(ERLC) -bper $(PER_PREV3A_FLAGS) $(PER_ASN1_PREV3A_SPEC).set.asn + $(V_colon)@echo "$(PER_ASN1_PREV3A_SPEC):" + $(asn_verbose)$(ERLC) -bper $(PER_PREV3A_FLAGS) $(PER_ASN1_PREV3A_SPEC).set.asn $(EBIN)/$(PER_ASN1_PREV3A_SPEC).$(EMULATOR): \ $(PER_ASN1_PREV3A_SPEC).erl @@ -117,8 +117,8 @@ $(EBIN)/$(PER_ASN1_PREV3A_SPEC).$(EMULATOR): \ $(BER_ASN1_PREV3B_SPEC).erl: \ $(BER_ASN1_PREV3B_SPEC).set.asn \ $(ASN1_PREV3B_SPEC).asn - @echo "$(BER_ASN1_PREV3B_SPEC):" - $(ERLC) -bber $(BER_PREV3B_FLAGS) $(BER_ASN1_PREV3B_SPEC).set.asn + $(V_colon)@echo "$(BER_ASN1_PREV3B_SPEC):" + $(asn_verbose)$(ERLC) -bber $(BER_PREV3B_FLAGS) $(BER_ASN1_PREV3B_SPEC).set.asn $(EBIN)/$(BER_ASN1_PREV3B_SPEC).$(EMULATOR): \ $(BER_ASN1_PREV3B_SPEC).erl @@ -126,8 +126,8 @@ $(EBIN)/$(BER_ASN1_PREV3B_SPEC).$(EMULATOR): \ $(PER_ASN1_PREV3B_SPEC).erl: \ $(PER_ASN1_PREV3B_SPEC).set.asn \ $(ASN1_PREV3B_SPEC).asn - @echo "$(PER_ASN1_PREV3B_SPEC):" - $(ERLC) -bper $(PER_PREV3B_FLAGS) $(PER_ASN1_PREV3B_SPEC).set.asn + $(V_colon)@echo "$(PER_ASN1_PREV3B_SPEC):" + $(asn_verbose)$(ERLC) -bper $(PER_PREV3B_FLAGS) $(PER_ASN1_PREV3B_SPEC).set.asn $(EBIN)/$(PER_ASN1_PREV3B_SPEC).$(EMULATOR): \ $(PER_ASN1_PREV3B_SPEC).erl @@ -138,8 +138,8 @@ $(EBIN)/$(PER_ASN1_PREV3B_SPEC).$(EMULATOR): \ $(BER_ASN1_PREV3C_SPEC).erl: \ $(BER_ASN1_PREV3C_SPEC).set.asn \ $(ASN1_PREV3C_SPEC).asn - @echo "$(BER_ASN1_PREV3C_SPEC):" - $(ERLC) -bber $(BER_PREV3C_FLAGS) $(BER_ASN1_PREV3C_SPEC).set.asn + $(V_colon)@echo "$(BER_ASN1_PREV3C_SPEC):" + $(asn_verbose)$(ERLC) -bber $(BER_PREV3C_FLAGS) $(BER_ASN1_PREV3C_SPEC).set.asn $(EBIN)/$(BER_ASN1_PREV3C_SPEC).$(EMULATOR): \ $(BER_ASN1_PREV3C_SPEC).erl @@ -147,8 +147,8 @@ $(EBIN)/$(BER_ASN1_PREV3C_SPEC).$(EMULATOR): \ $(PER_ASN1_PREV3C_SPEC).erl: \ $(PER_ASN1_PREV3C_SPEC).set.asn \ $(ASN1_PREV3C_SPEC).asn - @echo "$(PER_ASN1_PREV3C_SPEC):" - $(ERLC) -bper $(PER_PREV3C_FLAGS) $(PER_ASN1_PREV3C_SPEC).set.asn + $(V_colon)@echo "$(PER_ASN1_PREV3C_SPEC):" + $(asn_verbose)$(ERLC) -bper $(PER_PREV3C_FLAGS) $(PER_ASN1_PREV3C_SPEC).set.asn $(EBIN)/$(PER_ASN1_PREV3C_SPEC).$(EMULATOR): \ $(PER_ASN1_PREV3C_SPEC).erl @@ -159,8 +159,8 @@ $(EBIN)/$(PER_ASN1_PREV3C_SPEC).$(EMULATOR): \ $(BER_ASN1_V3_SPEC).erl: \ $(BER_ASN1_V3_SPEC).set.asn \ $(ASN1_V3_SPEC).asn - @echo "$(BER_ASN1_V3_SPEC):" - $(ERLC) -bber $(BER_V3_FLAGS) $(BER_ASN1_V3_SPEC).set.asn + $(V_colon)@echo "$(BER_ASN1_V3_SPEC):" + $(asn_verbose)$(ERLC) -bber $(BER_V3_FLAGS) $(BER_ASN1_V3_SPEC).set.asn $(EBIN)/$(BER_ASN1_V3_SPEC).$(EMULATOR): \ $(BER_ASN1_V3_SPEC).erl @@ -168,8 +168,8 @@ $(EBIN)/$(BER_ASN1_V3_SPEC).$(EMULATOR): \ $(PER_ASN1_V3_SPEC).erl: \ $(PER_ASN1_V3_SPEC).set.asn \ $(ASN1_V3_SPEC).asn - @echo "$(PER_ASN1_V3_SPEC):" - $(ERLC) -bper $(PER_V3_FLAGS) $(PER_ASN1_V3_SPEC).set.asn + $(V_colon)@echo "$(PER_ASN1_V3_SPEC):" + $(asn_verbose)$(ERLC) -bper $(PER_V3_FLAGS) $(PER_ASN1_V3_SPEC).set.asn $(EBIN)/$(PER_ASN1_V3_SPEC).$(EMULATOR): \ $(PER_ASN1_V3_SPEC).erl diff --git a/lib/megaco/src/flex/Makefile.in b/lib/megaco/src/flex/Makefile.in index cb5f5412f4..6111cf2304 100644 --- a/lib/megaco/src/flex/Makefile.in +++ b/lib/megaco/src/flex/Makefile.in @@ -319,16 +319,16 @@ release_docs_spec: $(STD_DRV).flex: megaco_flex_scanner_drv.flex.src ifeq ($(ENABLE_MEGACO_FLEX_SCANNER_LINENO),true) - @printf "std [flex] scanner - lineno enabled\n" - $(PERL) -p -e \ + $(V_colon)@printf "std [flex] scanner - lineno enabled\n" + $(gen_verbose)$(PERL) -p -e \ 's/%FLEX_VERSION%/$(FLEX_VSN)/ ; \ s/%MEGACO_YY_LINENO_OPTION%/%option yylineno/ ; \ s/%MEGACO_YY_REENTRANT_OPTION%/\/\* %option reentrant \*\// ; \ s/%MEGACO_DUMMY_DECL_YY_LINENO%/\/* static int yylineno = 1; *\//' \ < $< > $@ else - @printf "std [flex] scanner - lineno disabled\n" - $(PERL) -p -e \ + $(V_colon)@printf "std [flex] scanner - lineno disabled\n" + $(gen_verbose)$(PERL) -p -e \ 's/%FLEX_VERSION%/$(FLEX_VSN)/ ; \ s/%MEGACO_YY_LINENO_OPTION%/\/\* %option yylineno \*\// ; \ s/%MEGACO_YY_REENTRANT_OPTION%/\/\* %option reentrant \*\// ; \ @@ -339,16 +339,16 @@ endif $(MT_DRV).flex: megaco_flex_scanner_drv.flex.src ifeq ($(ENABLE_MEGACO_FLEX_SCANNER_LINENO),true) ifeq ($(ENABLE_REENTRANT_MEGACO_FLEX_SCANNER),true) - @printf "multi-threaded reentrant [flex] scanner - lineno enabled\n" - $(PERL) -p -e \ + $(V_colon)@printf "multi-threaded reentrant [flex] scanner - lineno enabled\n" + $(gen_verbose)$(PERL) -p -e \ 's/%FLEX_VERSION%/$(FLEX_VSN)/ ; \ s/%MEGACO_YY_LINENO_OPTION%/%option yylineno/ ; \ s/%MEGACO_YY_REENTRANT_OPTION%/%option reentrant/ ; \ s/%MEGACO_DUMMY_DECL_YY_LINENO%/\/* static int yylineno = 1; *\//' \ < $< > $@ else - @printf "multi-threaded non-reentrant [flex] scanner - lineno enabled\n" - $(PERL) -p -e \ + $(V_colon)@printf "multi-threaded non-reentrant [flex] scanner - lineno enabled\n" + $(gen_verbose)$(PERL) -p -e \ 's/%FLEX_VERSION%/$(FLEX_VSN)/ ; \ s/%MEGACO_YY_LINENO_OPTION%/%option yylineno/ ; \ s/%MEGACO_YY_REENTRANT_OPTION%/\/\* %option reentrant \*\// ; \ @@ -357,16 +357,16 @@ else endif else ifeq ($(ENABLE_REENTRANT_MEGACO_FLEX_SCANNER),true) - @printf "multi-threaded reentrant [flex] scanner - lineno disabled\n" - $(PERL) -p -e \ + $(V_colon)@printf "multi-threaded reentrant [flex] scanner - lineno disabled\n" + $(gen_verbose)$(PERL) -p -e \ 's/%FLEX_VERSION%/$(FLEX_VSN)/ ; \ s/%MEGACO_YY_LINENO_OPTION%/\/\* %option yylineno \*\// ; \ s/%MEGACO_YY_REENTRANT_OPTION%/%option reentrant/ ; \ s/%MEGACO_DUMMY_DECL_YY_LINENO%/\/* static int yylineno = 1; - REENTRANT SCANNER*\//' \ < $< > $@ else - @printf "multi-threaded non-reentrant [flex] scanner - lineno disabled\n" - $(PERL) -p -e \ + $(V_colon)@printf "multi-threaded non-reentrant [flex] scanner - lineno disabled\n" + $(gen_verbose)$(PERL) -p -e \ 's/%FLEX_VERSION%/$(FLEX_VSN)/ ; \ s/%MEGACO_YY_LINENO_OPTION%/\/\* %option yylineno \*\// ; \ s/%MEGACO_YY_REENTRANT_OPTION%/\/\* %option reentrant \*\// ; \ @@ -376,31 +376,31 @@ endif endif # megaco_flex_scanner_drv.c: megaco_flex_scanner_drv.flex -# $(LEX) $(LEX_FLAGS) -P$* -o$@ $< +# $(V_LEX) $(LEX_FLAGS) -P$* -o$@ $< $(STD_DRV).c: $(STD_DRV).flex - $(LEX) $(STD_LEX_FLAGS) -P$* -o$@ $< + $(V_LEX) $(STD_LEX_FLAGS) -P$* -o$@ $< $(MT_DRV).c: $(MT_DRV).flex - $(LEX) $(MT_LEX_FLAGS) -P$* -o$@ $< + $(V_LEX) $(MT_LEX_FLAGS) -P$* -o$@ $< _create_dirs := $(shell mkdir -p $(OBJDIR) $(LIBDIR)) solibs: $(SOLIBS) $(OBJDIR)/$(STD_DRV).o: $(STD_DRV).c - @echo "compiling std driver:" - $(CC) -c $(STD_DRV_NAME) $(CFLAGS) -o $@ $< + $(V_colon)@echo "compiling std driver:" + $(V_CC) -c $(STD_DRV_NAME) $(CFLAGS) -o $@ $< $(OBJDIR)/$(MT_DRV).o: $(MT_DRV).c - @echo "compiling multi-threaded driver:" - $(CC) -c $(MT_DRV_NAME) $(CFLAGS_MT) -o $@ $< + $(V_colon)@echo "compiling multi-threaded driver:" + $(V_CC) -c $(MT_DRV_NAME) $(CFLAGS_MT) -o $@ $< # No need to link with -lfl as we have also defined %option noyywrap - # and having -lfl doesn't work under Darwin for some reason. - Sean $(LIBDIR)/$(STD_DRV).$(DED_EXT): $(OBJDIR)/$(STD_DRV).o - @echo "linking std driver:" - $(LD) $(LDFLAGS) -o $@ $< + $(V_colon)@echo "linking std driver:" + $(V_LD) $(LDFLAGS) -o $@ $< $(LIBDIR)/$(MT_DRV).$(DED_EXT): $(OBJDIR)/$(MT_DRV).o - @echo "linking multi-threaded driver:" - $(LD) $(LDFLAGS) -o $@ $< + $(V_colon)@echo "linking multi-threaded driver:" + $(V_LD) $(LDFLAGS) -o $@ $< diff --git a/lib/mnesia/src/Makefile b/lib/mnesia/src/Makefile index 6f289433ff..53d327c11b 100644 --- a/lib/mnesia/src/Makefile +++ b/lib/mnesia/src/Makefile @@ -120,10 +120,10 @@ $(TARGET_FILES): $(HRL_FILES) # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- diff --git a/lib/observer/src/Makefile b/lib/observer/src/Makefile index 7135a6abd5..877286033e 100644 --- a/lib/observer/src/Makefile +++ b/lib/observer/src/Makefile @@ -114,10 +114,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(TARGET_FILES): $(INTERNAL_HRL_FILES) diff --git a/lib/odbc/aclocal.m4 b/lib/odbc/aclocal.m4 index 5d555a5123..918e30a886 100644 --- a/lib/odbc/aclocal.m4 +++ b/lib/odbc/aclocal.m4 @@ -1861,17 +1861,16 @@ dnl Usage example LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) dnl dnl AC_DEFUN([LM_TRY_ENABLE_CFLAG], [ - AC_MSG_CHECKING([if we can add $1 to CFLAGS]) + AC_MSG_CHECKING([if we can add $1 to $2 (via CFLAGS)]) saved_CFLAGS=$CFLAGS; - CFLAGS="$1 $CFLAGS"; + CFLAGS="$1 $$2"; AC_TRY_COMPILE([],[return 0;],can_enable_flag=true,can_enable_flag=false) CFLAGS=$saved_CFLAGS; if test "X$can_enable_flag" = "Xtrue"; then AC_MSG_RESULT([yes]) - AS_VAR_SET($2, "$1 $CFLAGS") + AS_VAR_SET($2, "$1 $$2") else AC_MSG_RESULT([no]) - AS_VAR_SET($2, "$CFLAGS") fi ]) diff --git a/lib/odbc/c_src/Makefile.in b/lib/odbc/c_src/Makefile.in index 026da39e6f..6572d28ee8 100644 --- a/lib/odbc/c_src/Makefile.in +++ b/lib/odbc/c_src/Makefile.in @@ -108,17 +108,17 @@ docs: ifdef UNIX_TARGET $(UNIX_TARGET): $(OBJ_DIR)/odbcserver.o - $(CC) $(CFLAGS) -o $@ $(OBJ_DIR)/odbcserver.o $(LDFLAGS) $(LIBS) + $(V_CC) $(CFLAGS) -o $@ $(OBJ_DIR)/odbcserver.o $(LDFLAGS) $(LIBS) endif ifdef WIN32_TARGET $(WIN32_TARGET): $(OBJ_DIR)/odbcserver.o - $(LD) $(LDFLAGS) -o $@ $(OBJ_DIR)/odbcserver.o $(ENTRY_OBJ) \ + $(V_LD) $(LDFLAGS) -o $@ $(OBJ_DIR)/odbcserver.o $(ENTRY_OBJ) \ $(LIBS) $(ENTRY_LDFLAGS) endif $(OBJ_DIR)/odbcserver.o: odbcserver.c - $(CC) $(CFLAGS) $(INCLUDES) $(TARGET_FLAGS) -o $@ -c odbcserver.c + $(V_CC) $(CFLAGS) $(INCLUDES) $(TARGET_FLAGS) -o $@ -c odbcserver.c # ---------------------------------------------------- # Release Target diff --git a/lib/odbc/src/Makefile b/lib/odbc/src/Makefile index 2af65cc757..bfbda8aaf4 100644 --- a/lib/odbc/src/Makefile +++ b/lib/odbc/src/Makefile @@ -95,9 +95,9 @@ clean: $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: diff --git a/lib/orber/COSS/CosNaming/Makefile b/lib/orber/COSS/CosNaming/Makefile index 769c08a9e9..814062034c 100644 --- a/lib/orber/COSS/CosNaming/Makefile +++ b/lib/orber/COSS/CosNaming/Makefile @@ -117,7 +117,7 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) - sed -e 's;%VSN%;$(VSN);' $(APP_SRC) > $(APP_TARGET) + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $(APP_SRC) > $(APP_TARGET) docs: @@ -125,10 +125,10 @@ docs: # Special Build Targets # ---------------------------------------------------- IDL-GENERATED: cos_naming_ext.idl cos_naming.idl - erlc $(ERL_IDL_FLAGS) +'{this,"CosNaming::NamingContext"}' \ + $(gen_verbose)erlc $(ERL_IDL_FLAGS) +'{this,"CosNaming::NamingContext"}' \ +'{this,"CosNaming::NamingContextExt"}' cos_naming_ext.idl - erlc $(ERL_IDL_FLAGS) +'{this,"CosNaming::NamingContext"}' cos_naming.idl - >IDL-GENERATED + $(V_at)erlc $(ERL_IDL_FLAGS) +'{this,"CosNaming::NamingContext"}' cos_naming.idl + $(V_at)>IDL-GENERATED $(GEN_FILES): IDL-GENERATED diff --git a/lib/orber/c_src/Makefile.in b/lib/orber/c_src/Makefile.in index 9970642a9f..126ed8af21 100644 --- a/lib/orber/c_src/Makefile.in +++ b/lib/orber/c_src/Makefile.in @@ -56,10 +56,10 @@ debug opt: $(OBJDIR) orber ifeq ($(findstring win32,$(TARGET)),win32) orber: - echo "Nothing to build on NT" + $(V_colon)echo "Nothing to build on NT" else orber: - echo "Nothing to build" + $(V_colon)echo "Nothing to build" endif clean: @@ -74,7 +74,7 @@ $(OBJDIR): -mkdir -p $(OBJDIR) $(OBJDIR)/%.o: %.c - $(CC) -c -o $@ $(ALL_CFLAGS) $< + $(V_CC) -c -o $@ $(ALL_CFLAGS) $< # ---------------------------------------------------- # Release Target diff --git a/lib/orber/examples/Stack/Makefile b/lib/orber/examples/Stack/Makefile index f1a5106a7b..1cbb983cd6 100644 --- a/lib/orber/examples/Stack/Makefile +++ b/lib/orber/examples/Stack/Makefile @@ -104,8 +104,8 @@ docs: test: $(TEST_TARGET_FILES) IDL-GENERATED: stack.idl - erlc $(ERL_IDL_FLAGS) stack.idl - >IDL-GENERATED + $(gen_verbose)erlc $(ERL_IDL_FLAGS) stack.idl + $(V_at)>IDL-GENERATED $(GEN_FILES): IDL-GENERATED diff --git a/lib/orber/src/Makefile b/lib/orber/src/Makefile index 6eb659407d..1c6781e5fd 100644 --- a/lib/orber/src/Makefile +++ b/lib/orber/src/Makefile @@ -215,10 +215,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(ORBER_VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(ORBER_VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(ORBER_VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(ORBER_VSN);' $< > $@ docs: @@ -227,17 +227,17 @@ docs: # ---------------------------------------------------- IDL-GENERATED: $(ERL_TOP)/lib/ic/include/erlang.idl CORBA.idl OrberIFR.idl - erlc $(ERL_IDL_FLAGS) $(ERL_TOP)/lib/ic/include/erlang.idl - erlc $(ERL_IDL_FLAGS) CORBA.idl - erlc $(ERL_IDL_FLAGS) +'{this,"Orber::IFR"}' OrberIFR.idl - >IDL-GENERATED + $(gen_verbose)erlc $(ERL_IDL_FLAGS) $(ERL_TOP)/lib/ic/include/erlang.idl + $(V_at)erlc $(ERL_IDL_FLAGS) CORBA.idl + $(V_at)erlc $(ERL_IDL_FLAGS) +'{this,"Orber::IFR"}' OrberIFR.idl + $(V_at)>IDL-GENERATED $(GEN_ERL_FILES): IDL-GENERATED $(TARGET_FILES): IDL-GENERATED $(GEN_ASN_ERL) $(GEN_ASN_HRL): OrberCSIv2.asn1 OrberCSIv2.set.asn - erlc $(ERL_COMPILE_FLAGS) $(ASN_FLAGS) +'{inline,"OrberCSIv2"}' OrberCSIv2.set.asn - rm -f $(GEN_ASN_ERL:%.erl=%.beam) + $(asn_verbose)erlc $(ERL_COMPILE_FLAGS) $(ASN_FLAGS) +'{inline,"OrberCSIv2"}' OrberCSIv2.set.asn + $(V_at)rm -f $(GEN_ASN_ERL:%.erl=%.beam) # erlc $(ERL_COMPILE_FLAGS) $(ASN_FLAGS) OrberCSIv2.asn1 ;\ # erlc $(GEN_ASN_ERL) diff --git a/lib/os_mon/c_src/Makefile.in b/lib/os_mon/c_src/Makefile.in index e728e43a09..51569f6ec9 100644 --- a/lib/os_mon/c_src/Makefile.in +++ b/lib/os_mon/c_src/Makefile.in @@ -93,28 +93,28 @@ docs: # ---------------------------------------------------- $(BINDIR)/win32sysinfo.exe: $(OBJDIR)/win32sysinfo.o $(ENTRY_OBJ) - $(LD) $(LDFLAGS) $(ENTRY_LDFLAGS) -o $@ $(OBJDIR)/win32sysinfo.o $(ENTRY_OBJ) + $(V_LD) $(LDFLAGS) $(ENTRY_LDFLAGS) -o $@ $(OBJDIR)/win32sysinfo.o $(ENTRY_OBJ) $(BINDIR)/nteventlog.exe: $(EVLOG_OBJECTS) - $(LD) $(LDFLAGS) $(ENTRY_LDFLAGS) -o $@ $(EVLOG_OBJECTS) $(ENTRY_OBJ) + $(V_LD) $(LDFLAGS) $(ENTRY_LDFLAGS) -o $@ $(EVLOG_OBJECTS) $(ENTRY_OBJ) $(BINDIR)/ferrule: $(OBJDIR)/ferrule.o - $(LD) $(LDFLAGS) -o $@ $< + $(V_LD) $(LDFLAGS) -o $@ $< $(BINDIR)/mod_syslog: $(OBJDIR)/mod_syslog.o - $(LD) $(LDFLAGS) -o $@ $< + $(V_LD) $(LDFLAGS) -o $@ $< $(BINDIR)/memsup: $(OBJDIR)/memsup.o - $(LD) $(LDFLAGS) -o $@ $< + $(V_LD) $(LDFLAGS) -o $@ $< $(BINDIR)/cpu_sup: $(OBJDIR)/cpu_sup.o - $(LD) $(LDFLAGS) -o $@ $< $(CPU_SUP_LIBS) + $(V_LD) $(LDFLAGS) -o $@ $< $(CPU_SUP_LIBS) $(OBJDIR)/%.o: %.c - $(CC) -c -o $@ $(ALL_CFLAGS) $< + $(V_CC) -c -o $@ $(ALL_CFLAGS) $< $(OBJDIR)/%.o: nteventlog/%.c - $(CC) -c -o $@ $(ALL_CFLAGS) $< + $(V_CC) -c -o $@ $(ALL_CFLAGS) $< $(OBJDIR)/memsup.o: memsup.h diff --git a/lib/os_mon/mibs/Makefile b/lib/os_mon/mibs/Makefile index 3e24c3d373..19f3dc8367 100644 --- a/lib/os_mon/mibs/Makefile +++ b/lib/os_mon/mibs/Makefile @@ -67,16 +67,16 @@ OTP_MIBDIR = $(shell if test -d ../../otp_mibs; then echo otp_mibs; \ else echo sasl; fi) $(SNMP_BIN_TARGET_DIR)/OTP-REG.bin: $(ERL_TOP)/lib/$(OTP_MIBDIR)/mibs/OTP-REG.mib - $(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) -o $(SNMP_BIN_TARGET_DIR) $< + $(snmp_verbose)$(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) -o $(SNMP_BIN_TARGET_DIR) $< $(SNMP_BIN_TARGET_DIR)/OTP-TC.bin: $(ERL_TOP)/lib/$(OTP_MIBDIR)/mibs/OTP-TC.mib - $(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) -o $(SNMP_BIN_TARGET_DIR) $< + $(snmp_verbose)$(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) -o $(SNMP_BIN_TARGET_DIR) $< $(SNMP_BIN_TARGET_DIR)/OTP-MIB.bin: $(ERL_TOP)/lib/$(OTP_MIBDIR)/mibs/OTP-MIB.mib - $(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) -o $(SNMP_BIN_TARGET_DIR) $< + $(snmp_verbose)$(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) -o $(SNMP_BIN_TARGET_DIR) $< v1/%.mib.v1: %.mib - $(ERL_TOP)/lib/snmp/bin/snmp-v2tov1 -o $@ $< + $(gen_verbose)$(ERL_TOP)/lib/snmp/bin/snmp-v2tov1 -o $@ $< $(SNMP_BIN_TARGET_DIR)/OTP-OS-MON-MIB.bin: \ $(SNMP_BIN_TARGET_DIR)/OTP-REG.bin \ diff --git a/lib/os_mon/src/Makefile b/lib/os_mon/src/Makefile index 864d7a09d4..9fc888e552 100644 --- a/lib/os_mon/src/Makefile +++ b/lib/os_mon/src/Makefile @@ -78,10 +78,10 @@ docs: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ #------------------------------------------------------- # Special dependencies diff --git a/lib/otp_mibs/mibs/Makefile b/lib/otp_mibs/mibs/Makefile index 703c4b3ed4..7f43ef31a6 100644 --- a/lib/otp_mibs/mibs/Makefile +++ b/lib/otp_mibs/mibs/Makefile @@ -68,7 +68,7 @@ docs: # ---------------------------------------------------- v1/%.mib.v1: %.mib - $(ERL_TOP)/lib/snmp/bin/snmp-v2tov1 -o $@ $< + $(gen_verbose)$(ERL_TOP)/lib/snmp/bin/snmp-v2tov1 -o $@ $< # ---------------------------------------------------- # Release Target diff --git a/lib/otp_mibs/src/Makefile b/lib/otp_mibs/src/Makefile index 03298d39d5..4f03d0228a 100644 --- a/lib/otp_mibs/src/Makefile +++ b/lib/otp_mibs/src/Makefile @@ -84,10 +84,10 @@ docs: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/parsetools/src/Makefile b/lib/parsetools/src/Makefile index 4f199da8ee..7b63475231 100644 --- a/lib/parsetools/src/Makefile +++ b/lib/parsetools/src/Makefile @@ -78,10 +78,10 @@ docs: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/percept/src/Makefile b/lib/percept/src/Makefile index 253a8c2da3..6bf0af9dc6 100644 --- a/lib/percept/src/Makefile +++ b/lib/percept/src/Makefile @@ -80,10 +80,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: diff --git a/lib/pman/src/Makefile b/lib/pman/src/Makefile index fa01fe7238..eb0413bdbc 100644 --- a/lib/pman/src/Makefile +++ b/lib/pman/src/Makefile @@ -85,10 +85,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: diff --git a/lib/public_key/asn1/Makefile b/lib/public_key/asn1/Makefile index 763b788e53..f765906b3b 100644 --- a/lib/public_key/asn1/Makefile +++ b/lib/public_key/asn1/Makefile @@ -81,10 +81,10 @@ clean: docs: %.erl %.hrl: %.set.asn - erlc $(ASN_FLAGS) $< + $(asn_verbose)erlc $(ASN_FLAGS) $< $(INCLUDE)/%.hrl: %.hrl - cp -p $< $@ + $(gen_verbose)cp -p $< $@ # ---------------------------------------------------- # Release Target @@ -119,6 +119,6 @@ OTP-PUB-KEY.asn1db: PKIX1Algorithms88.asn1 \ OTP-PKIX.asn1 $(EBIN)/PKCS-FRAME.beam: PKCS-FRAME.erl PKCS-FRAME.hrl -PKCS-FRAME.erl PKCS-FRAME.hrl: PKCS-FRAME.asn1db +PKCS-FRAME.erl PKCS-FRAME.hrl: PKCS-FRAME.asn1db PKCS-FRAME.asn1db: PKCS5v2-0.asn1\ PKCS-8.asn1\ diff --git a/lib/public_key/src/Makefile b/lib/public_key/src/Makefile index d24122221a..b8ad68ecc7 100644 --- a/lib/public_key/src/Makefile +++ b/lib/public_key/src/Makefile @@ -92,10 +92,10 @@ clean: docs: $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/reltool/src/Makefile b/lib/reltool/src/Makefile index a7e34053f1..74918f1d67 100644 --- a/lib/reltool/src/Makefile +++ b/lib/reltool/src/Makefile @@ -79,10 +79,10 @@ docs: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Dependencies diff --git a/lib/runtime_tools/c_src/Makefile.in b/lib/runtime_tools/c_src/Makefile.in index 586f649924..d315a90e18 100644 --- a/lib/runtime_tools/c_src/Makefile.in +++ b/lib/runtime_tools/c_src/Makefile.in @@ -111,11 +111,11 @@ debug opt valgrind: $(SOLIBS) $(OBJDIR) $(LIBDIR) $(NIF_LIB) ifdef DTRACE_ENABLED DTRACE_USER_HEADER=$(OBJDIR)/dtrace_user.h $(OBJDIR)/dtrace_user.h: ./dtrace_user.d - dtrace -h -C $(INCLUDES) \ + $(dtrace_verbose)dtrace -h -C $(INCLUDES) \ -s ./dtrace_user.d \ -o ./dtrace_user.tmp - sed -e '/^#define[ ]*ERLANG_[A-Z0-9_]*(.*)/y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' ./dtrace_user.tmp > $@ - rm ./dtrace_user.tmp + $(V_at)sed -e '/^#define[ ]*ERLANG_[A-Z0-9_]*(.*)/y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' ./dtrace_user.tmp > $@ + $(V_at)rm ./dtrace_user.tmp else DTRACE_USER_HEADER= endif @@ -124,7 +124,7 @@ DTRACE_OBJS = ifdef DTRACE_ENABLED_2STEP DTRACE_OBJS += $(OBJDIR)/dtrace_user.o $(OBJDIR)/dtrace_user.o: $(before_DTrace_OBJS) $(OBJDIR)/dtrace_user.h - dtrace -G -C \ + $(dtrace_verbose)dtrace -G -C \ -s ./dtrace_user.d \ -o $@ $(before_DTrace_OBJS) endif @@ -138,26 +138,26 @@ $(LIBDIR): -@mkdir -p $(LIBDIR) $(OBJDIR)/dyntrace$(TYPEMARKER).o: dyntrace.c $(DTRACE_USER_HEADER) - $(INSTALL_DIR) $(OBJDIR) - $(CC) -c -o $@ $(ALL_CFLAGS) $< + $(V_at)$(INSTALL_DIR) $(OBJDIR) + $(V_CC) -c -o $@ $(ALL_CFLAGS) $< $(NIF_LIB): $(DYNTRACE_OBJS) - $(INSTALL_DIR) $(LIBDIR) - $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) + $(V_at)$(INSTALL_DIR) $(LIBDIR) + $(V_LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(OBJDIR)/%.o: %.c - $(CC) -c -o $@ $(ALL_CFLAGS) $< + $(V_CC) -c -o $@ $(ALL_CFLAGS) $< $(LIBDIR)/trace_ip_drv.so: $(TRACE_IP_DRV_OBJS) - $(LD) $(LDFLAGS) -o $@ $^ -lc $(LIBS) + $(V_LD) $(LDFLAGS) -o $@ $^ -lc $(LIBS) $(LIBDIR)/trace_file_drv.so: $(TRACE_FILE_DRV_OBJS) - $(LD) $(LDFLAGS) -o $@ $^ -lc $(LIBS) + $(V_LD) $(LDFLAGS) -o $@ $^ -lc $(LIBS) $(LIBDIR)/trace_ip_drv.dll: $(TRACE_IP_DRV_OBJS) - $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) + $(V_LD) $(LDFLAGS) -o $@ $^ $(LIBS) $(LIBDIR)/trace_file_drv.dll: $(TRACE_FILE_DRV_OBJS) - $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) + $(V_LD) $(LDFLAGS) -o $@ $^ $(LIBS) clean: rm -f $(SOLIBS) $(TRACE_IP_DRV_OBJS) $(TRACE_FILE_DRV_OBJS) diff --git a/lib/runtime_tools/src/Makefile b/lib/runtime_tools/src/Makefile index 4ca37ab0bf..53b9ce34e4 100644 --- a/lib/runtime_tools/src/Makefile +++ b/lib/runtime_tools/src/Makefile @@ -81,10 +81,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: diff --git a/lib/sasl/src/Makefile b/lib/sasl/src/Makefile index de0c45e6ae..c1ad8ca0bb 100644 --- a/lib/sasl/src/Makefile +++ b/lib/sasl/src/Makefile @@ -80,10 +80,10 @@ docs: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/snmp/doc/src/Makefile b/lib/snmp/doc/src/Makefile index 8820565124..6e55498669 100644 --- a/lib/snmp/doc/src/Makefile +++ b/lib/snmp/doc/src/Makefile @@ -118,7 +118,7 @@ clean clean_docs: clean_html clean_man clean_pdf rm -f errs core *~ $(INDEX_TARGET): $(INDEX_SRC) ../../vsn.mk # Create top make file - sed -e 's;%VSN%;$(VSN);' $< > $@ # inserting version number + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # inserting version number man: man1 man3 man6 man7 diff --git a/lib/snmp/mibs/Makefile.in b/lib/snmp/mibs/Makefile.in index 5c1f855fad..e7ca540cc6 100644 --- a/lib/snmp/mibs/Makefile.in +++ b/lib/snmp/mibs/Makefile.in @@ -141,11 +141,11 @@ OTP_MIBDIR = $(shell if test -d ../../otp_mibs; then echo otp_mibs; \ debug opt: $(TARGET_FILES) $(ERL_TOP)/lib/snmp/bin/snmp-v2tov1: $(ERL_TOP)/lib/snmp/bin/snmp-v2tov1.src - $(PERL) -p -e 's?%PERL%?$(PERL)? ' < $< > $@ - chmod 755 $@ + $(gen_verbose)$(PERL) -p -e 's?%PERL%?$(PERL)? ' < $< > $@ + $(V_at)chmod 755 $@ $(SNMP_BIN_TARGET_DIR)/OTP-REG.bin: $(ERL_TOP)/lib/$(OTP_MIBDIR)/mibs/OTP-REG.mib - $(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) -o $(SNMP_BIN_TARGET_DIR) $< + $(snmp_verbose)$(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) -o $(SNMP_BIN_TARGET_DIR) $< # To support parallel make, we'll need explicit dependencies # to ensure that an imported MIB has been compiled when it's needed. @@ -214,7 +214,7 @@ info: @echo "RELSYSDIR = "$(RELSYSDIR)"" v1/%.mib.v1: %.mib $(ERL_TOP)/lib/snmp/bin/snmp-v2tov1 - $(ERL_TOP)/lib/snmp/bin/snmp-v2tov1 -o $@ $< + $(gen_verbose)$(ERL_TOP)/lib/snmp/bin/snmp-v2tov1 -o $@ $< # ---------------------------------------------------- diff --git a/lib/snmp/src/app/Makefile b/lib/snmp/src/app/Makefile index f7c311b663..716add8b9e 100644 --- a/lib/snmp/src/app/Makefile +++ b/lib/snmp/src/app/Makefile @@ -116,10 +116,10 @@ info: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/snmp/src/compile/depend.mk b/lib/snmp/src/compile/depend.mk index 3ee8dc4bec..e6ba1ac810 100644 --- a/lib/snmp/src/compile/depend.mk +++ b/lib/snmp/src/compile/depend.mk @@ -45,5 +45,5 @@ $(EBIN)/snmpc_mib_gram.$(EMULATOR): \ snmpc_mib_gram.erl $(BIN)/snmpc: snmpc.src ../../vsn.mk - $(PERL) -p -e 's?%VSN%?$(VSN)? ' < $< > $@ - chmod 755 $@ + $(vsn_verbose)$(PERL) -p -e 's?%VSN%?$(VSN)? ' < $< > $@ + $(V_at)chmod 755 $@ diff --git a/lib/ssh/src/Makefile b/lib/ssh/src/Makefile index 323f0af191..27e43a88ed 100644 --- a/lib/ssh/src/Makefile +++ b/lib/ssh/src/Makefile @@ -120,10 +120,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: diff --git a/lib/ssl/src/Makefile b/lib/ssl/src/Makefile index 6be8a1456e..043645be41 100644 --- a/lib/ssl/src/Makefile +++ b/lib/ssl/src/Makefile @@ -108,10 +108,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: diff --git a/lib/stdlib/src/Makefile b/lib/stdlib/src/Makefile index 575a5cbe4a..2bab46b72a 100644 --- a/lib/stdlib/src/Makefile +++ b/lib/stdlib/src/Makefile @@ -175,24 +175,25 @@ primary_bootstrap_compiler: \ $(BOOTSTRAP_COMPILER)/ebin/otp_internal.beam $(BOOTSTRAP_COMPILER)/ebin/erl_parse.beam: erl_parse.yrl - $(ERLC) -o $(BOOTSTRAP_COMPILER)/egen erl_parse.yrl - $(ERLC) -o $(BOOTSTRAP_COMPILER)/ebin $(BOOTSTRAP_COMPILER)/egen/erl_parse.erl + $(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 $(BOOTSTRAP_TOP)/lib/stdlib/egen/erl_parse.erl: erl_parse.yrl - $(ERLC) $(YRL_FLAGS) -o$(BOOTSTRAP_TOP)/lib/stdlib/egen erl_parse.yrl + $(yecc_verbose)$(ERLC) $(YRL_FLAGS) -o$(BOOTSTRAP_TOP)/lib/stdlib/egen erl_parse.yrl $(BOOTSTRAP_COMPILER)/ebin/%.beam: %.erl - $(ERLC) -o $(BOOTSTRAP_COMPILER)/ebin $< + $(V_ERLC) -o $(BOOTSTRAP_COMPILER)/ebin $< # ---------------------------------------------------- # Special Build Targets # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl index d24e2fff44..9a01e85006 100644 --- a/lib/stdlib/src/erl_lint.erl +++ b/lib/stdlib/src/erl_lint.erl @@ -94,7 +94,6 @@ value_option(Flag, Default, On, OnVal, Off, OffVal, Opts) -> %% the other function collections contain {Function, Arity}. -record(lint, {state=start :: 'start' | 'attribute' | 'function', module=[], %Module - extends=[], %Extends behaviour=[], %Behaviour exports=gb_sets:empty() :: gb_set(), %Exports imports=[], %Imports @@ -112,7 +111,6 @@ value_option(Flag, Default, On, OnVal, Off, OffVal, Opts) -> enabled_warnings=[], %All enabled warnings (ordset). errors=[], %Current errors warnings=[], %Current warnings - global_vt=[], %The global VarTable file = "" :: string(), %From last file attribute recdef_top=false :: boolean(), %true in record initialisation %outside any fun or lc @@ -142,10 +140,8 @@ format_error({bad_module_name, M}) -> io_lib:format("bad module name '~s'", [M]); format_error(redefine_module) -> "redefining module"; -format_error(redefine_extends) -> - "redefining extends attribute"; -format_error(extends_self) -> - "cannot extend from self"; +format_error(pmod_unsupported) -> + "parameterized modules are no longer supported"; %% format_error({redefine_mod_import, M, P}) -> %% io_lib:format("module '~s' already imported from package '~s'", [M, P]); @@ -166,10 +162,6 @@ format_error({bad_inline,{F,A}}) -> io_lib:format("inlined function ~w/~w undefined", [F,A]); format_error({invalid_deprecated,D}) -> io_lib:format("badly formed deprecated attribute ~w", [D]); -format_error(invalid_extends) -> - "badly formed extends attribute"; -format_error(define_instance) -> - "defining instance function not allowed in abstract module"; format_error({bad_deprecated,{F,A}}) -> io_lib:format("deprecated function ~w/~w undefined or not exported", [F,A]); format_error({bad_nowarn_unused_function,{F,A}}) -> @@ -622,8 +614,6 @@ forms(Forms0, St0) -> pre_scan([{function,_L,new,_A,_Cs} | Fs], St) -> pre_scan(Fs, St#lint{new=true}); -pre_scan([{attribute,_L,extends,M} | Fs], St) when is_atom(M) -> - pre_scan(Fs, St#lint{extends=true}); pre_scan([{attribute,L,compile,C} | Fs], St) -> case is_warn_enabled(export_all, St) andalso member(export_all, lists:flatten([C])) of @@ -678,41 +668,15 @@ form(Form, #lint{state=State}=St) -> %% start_state(Form, State) -> State' -start_state({attribute,_,module,{M,Ps}}, St0) -> - St1 = St0#lint{module=M}, - Arity = length(Ps), - Ps1 = if is_atom(St1#lint.extends) -> - ['BASE', 'THIS' | Ps]; - true -> - ['THIS' | Ps] - end, - Vt = orddict:from_list([{V, {bound, used, []}} || V <- Ps1]), - St2 = add_instance(Arity, St1), - St3 = ensure_new(Arity, St2), - St3#lint{state=attribute, extends=[], global_vt=Vt}; +start_state({attribute,Line,module,{_,_}}=Form, St0) -> + St1 = add_error(Line, pmod_unsupported, St0), + attribute_state(Form, St1#lint{state=attribute}); start_state({attribute,_,module,M}, St0) -> St1 = St0#lint{module=M}, - St1#lint{state=attribute, extends=[]}; + St1#lint{state=attribute}; start_state(Form, St) -> St1 = add_error(element(2, Form), undefined_module, St), - attribute_state(Form, St1#lint{state=attribute, extends=[]}). - -ensure_new(Arity, St) -> - case St#lint.new of - true -> - St; - false -> - add_func(new, Arity, St) - end. - -add_instance(Arity, St) -> - A = Arity + (if is_atom(St#lint.extends) -> 1; true -> 0 end), - add_func(instance, A, St). - -add_func(Name, Arity, St) -> - F = {Name, Arity}, - St#lint{exports = gb_sets:add_element(F, St#lint.exports), - defined = gb_sets:add_element(F, St#lint.defined)}. + attribute_state(Form, St1#lint{state=attribute}). %% attribute_state(Form, State) -> %% State' @@ -721,15 +685,6 @@ attribute_state({attribute,_L,module,_M}, #lint{module=[]}=St) -> St; attribute_state({attribute,L,module,_M}, St) -> add_error(L, redefine_module, St); -attribute_state({attribute,L,extends,M}, #lint{module=M}=St) when is_atom(M) -> - add_error(L, extends_self, St); -attribute_state({attribute,_L,extends,M}, #lint{extends=[]}=St) - when is_atom(M) -> - St#lint{extends=M}; -attribute_state({attribute,L,extends,M}, St) when is_atom(M) -> - add_error(L, redefine_extends, St); -attribute_state({attribute,L,extends,_M}, St) -> - add_error(L, invalid_extends, St); attribute_state({attribute,L,export,Es}, St) -> export(L, Es, St); attribute_state({attribute,L,export_type,Es}, St) -> @@ -1322,11 +1277,9 @@ call_function(Line, F, A, #lint{usage=Usage0,called=Cd,func=Func}=St) -> %% function(Line, Name, Arity, Clauses, State) -> State. -function(Line, instance, _Arity, _Cs, St) when St#lint.global_vt =/= [] -> - add_error(Line, define_instance, St); function(Line, Name, Arity, Cs, St0) -> St1 = define_function(Line, Name, Arity, St0#lint{func={Name,Arity}}), - clauses(Cs, St1#lint.global_vt, St1). + clauses(Cs, St1). -spec define_function(line(), atom(), arity(), lint_state()) -> lint_state(). @@ -1349,15 +1302,16 @@ function_check_max_args(Line, Arity, St) when Arity > ?MAX_ARGUMENTS -> add_error(Line, {too_many_arguments,Arity}, St); function_check_max_args(_, _, St) -> St. -%% clauses([Clause], VarTable, State) -> {VarTable, State}. +%% clauses([Clause], State) -> {VarTable, State}. -clauses(Cs, Vt, St) -> +clauses(Cs, St) -> foldl(fun (C, St0) -> - {_,St1} = clause(C, Vt, St0), + {_,St1} = clause(C, St0), St1 end, St, Cs). -clause({clause,_Line,H,G,B}, Vt0, St0) -> +clause({clause,_Line,H,G,B}, St0) -> + Vt0 = [], {Hvt,Binvt,St1} = head(H, Vt0, St0), %% Cannot ignore BinVt since "binsize variables" may have been used. Vt1 = vtupdate(Hvt, vtupdate(Binvt, Vt0)), diff --git a/lib/stdlib/test/Makefile b/lib/stdlib/test/Makefile index 29b8e28d3a..6aa09d7bd0 100644 --- a/lib/stdlib/test/Makefile +++ b/lib/stdlib/test/Makefile @@ -23,7 +23,6 @@ MODULES= \ dummy_via \ edlin_expand_SUITE \ epp_SUITE \ - erl_eval_helper \ erl_eval_SUITE \ erl_expand_records_SUITE \ erl_internal_SUITE \ diff --git a/lib/stdlib/test/erl_eval_SUITE.erl b/lib/stdlib/test/erl_eval_SUITE.erl index 47792d1052..04d49770cb 100644 --- a/lib/stdlib/test/erl_eval_SUITE.erl +++ b/lib/stdlib/test/erl_eval_SUITE.erl @@ -1160,24 +1160,6 @@ do_funs(LFH, EFH) -> concat(["begin F = fun(F, N) -> [", M, ":count_down(F,N) || X <-[1]] end, F(F,2) end."]), [[[0]]], ['F'], LFH, EFH), - - %% Tests for a bug found by the Dialyzer - used to crash. - case test_server:is_native(erl_eval) of - true -> - %% Parameterized modules are not supported by HiPE. - ok; - false -> - check(fun() -> Pmod = erl_eval_helper:new(42), Pmod:add(5) end, - "begin Pmod = erl_eval_helper:new(42), Pmod:add(5) end.", - 47, - ['Pmod'], LFH, EFH), - check(fun() -> Pmod = erl_eval_helper:new(42), - B = Pmod:add(7), B end, - "begin Pmod = erl_eval_helper:new(42), " - "B = Pmod:add(7), B end.", - 49, - ['B','Pmod'], LFH, EFH) - end, ok. count_down(F, N) when N > 0 -> diff --git a/lib/stdlib/test/erl_eval_helper.erl b/lib/stdlib/test/erl_eval_helper.erl deleted file mode 100644 index 6863b40108..0000000000 --- a/lib/stdlib/test/erl_eval_helper.erl +++ /dev/null @@ -1,28 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2005-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(erl_eval_helper, [Base]). - --export([add/1]). - -add(Arg) -> - Base+Arg. - - - diff --git a/lib/stdlib/test/erl_expand_records_SUITE.erl b/lib/stdlib/test/erl_expand_records_SUITE.erl index e51c05a22c..94b4397a9c 100644 --- a/lib/stdlib/test/erl_expand_records_SUITE.erl +++ b/lib/stdlib/test/erl_expand_records_SUITE.erl @@ -35,7 +35,7 @@ init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). --export([abstract_module/1, attributes/1, expr/1, guard/1, +-export([attributes/1, expr/1, guard/1, init/1, pattern/1, strict/1, update/1, otp_5915/1, otp_7931/1, otp_5990/1, otp_7078/1, otp_7101/1]). @@ -55,7 +55,7 @@ end_per_testcase(_Case, _Config) -> suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> - [abstract_module, attributes, expr, guard, init, + [attributes, expr, guard, init, pattern, strict, update, {group, tickets}]. groups() -> @@ -75,33 +75,6 @@ end_per_group(_GroupName, Config) -> Config. -abstract_module(doc) -> - "Compile an abstract module."; -abstract_module(suite) -> []; -abstract_module(Config) when is_list(Config) -> - %% erl_expand_records does not handle abstract modules. But anyway... - File = filename("param.erl", Config), - Beam = filename("param.beam", Config), - Test = <<"-module(param, [A, B]). - - -export([args/1]). - - args(C) -> - X = local(C), - Z = new(A, B), - {X, Z}. - - local(C) -> - module_info(C). - ">>, - - ?line ok = file:write_file(File, Test), - ?line {ok, param} = compile:file(File, [{outdir,?privdir}]), - - ?line ok = file:delete(File), - ?line ok = file:delete(Beam), - ok. - attributes(doc) -> "Import module and functions."; attributes(suite) -> []; @@ -196,7 +169,7 @@ guard(suite) -> []; guard(Config) when is_list(Config) -> File = filename("guard.erl", Config), Beam = filename("guard.beam", Config), - Test = <<"-module(guard, [A, B]). + Test = <<"-module(guard). -export([t/1]). diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index 774229fca9..564f27a512 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -2187,27 +2187,9 @@ otp_5878(Config) when is_list(Config) -> ?line [] = run(Config, Ts), Abstr = <<"-module(lint_test, [A, B]). - - -export([args/1]). - - -record(r, {a = A, b = THIS}). % A and THIS are unbound - - %% param:args(compile,param:new(1,2)). - - args(C) -> - X = local(C), - Z = new(A, B), - F = fun(THIS) -> {x, A} end, % THIS unused and shadowed - {X, Z, THIS, F, #r{}}. - - local(C) -> - module_info(C). ">>, - ?line {error,[{5,erl_lint,{unbound_var,'A'}}, - {5,erl_lint,{unbound_var,'THIS'}}], - [{12,erl_lint,{unused_var,'THIS'}}, - {12,erl_lint,{shadowed_var,'THIS','fun'}}]} - = run_test2(Config, Abstr, [warn_unused_record]), + {errors,[{1,erl_lint,pmod_unsupported}],[]} = + run_test2(Config, Abstr, [warn_unused_record]), QLC1 = <<"-module(lint_test). -include_lib(\"stdlib/include/qlc.hrl\"). diff --git a/lib/stdlib/test/escript_SUITE.erl b/lib/stdlib/test/escript_SUITE.erl index 7634c21a17..3749d594f2 100644 --- a/lib/stdlib/test/escript_SUITE.erl +++ b/lib/stdlib/test/escript_SUITE.erl @@ -26,6 +26,7 @@ errors/1, strange_name/1, emulator_flags/1, + emulator_flags_no_shebang/1, module_script/1, beam_script/1, archive_script/1, @@ -45,6 +46,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, errors, strange_name, emulator_flags, + emulator_flags_no_shebang, module_script, beam_script, archive_script, epp, create_and_extract, foldl, overflow, archive_script_file_access, unicode]. @@ -150,6 +152,21 @@ emulator_flags(Config) when is_list(Config) -> ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +emulator_flags_no_shebang(Config) when is_list(Config) -> + Data = ?config(data_dir, Config), + Dir = filename:absname(Data), %Get rid of trailing slash. + %% Need run_with_opts, to always use "escript" explicitly + ?line run_with_opts(Dir, "", "emulator_flags_no_shebang -arg1 arg2 arg3", + [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n" + "nostick:[{nostick,[]}]\n" + "mnesia:[{mnesia,[\"dir\",\"a/directory\"]},{mnesia,[\"debug\",\"verbose\"]}]\n" + "ERL_FLAGS=false\n" + "unknown:[]\n" + "ExitCode:0">>]), + ok. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Pick the source code from the emulator_flags script %% Generate a new escript with a module header diff --git a/lib/stdlib/test/escript_SUITE_data/emulator_flags_no_shebang b/lib/stdlib/test/escript_SUITE_data/emulator_flags_no_shebang new file mode 100644 index 0000000000..47d843ebe1 --- /dev/null +++ b/lib/stdlib/test/escript_SUITE_data/emulator_flags_no_shebang @@ -0,0 +1,10 @@ +%% -*- erlang -*- +%%! -nostick -mnesia dir a/directory -mnesia debug verbose + +main(MainArgs) -> + io:format("main:~p\n",[MainArgs]), + ErlArgs = init:get_arguments(), + io:format("nostick:~p\n",[[E || E <- ErlArgs, element(1, E) =:= nostick]]), + io:format("mnesia:~p\n", [[E || E <- ErlArgs, element(1, E) =:= mnesia]]), + io:format("ERL_FLAGS=~p\n", [os:getenv("ERL_FLAGS")]), + io:format("unknown:~p\n",[[E || E <- ErlArgs, element(1, E) =:= unknown]]). diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl index a32f846bd2..f22df96697 100644 --- a/lib/stdlib/test/shell_SUITE.erl +++ b/lib/stdlib/test/shell_SUITE.erl @@ -28,7 +28,7 @@ refman_bit_syntax/1, progex_bit_syntax/1, progex_records/1, progex_lc/1, progex_funs/1, - otp_5990/1, otp_6166/1, otp_6554/1, otp_6785/1, + otp_5990/1, otp_6166/1, otp_6554/1, otp_7184/1, otp_7232/1, otp_8393/1, otp_10302/1]). -export([ start_restricted_from_shell/1, @@ -92,7 +92,7 @@ groups() -> [progex_bit_syntax, progex_records, progex_lc, progex_funs]}, {tickets, [], - [otp_5990, otp_6166, otp_6554, otp_6785, otp_7184, + [otp_5990, otp_6166, otp_6554, otp_7184, otp_7232, otp_8393, otp_10302]}]. init_per_suite(Config) -> @@ -2543,19 +2543,6 @@ otp_6554(Config) when is_list(Config) -> ok. -otp_6785(doc) -> - "OTP-6785. Parameterized modules."; -otp_6785(suite) -> []; -otp_6785(Config) when is_list(Config) -> - MFile = filename:join(?config(priv_dir, Config), "parameterized.erl"), - Contents = <<"-module(parameterized, [A]). " - "-export([test/0]). " - "test() -> A. ">>, - ?line ok = compile_file(Config, MFile, Contents, []), - ?line (parameterized:new(adsf)):test(), - file:delete(MFile), - ok. - otp_7184(doc) -> "OTP-7184. Propagate exit signals from dying evaluator process."; otp_7184(suite) -> []; diff --git a/lib/syntax_tools/src/Makefile b/lib/syntax_tools/src/Makefile index dca5e78be9..2aa6591c77 100644 --- a/lib/syntax_tools/src/Makefile +++ b/lib/syntax_tools/src/Makefile @@ -62,17 +62,17 @@ distclean: clean realclean: clean $(EBIN)/%.$(EMULATOR):%.erl - erlc -W $(ERL_COMPILE_FLAGS) -o$(EBIN) $< + $(erlc_verbose)erlc -W $(ERL_COMPILE_FLAGS) -o$(EBIN) $< # ---------------------------------------------------- # Special Build Targets # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/test_server/src/Makefile b/lib/test_server/src/Makefile index 3261936472..43a03f4e1d 100644 --- a/lib/test_server/src/Makefile +++ b/lib/test_server/src/Makefile @@ -112,10 +112,10 @@ configure: configure.in # Special Build Targets # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/toolbar/src/Makefile b/lib/toolbar/src/Makefile index 102970a59a..a24846976b 100644 --- a/lib/toolbar/src/Makefile +++ b/lib/toolbar/src/Makefile @@ -71,10 +71,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: diff --git a/lib/tools/c_src/Makefile.in b/lib/tools/c_src/Makefile.in index 0382d3228d..aea5686ae9 100644 --- a/lib/tools/c_src/Makefile.in +++ b/lib/tools/c_src/Makefile.in @@ -17,6 +17,7 @@ # %CopyrightEnd% # +include $(ERL_TOP)/make/output.mk include $(ERL_TOP)/make/target.mk include $(ERL_TOP)/erts/include/internal/$(TARGET)/ethread.mk @@ -150,7 +151,7 @@ _create_dirs := $(shell mkdir -p $(CREATE_DIRS)) all: $(PROGS) $(DRIVERS) $(ERTS_LIB): - cd $(ERL_TOP)/erts/lib_src && $(MAKE) $(TYPE) + $(make_verbose)cd $(ERL_TOP)/erts/lib_src && $(MAKE) $(TYPE) docs: @@ -167,7 +168,7 @@ clean: # $(EMEM_OBJ_DIR)/%.o: %.c - $(CC) $(EMEM_CFLAGS) -o $@ -c $< + $(V_CC) $(EMEM_CFLAGS) -o $@ -c $< # # Driver targets @@ -178,7 +179,7 @@ $(EMEM_OBJ_DIR)/%.o: %.c # $(BIN_DIR)/emem$(TYPEMARKER)@EXEEXT@: $(EMEM_OBJS) $(ERTS_LIB) - $(PRE_LD) $(LD) $(EMEM_LDFLAGS) -o $@ $(EMEM_OBJS) $(EMEM_LIBS) + $(ld_verbose)$(PRE_LD) $(LD) $(EMEM_LDFLAGS) -o $@ $(EMEM_OBJS) $(EMEM_LIBS) # # Release targets @@ -221,7 +222,8 @@ SED_DEPEND=sed '$(SED_REPL_OBJ_DIR);$(SED_REPL_TT_DIR);$(SED_REPL_TARGET);$(SED_ DEPEND_MK=depend.mk dep depend: - @echo "Generating dependency file $(DEPEND_MK)..." + [ $(v_p) == 0 ] && echo " GEN "$(DEPEND_MK) + $(V_colon)@echo "Generating dependency file $(DEPEND_MK)..." @echo "# Generated dependency rules." > $(DEPEND_MK); @echo "# Do *not* edit this file; instead, run 'make depend'." \ >> $(DEPEND_MK); diff --git a/lib/tools/src/Makefile b/lib/tools/src/Makefile index abe1389771..bdd0cdce25 100644 --- a/lib/tools/src/Makefile +++ b/lib/tools/src/Makefile @@ -94,10 +94,10 @@ docs: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/tools/test/cprof_SUITE.erl b/lib/tools/test/cprof_SUITE.erl index ce5cf66a14..93caee0c8f 100644 --- a/lib/tools/test/cprof_SUITE.erl +++ b/lib/tools/test/cprof_SUITE.erl @@ -230,10 +230,10 @@ on_load_test(Config) -> %% ?line N4 = cprof:restart(), ?line {ok,Module} = c:c(File, [{outdir,Priv}]), - ?line L = Module:seq(1, M, fun succ/1), - ?line Lr = Module:seq_r(1, M, fun succ/1), - ?line L = seq(1, M, fun succ/1), - ?line Lr = seq_r(1, M, fun succ/1), + ?line L = Module:seq(1, M, fun (I) -> succ(I) end), + ?line Lr = Module:seq_r(1, M, fun (I) -> succ(I) end), + ?line L = seq(1, M, fun (I) -> succ(I) end), + ?line Lr = seq_r(1, M, fun (I) -> succ(I) end), ?line N2 = cprof:pause(), ?line {Module,0,[]} = cprof:analyse(Module), ?line M_1 = M - 1, @@ -265,10 +265,10 @@ modules_test(Config) -> ?line M2__1 = M2 + 1, ?line erlang:yield(), ?line N = cprof:start(), - ?line L = Module:seq(1, M, fun succ/1), - ?line Lr = Module:seq_r(1, M, fun succ/1), - ?line L = seq(1, M, fun succ/1), - ?line Lr = seq_r(1, M, fun succ/1), + ?line L = Module:seq(1, M, fun (I) -> succ(I) end), + ?line Lr = Module:seq_r(1, M, fun (I) -> succ(I) end), + ?line L = seq(1, M, fun (I) -> succ(I) end), + ?line Lr = seq_r(1, M, fun (I) -> succ(I) end), ?line N = cprof:pause(), ?line Lr = lists:reverse(L), ?line M_1 = M - 1, diff --git a/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl index cf49526156..dc06678b8e 100644 --- a/lib/tools/test/xref_SUITE.erl +++ b/lib/tools/test/xref_SUITE.erl @@ -47,7 +47,7 @@ -export([ add/1, default/1, info/1, lib/1, read/1, read2/1, remove/1, replace/1, update/1, deprecated/1, trycatch/1, - abstract_modules/1, fun_mfa/1, fun_mfa_r14/1, + fun_mfa/1, fun_mfa_r14/1, fun_mfa_vars/1, qlc/1]). -export([ @@ -83,7 +83,7 @@ groups() -> modules]}, {files, [], [add, default, info, lib, read, read2, remove, replace, - update, deprecated, trycatch, abstract_modules, fun_mfa, + update, deprecated, trycatch, fun_mfa, fun_mfa_r14, fun_mfa_vars, qlc]}, {analyses, [], [analyze, basic, md, q, variables, unused_locals]}, @@ -1669,64 +1669,6 @@ trycatch(Conf) when is_list(Conf) -> ok. -abstract_modules(suite) -> []; -abstract_modules(doc) -> ["OTP-5520: Abstract (parameterized) modules."]; -abstract_modules(Conf) when is_list(Conf) -> - Dir = ?copydir, - File = fname(Dir, "absmod.erl"), - MFile = fname(Dir, "absmod"), - Beam = fname(Dir, "absmod.beam"), - Test = <<"-module(param, [A, B]). - - -export([args/1]). - - args(C) -> - X = local(C), - Y = THIS:new(), % undef - Z = new(A, B), - {X, Y, Z}. - - local(C) -> - module_info(C). - ">>, - - ?line ok = file:write_file(File, Test), - - %% The compiler will no longer allow us to have a mismatch between - %% the module name and the output file, so we must use a trick. - ?line {ok, param, BeamCode} = compile:file(File, [binary,debug_info]), - ?line ok = file:write_file(Beam, BeamCode), - - ?line {ok, _} = xref:start(s), - ?line {ok, param} = xref:add_module(s, MFile, {warnings,false}), - A = param, - ?line {ok, [{{{A,args,1},{'$M_EXPR',new,0}},[7]}, - {{{A,args,1},{A,local,1}},[6]}, - {{{A,args,1},{A,new,2}},[8]}, - {{{A,local,1},{A,module_info,1}},[12]}, - {{{param,new,2},{param,instance,2}},[0]}]} = - xref:q(s, "(Lin) E"), - ?line {ok,[{param,args,1}, - {param,instance,2}, - {param,local,1}, - {param,module_info,1}, - {param,new,2}]} = xref:q(s, "F"), - - ?line ok = check_state(s), - ?line xref:stop(s), - - ?line {ok, _} = xref:start(s, {xref_mode, modules}), - ?line {ok, param} = xref:add_module(s, MFile), - ?line {ok,[{param,args,1}, - {param,instance,2}, - {param,new,2}]} = xref:q(s, "X"), - ?line ok = check_state(s), - ?line xref:stop(s), - - ?line ok = file:delete(File), - ?line ok = file:delete(Beam), - ok. - fun_mfa(suite) -> []; fun_mfa(doc) -> ["OTP-5653: fun M:F/A."]; fun_mfa(Conf) when is_list(Conf) -> diff --git a/lib/tv/src/Makefile b/lib/tv/src/Makefile index da1713e156..3d680c1eaf 100644 --- a/lib/tv/src/Makefile +++ b/lib/tv/src/Makefile @@ -109,10 +109,10 @@ clean: rm -f errs core *~ $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: diff --git a/lib/typer/src/Makefile b/lib/typer/src/Makefile index 1f94d8fdc8..13af466755 100644 --- a/lib/typer/src/Makefile +++ b/lib/typer/src/Makefile @@ -82,13 +82,13 @@ clean: # ---------------------------------------------------- $(EBIN)/typer.$(EMULATOR): typer.erl ../vsn.mk Makefile - erlc -W $(ERL_COMPILE_FLAGS) -DVSN="\"v$(VSN)\"" -o$(EBIN) typer.erl + $(erlc_verbose)erlc -W $(ERL_COMPILE_FLAGS) -DVSN="\"v$(VSN)\"" -o$(EBIN) typer.erl $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # --------------------------------------------------------------------- # dependencies diff --git a/lib/webtool/src/Makefile b/lib/webtool/src/Makefile index 783ffad79a..f28c777240 100644 --- a/lib/webtool/src/Makefile +++ b/lib/webtool/src/Makefile @@ -76,10 +76,10 @@ docs: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- # Release Target diff --git a/lib/wx/aclocal.m4 b/lib/wx/aclocal.m4 index 5d555a5123..918e30a886 100644 --- a/lib/wx/aclocal.m4 +++ b/lib/wx/aclocal.m4 @@ -1861,17 +1861,16 @@ dnl Usage example LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) dnl dnl AC_DEFUN([LM_TRY_ENABLE_CFLAG], [ - AC_MSG_CHECKING([if we can add $1 to CFLAGS]) + AC_MSG_CHECKING([if we can add $1 to $2 (via CFLAGS)]) saved_CFLAGS=$CFLAGS; - CFLAGS="$1 $CFLAGS"; + CFLAGS="$1 $$2"; AC_TRY_COMPILE([],[return 0;],can_enable_flag=true,can_enable_flag=false) CFLAGS=$saved_CFLAGS; if test "X$can_enable_flag" = "Xtrue"; then AC_MSG_RESULT([yes]) - AS_VAR_SET($2, "$1 $CFLAGS") + AS_VAR_SET($2, "$1 $$2") else AC_MSG_RESULT([no]) - AS_VAR_SET($2, "$CFLAGS") fi ]) diff --git a/lib/wx/src/Makefile b/lib/wx/src/Makefile index 777fb7d998..26574ed86f 100644 --- a/lib/wx/src/Makefile +++ b/lib/wx/src/Makefile @@ -101,19 +101,19 @@ archive: opt # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk Makefile - sed -e 's;%GEN_MODS%;$(GEN_MODS);' $< > [email protected] - sed -e 's;%VSN%;$(VSN);' [email protected] > $@ - rm [email protected] + $(gen_verbose)sed -e 's;%GEN_MODS%;$(GEN_MODS);' $< > [email protected] + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' [email protected] > $@ + $(V_at)rm [email protected] $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk Makefile - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # Rules $(EBIN)/%.beam: $(ESRC)/%.erl $(HEADER_FILES) - $(ERLC) -W -bbeam $(ERL_FLAGS) $(ERL_COMPILE_FLAGS) -o$(EBIN) $< + $(V_ERLC) -W -bbeam $(ERL_FLAGS) $(ERL_COMPILE_FLAGS) -o$(EBIN) $< $(EBIN)/%.beam: $(EGEN)/%.erl $(HEADER_FILES) - $(ERLC) -W -bbeam $(ERL_FLAGS) $(ERL_COMPILE_FLAGS) -o$(EBIN) $< + $(V_ERLC) -W -bbeam $(ERL_FLAGS) $(ERL_COMPILE_FLAGS) -o$(EBIN) $< # ---------------------------------------------------- # Release Target diff --git a/lib/xmerl/src/Makefile b/lib/xmerl/src/Makefile index ce1aa11fba..d5ce3fe6ff 100644 --- a/lib/xmerl/src/Makefile +++ b/lib/xmerl/src/Makefile @@ -166,34 +166,34 @@ EDOC_PATHS = \ -pa $(EDOC_APP)/ebin -pa $(XMERL_APP)/ebin -pa $(SYNTAX_TOOLS_APP)/ebin $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ xmerl_xpath_parse.erl: xmerl_xpath_parse.yrl - $(ERLC) -o $(ESRC) $< + $(yecc_verbose)$(ERLC) -o $(ESRC) $< xmerl_b64Bin.erl: xmerl_b64Bin.yrl - $(ERLC) -o $(ESRC) $< + $(yecc_verbose)$(ERLC) -o $(ESRC) $< xmerl_sax_parser_list.erl: xmerl_sax_parser_list.erlsrc xmerl_sax_parser_base.erlsrc - cat xmerl_sax_parser_list.erlsrc xmerl_sax_parser_base.erlsrc >$@ + $(gen_verbose)cat xmerl_sax_parser_list.erlsrc xmerl_sax_parser_base.erlsrc >$@ xmerl_sax_parser_latin1.erl: xmerl_sax_parser_latin1.erlsrc xmerl_sax_parser_base.erlsrc - cat xmerl_sax_parser_latin1.erlsrc xmerl_sax_parser_base.erlsrc >$@ + $(gen_verbose)cat xmerl_sax_parser_latin1.erlsrc xmerl_sax_parser_base.erlsrc >$@ xmerl_sax_parser_utf8.erl: xmerl_sax_parser_utf8.erlsrc xmerl_sax_parser_base.erlsrc - cat xmerl_sax_parser_utf8.erlsrc xmerl_sax_parser_base.erlsrc >$@ + $(gen_verbose)cat xmerl_sax_parser_utf8.erlsrc xmerl_sax_parser_base.erlsrc >$@ xmerl_sax_parser_utf16be.erl: xmerl_sax_parser_utf16be.erlsrc xmerl_sax_parser_base.erlsrc - cat xmerl_sax_parser_utf16be.erlsrc xmerl_sax_parser_base.erlsrc >$@ + $(gen_verbose)cat xmerl_sax_parser_utf16be.erlsrc xmerl_sax_parser_base.erlsrc >$@ xmerl_sax_parser_utf16le.erl: xmerl_sax_parser_utf16le.erlsrc xmerl_sax_parser_base.erlsrc - cat xmerl_sax_parser_utf16le.erlsrc xmerl_sax_parser_base.erlsrc >$@ + $(gen_verbose)cat xmerl_sax_parser_utf16le.erlsrc xmerl_sax_parser_base.erlsrc >$@ $(EBIN)/%.beam: %.erl - $(ERLC) $(ERL_COMPILE_FLAGS) -o $(EBIN) $< + $(V_ERLC) $(ERL_COMPILE_FLAGS) -o $(EBIN) $< $(DOCDIR)/%.html: %.erl $(ERL) -noshell $(EDOC_PATHS) \ |