Skip to content

Commit

Permalink
Whitespace and comment changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hintjens committed Aug 10, 2011
1 parent ab4dc28 commit 2dda65e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
35 changes: 22 additions & 13 deletions builds/android/build.sh
@@ -1,4 +1,13 @@
#! /bin/bash
#
# Does an NDK build by creating the necessary JNI directory
# and copying the libzmq source files into a temporary tree.
# We build a static uuid library (libuuid isn't provided on
# Android) and link that into libzmq.so. After the build is
# done, creates a symlink to the resulting libzmq.so.
#
# The clean.sh script restores the libzmq environment to its
# former state.

SRC_DIR="../../src/"
JNI_DIR="../../src/jni"
Expand All @@ -7,25 +16,25 @@ UUID_DIR="uuid"
NDK_BUILD=`which ndk-build`

if [ -z "$NDK_BUILD" ]; then
echo "Must have ndk-build in your path"
exit 1;
echo "Must have ndk-build in your path"
exit 1
fi

if [ ! -d $JNI_DIR ]; then
mkdir $JNI_DIR;
fi
mkdir $JNI_DIR
fi

if [ -d $UUID_DIR ]; then
echo "Copying $UUID_DIR $JNI_DIR/$UUID_DIR"
cp -r $UUID_DIR $JNI_DIR/$UUID_DIR
echo "Copying $UUID_DIR $JNI_DIR/$UUID_DIR"
cp -r $UUID_DIR $JNI_DIR/$UUID_DIR
fi

for i in `ls $SRC_DIR`; do
if [ -f $SRC_DIR/$i -a ! -f $JNI_DIR/$i ]; then
echo "copying $SRC_DIR/$i --> $JNI_DIR/$i";
cp $SRC_DIR/$i $JNI_DIR/$i;
fi
done;
if [ -f $SRC_DIR/$i -a ! -f $JNI_DIR/$i ]; then
echo "copying $SRC_DIR/$i --> $JNI_DIR/$i"
cp $SRC_DIR/$i $JNI_DIR/$i
fi
done

cp Android.mk $JNI_DIR;
cp Application.mk $JNI_DIR
Expand All @@ -37,7 +46,7 @@ $NDK_BUILD
popd

if [ -f ../../src/libs/armeabi/libzmq.so ]; then
ln -s ../../src/libs/armeabi/libzmq.so ./libzmq.so;
ln -s ../../src/libs/armeabi/libzmq.so ./libzmq.so
fi

exit 0;
exit 0
15 changes: 10 additions & 5 deletions builds/android/clean.sh
@@ -1,21 +1,26 @@
#! /bin/bash
#
# Restores the libzmq tree after a build.sh. Does no harm if
# used more than once. Run from the builds/android directory.


SRC_DIR="../../src"
JNI_DIR="$SRC_DIR/jni"

if [ -d $JNI_DIR ]; then
rm -rf $JNI_DIR;
rm -rf $JNI_DIR
fi

if [ -d $SRC_DIR/obj ]; then
rm -rf $JNI_DIR/obj
rm -rf $JNI_DIR/obj
fi

if [ -d $SRC_DIR/libs ]; then
rm -rf $SRC_DIR/libs;
rm -rf $SRC_DIR/libs
fi

if [ -h libzmq.so ]; then
rm libzmq.so;
rm libzmq.so
fi

exit 0;
exit 0

0 comments on commit 2dda65e

Please sign in to comment.