summaryrefslogtreecommitdiff
path: root/version.sh
diff options
context:
space:
mode:
authorJinkun Jang <jinkun.jang@samsung.com>2013-03-13 01:45:41 +0900
committerJinkun Jang <jinkun.jang@samsung.com>2013-03-13 01:45:41 +0900
commit67c02c905ff2e2abbb1659d8a04c4ae31b9a1741 (patch)
tree44f6c4cce4e317e5e82ca7091f359bb70cf2f6be /version.sh
parent7d28425f8b4adc73acf9c16dd3e7f9ba7a793a9a (diff)
downloadzeromq-67c02c905ff2e2abbb1659d8a04c4ae31b9a1741.tar.gz
zeromq-67c02c905ff2e2abbb1659d8a04c4ae31b9a1741.tar.bz2
zeromq-67c02c905ff2e2abbb1659d8a04c4ae31b9a1741.zip
Diffstat (limited to 'version.sh')
-rwxr-xr-xversion.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/version.sh b/version.sh
new file mode 100755
index 0000000..b4425d0
--- /dev/null
+++ b/version.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# This script extracts the 0MQ version from include/zmq.h, which is the master
+# location for this information.
+#
+if [ ! -f include/zmq.h ]; then
+ echo "version.sh: error: include/zmq.h does not exist" 1>&2
+ exit 1
+fi
+MAJOR=`egrep '^#define +ZMQ_VERSION_MAJOR +[0-9]+$' include/zmq.h`
+MINOR=`egrep '^#define +ZMQ_VERSION_MINOR +[0-9]+$' include/zmq.h`
+PATCH=`egrep '^#define +ZMQ_VERSION_PATCH +[0-9]+$' include/zmq.h`
+if [ -z "$MAJOR" -o -z "$MINOR" -o -z "$PATCH" ]; then
+ echo "version.sh: error: could not extract version from include/zmq.h" 1>&2
+ exit 1
+fi
+MAJOR=`echo $MAJOR | awk '{ print $3 }'`
+MINOR=`echo $MINOR | awk '{ print $3 }'`
+PATCH=`echo $PATCH | awk '{ print $3 }'`
+echo $MAJOR.$MINOR.$PATCH | tr -d '\n'
+