Permalink
Browse files

Renamed snappy.so to snappy_nif.so

This is mostly to avoid autotools configuration errors in Apache CouchDB.
  • Loading branch information...
1 parent 8af0f55 commit 6089b73c37626adfac39066092c4d6ad8596a69d @fdmanana fdmanana committed Apr 16, 2011
Showing with 9 additions and 5 deletions.
  1. +1 −1 rebar.config
  2. +8 −4 src/snappy.erl
View
@@ -5,7 +5,7 @@
{"(linux|solaris)", "LDFLAGS", "$LDFLAGS -lstdc++"},
{"LDFLAGS", "$LDFLAGS c_src/google-snappy/snappy.o c_src/google-snappy/snappy-sinksource.o"}
]}.
-{so_name, "snappy.so"}.
+{so_name, "snappy_nif.so"}.
{eunit_opts, [verbose]}.
{pre_hooks, [{compile, "./support/build-google-snappy.sh"},
{clean, "make -C c_src/google-snappy distclean"}]}.
View
@@ -27,14 +27,18 @@ init() ->
{error, bad_name} ->
case filelib:is_dir(filename:join(["..", "priv"])) of
true ->
- filename:join(["..", "priv", ?MODULE]);
+ filename:join(["..", "priv", "snappy_nif"]);
false ->
- filename:join(["priv", ?MODULE])
+ filename:join(["priv", "snappy_nif"])
end;
Dir ->
- filename:join(Dir, ?MODULE)
+ filename:join(Dir, "snappy_nif")
end,
- erlang:load_nif(SoName, 0).
+ (catch erlang:load_nif(SoName, 0)),
+ case erlang:system_info(otp_release) of
+ "R13B03" -> true;
+ _ -> ok
+ end.
compress(_IoList) ->

0 comments on commit 6089b73

Please sign in to comment.