Skip to content

Commit c845948

Browse files
committed
Move version info into configure.ac and generate version_base.h from template
1 parent a08067e commit c845948

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

configure.ac

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
AC_INIT
2+
m4_define([VER_MAJOR], [14])
3+
m4_define([VER_MINOR], [0])
4+
m4_define([VER_EXTRA], [stable])
5+
AC_INIT([iverilog], [VER_MAJOR.VER_MINOR (VER_EXTRA)])
6+
AC_SUBST([VERSION_MAJOR], [VER_MAJOR])
7+
AC_SUBST([VERSION_MINOR], [VER_MINOR])
8+
AC_SUBST([VERSION_EXTRA], [" (VER_EXTRA)"])
9+
AC_SUBST([VERSION], ["VER_MAJOR.VER_MINOR (VER_EXTRA)"])
10+
311
AC_CONFIG_SRCDIR([netlist.h])
412
AC_CONFIG_HEADERS([config.h])
513
AC_CONFIG_HEADERS([_pli_types.h])
@@ -366,5 +374,5 @@ then
366374
AC_MSG_ERROR(cannot configure white space in libdir: $libdir)
367375
fi
368376
AC_MSG_RESULT(ok)
369-
AC_CONFIG_FILES([Makefile ivlpp/Makefile vhdlpp/Makefile vvp/Makefile vpi/Makefile driver/Makefile driver-vpi/Makefile cadpli/Makefile libveriuser/Makefile tgt-null/Makefile tgt-stub/Makefile tgt-vvp/Makefile tgt-vhdl/Makefile tgt-fpga/Makefile tgt-verilog/Makefile tgt-pal/Makefile tgt-vlog95/Makefile tgt-pcb/Makefile tgt-blif/Makefile tgt-sizer/Makefile])
377+
AC_CONFIG_FILES([Makefile version_base.h ivlpp/Makefile vhdlpp/Makefile vvp/Makefile vpi/Makefile driver/Makefile driver-vpi/Makefile cadpli/Makefile libveriuser/Makefile tgt-null/Makefile tgt-stub/Makefile tgt-vvp/Makefile tgt-vhdl/Makefile tgt-fpga/Makefile tgt-verilog/Makefile tgt-pal/Makefile tgt-vlog95/Makefile tgt-pcb/Makefile tgt-blif/Makefile tgt-sizer/Makefile vvp/libvvp.pc])
370378
AC_OUTPUT

scripts/CREATE_BRANCH.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ case $1 in
2727
esac
2828

2929
major=$1
30-
30+
minor=0
31+
extra="stable"
3132
branch="v${major}-branch"
3233

3334
branch_exists=`git ls-remote --heads origin $branch`
@@ -39,10 +40,11 @@ fi
3940
echo "Creating branch $branch"
4041
git checkout -b $branch
4142

42-
echo "Updating version_base.h..."
43-
sed -i -E "s/(define\s+VERSION_MAJOR\s+).*/\1$major/" version_base.h
44-
sed -i -E "s/(define\s+VERSION_MINOR\s+).*/\10/" version_base.h
45-
sed -i -E "s/(define\s+VERSION_EXTRA\s+).*/\1\" \(stable\)\"/" version_base.h
43+
file=configure.ac
44+
echo "Updating $file..."
45+
sed -i -E "s/(m4_define\(\[VER_MAJOR\],[[:space:]]*\[)[^]]*(\]\))/\1$major\2/" $file
46+
sed -i -E "s/(m4_define\(\[VER_MINOR\],[[:space:]]*\[)[^]]*(\]\))/\1$minor\2/" $file
47+
sed -i -E "s/(m4_define\(\[VER_EXTRA\],[[:space:]]*\[)[^]]*(\]\))/\1$extra\2/" $file
4648

4749
echo "Updating aclocal.m4..."
4850
sed -i -E "s/(install_suffix='-)dev/\1$major/" aclocal.m4

version_base.h renamed to version_base.h.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
* Edit this definition in version_base.in to define the base version
44
* number for the compiled result.
55
*/
6-
# define VERSION_MAJOR 14
7-
# define VERSION_MINOR 0
6+
#define VERSION_MAJOR @VERSION_MAJOR@
7+
#define VERSION_MINOR @VERSION_MINOR@
88

99
/*
1010
* This will be appended to the version. Use this to mark development
1111
* versions and the like.
1212
*/
13-
# define VERSION_EXTRA " (devel)"
13+
# define VERSION_EXTRA "@VERSION_EXTRA@"
1414

1515
# define VERSION_STRINGIFY(x) #x
1616
# define VERSION_STR(a,b,extra) VERSION_STRINGIFY(a.b) extra

0 commit comments

Comments
 (0)