Permalink
Browse files

Added script to automate building jzmq correctly.

  • Loading branch information...
1 parent 2362f8c commit f1c47f73b5d7ec57535ad8c6b97e7f25345cb467 @nicktelford nicktelford committed Jan 11, 2012
Showing with 40 additions and 0 deletions.
  1. +40 −0 build_complete.sh
View
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+if [ ! -n "$1" ]
+then
+ echo "Usage: build_complete /path/to/libzmq.so"
+ exit 1
+fi
+
+LIB_FILE=`basename $1`
+
+# ensure argument is path to libzmq.so
+if [[ ! -r "$1" || "$LIB_FILE" != "libzmq.so" ]]
+then
+ echo "Usage: build_complete /path/to/libzmq.so"
+ exit 1
+fi
+
+PREFIX="`readlink -f $(dirname $1)/../`"
+echo "Using libzmq at: $PREFIX"
+
+# search for libzmq headers
+if [[ ! -r "$PREFIX/include/zmq.h" || ! -r "$PREFIX/include/zmq_utils.h" ]]
+then
+ echo "Unable to find libzmq headers at expected path: $PREFIX/include"
+ exit 1
+fi
+
+# run autogen.sh if needs be
+if [ ! -e "./configure" ]
+then
+ echo "Generating configure..."
+ ./autogen.sh
+fi
+
+# drop the first argument so we can pass all remaining args to configure
+shift
+
+# build the binaries and JAR
+./configure --with-zeromq="$PREFIX" "$@" && make && ln -fs $PREFIX/lib/libzmq.so* ./src/.libs/ && mvn verify
+

0 comments on commit f1c47f7

Please sign in to comment.