forked from basho/erlang_js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rebar.config
44 lines (33 loc) · 1.55 KB
/
rebar.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
%% Linked-in driver config
%%
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
%%
{cover_enabled, true}.
{erl_opts, [warnings_as_errors]}.
{port_specs, [{"priv/erlang_js_drv.so", ["c_src/*.c"]}]}.
{port_env, [
{"DRV_CFLAGS", "$DRV_CFLAGS -I c_src/system/include/js -DXP_UNIX -Wall"},
{"DRV_LDFLAGS", "$DRV_LDFLAGS c_src/system/lib/libjs.a c_src/system/lib/libnspr4.a"},
%% Define flags for enabling/disable 64 bit build of NSPR
{"-32$", "NSPR_SIXTYFOUR", "--disable-64bit"},
{"-64$", "NSPR_SIXTYFOUR", "--enable-64bit"},
%% Solaris specific flags
{"solaris.*", "DRV_LDFLAGS", "$DRV_LDFLAGS -lrt"},
{"solaris.*-64$", "CFLAGS", "-m64"},
{"solaris.*-64$", "LDFLAGS", "-m64"},
%% OS X Leopard flags for 64-bit
{"darwin9.*-64$", "CFLAGS", "-m64"},
{"darwin9.*-64$", "LDFLAGS", "-arch x86_64"},
%% OS X Snow Leopard flags for 32-bit
{"darwin10.*-32$", "CFLAGS", "-m32"},
{"darwin10.*-32$", "LDFLAGS", "-arch i386"},
%% OS X Mountain Lion flags.
{".*darwin12.4.*$", "CFLAGS", "-m64"},
{".*darwin12.4.*$", "LDFLAGS", "-arch x86_64"},
%% Prevent the make->gmake transition from infecting
%% MAKEFLAGS with bad flags that confuse gmake
{"freebsd.*", "MAKEFLAGS", ""}
]}.
{pre_hooks, [{compile, "make c_src"}]}.
{post_hooks, [{clean, "make c_src_clean"}]}.