diff options
author | Dave Smith <dizzyd@dizzyd.com> | 2010-02-12 15:05:32 -0700 |
---|---|---|
committer | Dave Smith <dizzyd@dizzyd.com> | 2010-02-12 15:05:32 -0700 |
commit | 96c1ceba6007551812add22d585f46256d78e106 (patch) | |
tree | 6fc345d3e852ec1e707a5a47ca9f8102d44c66ee | |
parent | a0732e9e78ea543178b9f29aaf8fa6e72011506e (diff) |
Break out arch string function; update ERLANG_TARGET to include bitness of the Erlang target
-rw-r--r-- | src/rebar_port_compiler.erl | 2 | ||||
-rw-r--r-- | src/rebar_utils.erl | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl index 3cc8fc1..b08a046 100644 --- a/src/rebar_port_compiler.erl +++ b/src/rebar_port_compiler.erl @@ -255,7 +255,7 @@ default_env() -> {"DRIVER_LDFLAGS", lists:concat([" -L", code:lib_dir(erl_interface, lib), " -lerl_interface -lei"])}, {"ERLANG_ARCH", integer_to_list(8 * erlang:system_info(wordsize))}, - {"ERLANG_TARGET", erlang:system_info(system_architecture)}]. + {"ERLANG_TARGET", rebar_utils:get_arch()}]. diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index 1aff1a4..1e99caa 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -28,6 +28,7 @@ -export([get_cwd/0, is_arch/1, + get_arch/0, get_os/0, sh/2, sh/3, sh_failfast/2, @@ -48,15 +49,17 @@ get_cwd() -> is_arch(ArchRegex) -> - Words = integer_to_list(8 * erlang:system_info(wordsize)), - Arch = erlang:system_info(system_architecture) ++ "-" ++ Words, - case re:run(Arch, ArchRegex, [{capture, none}]) of + case re:run(get_arch(), ArchRegex, [{capture, none}]) of match -> true; nomatch -> false end. +get_arch() -> + Words = integer_to_list(8 * erlang:system_info(wordsize)), + erlang:system_info(system_architecture) ++ "-" ++ Words. + get_os() -> Arch = erlang:system_info(system_architecture), case match_first([{"linux", linux}, {"darwin", darwin}], Arch) of |