Skip to content
Browse files
rebar.config cleanup, much smaller object
Removed unnecessary linking with all the shared objects from google-snappy
(it even linked with the unit tests object). The final NIF object is
now about 135Kb instead of 400Kb.
  • Loading branch information
fdmanana committed Mar 26, 2011
1 parent b84e7b5 commit aa38b5e2f4761fc9923f8e227e19f764054a06ca
Showing 2 changed files with 7 additions and 16 deletions.
@@ -1,6 +1,7 @@
all: snappy eunit

./rebar compile

@@ -9,6 +10,7 @@ eunit:
check: eunit

./rebar clean
rm -fr priv ebin

@@ -1,20 +1,9 @@
{port_sources, ["c_src/*.cc", "c_src/google-snappy/*.cc"]}.
{so_name, ""}.

{erl_opts, [debug_info, warn_unused_vars, nowarn_shadow_vars, warn_unused_import]}.
{port_sources, ["c_src/*.cc"]}.
{port_envs, [
%% Make sure to link -lstdc++ on linux or solaris
{"CXXFLAGS", "$CXXFLAGS -Ic_src"},
{"(linux|solaris)", "LDFLAGS", "$LDFLAGS -lstdc++"},

%% OS X Leopard flags for 64-bit
{"darwin9.*-64$", "CXXFLAGS", "-m64"},
{"darwin9.*-64$", "LDFLAGS", "-arch x86_64"},

%% OS X Snow Leopard flags for 32-bit
{"darwin10.*-32$", "CXXFLAGS", "-m32"},
{"darwin10.*-32$", "LDFLAGS", "-arch i386"}
{"LDFLAGS", "$LDFLAGS c_src/google-snappy/snappy.o c_src/google-snappy/snappy-sinksource.o"}

{port_pre_script, {"support/", ""}}.
{port_cleanup_script, "support/"}.

{so_name, ""}.
{eunit_opts, [verbose]}.

0 comments on commit aa38b5e

Please sign in to comment.