Skip to content

Commit

Permalink
Version number is now updated in include/zre.h only
Browse files Browse the repository at this point in the history
  • Loading branch information
hintjens committed May 31, 2013
1 parent 92b0edd commit ea0611e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions configure.ac
Expand Up @@ -2,11 +2,11 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
#
# Change the version number below after doing a public release.
# The version number is extracted from include/zre.h using
# the version.sh script. Hence, it should be updated there.
# The version in git should reflect the *next* version planned.
# Version must be MAJOR.MINOR.PATCH otherwise things will break.
#
AC_INIT([libzre],[1.0.1],[zeromq-dev@lists.zeromq.org])
AC_INIT([libzre],[m4_esyscmd([./version.sh zre])],[zeromq-dev@lists.zeromq.org])

AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
Expand Down
21 changes: 21 additions & 0 deletions version.sh
@@ -0,0 +1,21 @@
#!/bin/sh
#
# This script extracts the version from the project header file
#
project=$1
if [ ! -f include/$project.h ]; then
echo "version.sh: error: include/$project.h does not exist" 1>&2
exit 1
fi
MAJOR=`egrep '^#define .*_VERSION_MAJOR +[0-9]+$' include/$project.h`
MINOR=`egrep '^#define .*_VERSION_MINOR +[0-9]+$' include/$project.h`
PATCH=`egrep '^#define .*_VERSION_PATCH +[0-9]+$' include/$project.h`
if [ -z "$MAJOR" -o -z "$MINOR" -o -z "$PATCH" ]; then
echo "version.sh: error: could not extract version from include/$project.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'

0 comments on commit ea0611e

Please sign in to comment.