Skip to content
Permalink
Browse files
rebar.config cleanup, much smaller snappy.so object
Removed unnecessary linking with all the shared objects from google-snappy
(it even linked with the unit tests object). The final snappy.so 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

snappy:
./support/build-google-snappy.sh
./rebar compile

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

clean:
./support/clean-google-snappy.sh
./rebar clean
rm -fr priv ebin

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

{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/build-google-snappy.sh", ""}}.
{port_cleanup_script, "support/clean-google-snappy.sh"}.

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

0 comments on commit aa38b5e

Please sign in to comment.