Skip to content

Commit

Permalink
add support for snappy
Browse files Browse the repository at this point in the history
Change-Id: Ic6a22209ff3cc4634a649b65e1fdbc9ff83475c4
Reviewed-on: http://review.couchbase.org/10134
Reviewed-by: Marty Schoch <marty.schoch@gmail.com>
Tested-by: Dale Harvey <daleharvey@arandomurl.com>
Reviewed-by: Dale Harvey <daleharvey@arandomurl.com>
  • Loading branch information
mschoch authored and Dale Harvey committed Oct 17, 2011
1 parent 95ea57a commit 7854731
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions build.couch
Expand Up @@ -22,8 +22,10 @@ ERL_LIBS=$ERL_HOME/lib \
ERL=$ERL_HOME/bootstrap/bin/erl \
ERLC=$ERL_HOME/bootstrap/bin/erlc \
CXX=agcc \
CXXFLAGS="-fno-rtti -fno-exceptions -I$COUCH_ANDROID_HOME/build/deps/otp_rel/usr/include -I$ANDROID_SDK_ROOT/sources/cxx-stl/stlport/stlport/" \
CC=agcc \
./configure \
--with-ejson=no \
--host=arm-eabi \
--prefix=/data/data/%app_name%/couchdb \
--with-erlang=$COUCH_ANDROID_HOME/build/deps/otp_rel/usr/include \
Expand All @@ -33,3 +35,17 @@ CC=agcc \
export ERL_LIBS=$ERL_HOME/lib
make -s
make install

# fix up the snappy nif
cd src/snappy
agcc -shared -o .libs/snappy_nif.so \
snappy_nif.o snappy.o snappy-sinksource.o snappy-stubs-internal.o \
-L../../../Android-Couchbase-SourceBuild/build/deps/otp_rel/erts-5.8.5/bin/ \
-lbeam \
-L../../../Android-Couchbase-SourceBuild/build/deps/android-ndk/android-ndk-r6b/sources/cxx-stl/stlport/libs/armeabi \
-lstlport_static \
-lgcc \
-lstdc++

make -s
make install
2 changes: 2 additions & 0 deletions build.final
Expand Up @@ -148,11 +148,13 @@ mkdir -p $OVERLAY_PATH/libs/armeabi
cp -Rdp build/deps/otp_rel/erts-5.8.5/bin/libbeam.so $OVERLAY_PATH/libs/armeabi
cp -Rdp build/deps/otp_rel/lib/crypto-2.0.3/priv/lib/crypto.so $OVERLAY_PATH/libs/armeabi/libcrypto_nif.so
cp -Rdp build/deps/mozilla-current/mozilla-central/js/src/libmozjs.so $OVERLAY_PATH/libs/armeabi
cp -Rdp ../couchdb/src/snappy/priv/snappy_nif.so $OVERLAY_PATH/libs/armeabi/libsnappy_nif.so

# Strip unneeded symbols from the libs
arm-linux-androideabi-strip --strip-unneeded $OVERLAY_PATH/libs/armeabi/libbeam.so
arm-linux-androideabi-strip --strip-unneeded $OVERLAY_PATH/libs/armeabi/libcrypto_nif.so
arm-linux-androideabi-strip --strip-unneeded $OVERLAY_PATH/libs/armeabi/libmozjs.so
arm-linux-androideabi-strip --strip-unneeded $OVERLAY_PATH/libs/armeabi/snappy_nif.so

# Strip beam files of debugging symbols
$ERL_HOME/bootstrap/bin/erl -eval "erlang:display(beam_lib:strip_release(\"$OVERLAY_PATH/assets\"))" -s init stop
Expand Down

0 comments on commit 7854731

Please sign in to comment.