File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 2
2
# Process this file with autoconf to produce a configure script.
3
3
AC_PREREQ ( 2.61 )
4
4
#
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.
6
7
# 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.
9
8
#
10
- AC_INIT ( [ filemq ] ,
[ 1.2.0 ] ,
[ [email protected] ] )
9
+ AC_INIT ( [ clab ] ,
[ m4_esyscmd ( [ ./version.sh fmq ] ) ] ,
[ [email protected] ] )
11
10
12
11
AC_CONFIG_AUX_DIR ( config )
13
12
AC_CONFIG_MACRO_DIR ( config )
Original file line number Diff line number Diff line change
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
+
You can’t perform that action at this time.
0 commit comments