diff options
author | Martin Lucina <mato@kotelna.sk> | 2010-10-15 15:05:54 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-10-15 16:53:15 +0200 |
commit | 3b3df731e60d604794538d0b9f6cb5b802a8745d (patch) | |
tree | e1362a18c465430842370c5319933726f3c4148e /version.sh | |
parent | 26d7669464054a4aed3f0ee9643bffa0e01aab5c (diff) |
configure.in: Extract API version from zmq.h
* Added a version.sh and relevant changes to configure.in to extract the API
version from zmq.h at the time autogen.sh is run.
* Moved the version macros to be next to zmq_version in zmq.h and improved
the comments.
* Modified ZMQ_MAKE_VERSION to use (x) instead of plain x when expanding
macro parameters.
Signed-off-by: Martin Lucina <mato@kotelna.sk>
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 + |