summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2012-02-10 22:57:10 +0100
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2012-02-10 23:02:53 +0100
commitb48cc0c7ebf88d6e422333719fb74a1fc7974cd1 (patch)
tree2426e3ea3f6a3f5dcbd1f36b6b4c1989c1f94b8f
parentebb23450719ef519f066546582c8415719086bb9 (diff)
Fix regression in port_compiler needs_link check
-rw-r--r--src/rebar_port_compiler.erl18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl
index 4acbf36..6f2d6ec 100644
--- a/src/rebar_port_compiler.erl
+++ b/src/rebar_port_compiler.erl
@@ -115,11 +115,11 @@ compile(Config, AppFile) ->
%% Only relink if necessary, given the Target
%% and list of new binaries
lists:foreach(
- fun({Target, Sources}) ->
- Bins = lists:map(fun source_to_bin/1, Sources),
+ fun({Target, Bins}) ->
AllBins = [sets:from_list(Bins),
sets:from_list(NewBins)],
Intersection = sets:intersection(AllBins),
+ ?DEBUG("Bins: ~p NewBins: ~p~n", [Bins, NewBins]),
case needs_link(Target, sets:to_list(Intersection)) of
true ->
LinkTemplate = select_link_template(Target),
@@ -559,14 +559,20 @@ make_port_specs(Config, AppFile, Bins) ->
true
end, PortSpecs),
%% TODO: DEPRECATED: remove support for non-port_specs syntax
+
+
%% drop ArchRegex from specs
- lists:map(fun({_, Target, Sources}) ->
- {Target, Sources};
- (Spec) ->
- Spec
+ lists:map(fun({_, Target, RawSources}) ->
+ {Target, sources_to_bins(RawSources)};
+ ({Target, RawSources}) ->
+ {Target, sources_to_bins(RawSources)}
end, Specs0)
end.
+sources_to_bins(RawSources) ->
+ Sources = lists:flatmap(fun filelib:wildcard/1, RawSources),
+ lists:map(fun source_to_bin/1, Sources).
+
%% DEPRECATED
make_so_specs(Config, AppFile, Bins) ->
case rebar_config:get(Config, so_specs, undefined) of