Commits

Bryan Fink  committed 4e8224b

have compilation fail nicely if erlang version < R13B

  • Participants
  • Parent commits 3f7ad6b

Comments (0)

Files changed (2)

 EBIN_DIRS    := $(wildcard deps/*/ebin)
 APP          := riak
 
-all:  webmachine erl 
+all:  otp_release webmachine erl 
+
+otp_release:
+	@scripts/otp_release.escript
 
 erl: ebin/$(APP).app
 	@$(ERL) -pa ebin -pa $(EBIN_DIRS) -noinput +B \

File scripts/otp_release.escript

+#!/usr/bin/env escript
+%% -*- erlang -*-
+%% This script checks the Erlang/OTP release version, and
+%% exits with a failure code if that version is less than 13.
+main([]) ->
+    [$R|Vs] = erlang:system_info(otp_release),
+    {ok, [V], _} = io_lib:fread("~d", Vs),
+    if 13 =< V ->
+            ok;
+       true ->
+            io:format("Error: Riak requires OTP release >= R13B"
+                      " (detected R~b)~n", [V]),
+            halt(1)
+    end.