Skip to content

Commit 7a61828

Browse files
committed
Version number is now updated in include/fmq.h only
1 parent 8ed4172 commit 7a61828

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

configure.ac

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
# Process this file with autoconf to produce a configure script.
33
AC_PREREQ(2.61)
44
#
5-
# Change the version number below after doing a public release.
5+
# The version number is extracted from include/fmq.h using
6+
# the version.sh script. Hence, it should be updated there.
67
# The version in git should reflect the *next* version planned.
7-
# Version must be MAJOR.MINOR.PATCH otherwise things will break.
8-
# Make sure you also updated include/fmq.h to match.
98
#
10-
AC_INIT([filemq],[1.2.0],[[email protected]])
9+
AC_INIT([clab],[m4_esyscmd([./version.sh fmq])],[[email protected]])
1110

1211
AC_CONFIG_AUX_DIR(config)
1312
AC_CONFIG_MACRO_DIR(config)

version.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
#
3+
# This script extracts the version from the project header file
4+
#
5+
project=$1
6+
if [ ! -f include/$project.h ]; then
7+
echo "version.sh: error: include/$project.h does not exist" 1>&2
8+
exit 1
9+
fi
10+
MAJOR=`egrep '^#define .*_VERSION_MAJOR +[0-9]+$' include/$project.h`
11+
MINOR=`egrep '^#define .*_VERSION_MINOR +[0-9]+$' include/$project.h`
12+
PATCH=`egrep '^#define .*_VERSION_PATCH +[0-9]+$' include/$project.h`
13+
if [ -z "$MAJOR" -o -z "$MINOR" -o -z "$PATCH" ]; then
14+
echo "version.sh: error: could not extract version from include/$project.h" 1>&2
15+
exit 1
16+
fi
17+
MAJOR=`echo $MAJOR | awk '{ print $3 }'`
18+
MINOR=`echo $MINOR | awk '{ print $3 }'`
19+
PATCH=`echo $PATCH | awk '{ print $3 }'`
20+
echo $MAJOR.$MINOR.$PATCH | tr -d '\n'
21+

0 commit comments

Comments
 (0)