Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit aa38b5e2f4761fc9923f8e227e19f764054a06ca 1 parent b84e7b5
@fdmanana authored
Showing with 7 additions and 16 deletions.
  1. +2 −0  Makefile
  2. +5 −16 rebar.config
View
2  Makefile
@@ -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
View
21 rebar.config
@@ -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]}.
Please sign in to comment.
Something went wrong with that request. Please try again.