summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Wayne Norton <norton@alum.mit.edu>2011-01-09 16:06:51 +0100
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2011-01-09 16:06:51 +0100
commit5b05e54cda77d6e45fd6d1cc8ea1dabfafa6bcb1 (patch)
tree469778607f70ede36d35c6c1822105aaae484646 /src
parent5a371496422a60b6ce6d409d680ea9107eefb019 (diff)
Add otp_release to platform string
Diffstat (limited to 'src')
-rw-r--r--src/rebar_erlc_compiler.erl25
-rw-r--r--src/rebar_utils.erl3
2 files changed, 21 insertions, 7 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index 871b9a1..f533d48 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -42,16 +42,29 @@
%%
%% * erl_opts - Erlang list of options passed to compile:file/2
%% It is also possible to specify platform specific
-%% options by specifying a triplet where the first string
-%% is a regex that is checked against Erlang's system
-%% architecture string. E.g. to define HAVE_SENDFILE only
-%% on systems with sendfile() and define BACKLOG on
-%% Linux/FreeBSD as 128 do:
+%% options by specifying a pair or a triplet where the
+%% first string is a regex that is checked against the
+%% string
+%%
+%% OtpRelease ++ "-" ++ SysArch ++ "-" ++ Words.
+%%
+%% where
+%%
+%% OtpRelease = erlang:system_info(otp_release).
+%% SysArch = erlang:system_info(system_architecture).
+%% Words = integer_to_list(8 * erlang:system_info(wordsize)).
+%%
+%% E.g. to define HAVE_SENDFILE only on systems with
+%% sendfile(), to define BACKLOG on Linux/FreeBSD as 128,
+%% and to define 'old_inets' for R13 OTP release do:
+%%
%% {erl_opts, [{platform_define,
%% "(linux|solaris|freebsd|darwin)",
%% 'HAVE_SENDFILE'},
%% {platform_define, "(linux|freebsd)",
-%% 'BACKLOG', 128}]}.
+%% 'BACKLOG', 128},
+%% {platform_define, "R13",
+%% 'old_inets'}]}.
%%
-spec compile(Config::#config{}, AppFile::string()) -> 'ok'.
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index 17fb95a..f49969a 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -60,7 +60,8 @@ is_arch(ArchRegex) ->
get_arch() ->
Words = integer_to_list(8 * erlang:system_info(wordsize)),
- erlang:system_info(system_architecture) ++ "-" ++ Words.
+ erlang:system_info(otp_release) ++ "-"
+ ++ erlang:system_info(system_architecture) ++ "-" ++ Words.
%%
%% Options = [Option] -- defaults to [use_stdout, abort_on_error]