diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2010-10-15 17:13:36 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-10-15 17:13:36 +0200 |
commit | eeb8e7c8beef83fe8c23bde888a1081fc9e8e3ec (patch) | |
tree | daca0d83cfe2d071518692475b5b0ca09d3a0d95 /version.sh | |
parent | 7b9e39724eeecf33dde3b0e4fd9f205480afb977 (diff) | |
parent | 3cf01bf56e66657da795e43f09fa2499b2381dc9 (diff) |
Merge branch 'maint'
* maint:
Makefile.am: Add missing files to distribution, improve maintainer-clean
configure.in: Extract API version from zmq.h
Added bin directory to ignore list.
Conflicts:
configure.in
include/zmq.h
Diffstat (limited to 'version.sh')
-rwxr-xr-x | version.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/version.sh b/version.sh new file mode 100755 index 0000000..b88bb61 --- /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 + |