summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2009-12-16 10:27:14 -0500
committerDave Smith <dizzyd@dizzyd.com>2009-12-16 10:27:14 -0500
commitee0c6ad086d348873fa7851d72d1281c7ed4a510 (patch)
tree033426af45b531eb7ae7aa0b2f572da99cffb242
parent4d3c7e60d6743eb65b9173f0073d2e33f44e785d (diff)
Reorder arguments to CC for linking and fix needs_link to function properly
-rw-r--r--src/rebar_port_compiler.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl
index a11fa19..fd5fba4 100644
--- a/src/rebar_port_compiler.erl
+++ b/src/rebar_port_compiler.erl
@@ -95,7 +95,7 @@ compile(Config, AppFile) ->
case needs_link(SoName, NewBins) of
true ->
AllBins = string:join(NewBins ++ ExistingBins, " "),
- rebar_utils:sh_failfast(?FMT("$CC ~s $LDFLAGS $DRIVER_LDFLAGS -o ~s", [AllBins, SoName]), Env);
+ rebar_utils:sh_failfast(?FMT("$CC $LDFLAGS $DRIVER_LDFLAGS ~s -o ~s", [AllBins, SoName]), Env);
false ->
?INFO("Skipping relink of ~s\n", [SoName]),
ok
@@ -178,15 +178,17 @@ needs_compile(Source, Bin) ->
filelib:last_modified(Bin) < filelib:last_modified(Source).
needs_link(SoName, []) ->
+ ?DEBUG("2 Lad mod \n", []),
filelib:last_modified(SoName) == 0;
needs_link(SoName, NewBins) ->
MaxLastMod = lists:max([filelib:last_modified(B) || B <- NewBins]),
case filelib:last_modified(SoName) of
0 ->
+ ?DEBUG("Last mod is 0 on ~s\n", [SoName]),
true;
Other ->
- ?DEBUG("Checking ~p < ~p", [MaxLastMod, Other]),
- MaxLastMod < Other
+ ?DEBUG("Checking ~p >= ~p", [MaxLastMod, Other]),
+ MaxLastMod >= Other
end.
merge_envs(OverrideEnvs, DefaultEnvs) ->