Skip to content

Commit bf6ee80

Browse files
committed
build: read package version from a top-level VERSION file
The version string lived only in configure.ac's AC_INIT. Move it to a neutral VERSION file (line 1: numeric X.Y.Z.W, line 2: optional suffix) so a second build system can read the same source. AC_INIT now joins the two lines via m4_esyscmd_s; the resulting PACKAGE_VERSION is unchanged ("2.4.8.4 (Prelim)").
1 parent 7d0de7c commit bf6ee80

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

VERSION

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2.4.8.4
2+
(Prelim)

configure.ac

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@
3636
dnl
3737
dnl LTFS configure.ac.
3838
dnl
39-
AC_INIT([LTFS], [2.4.8.4 (Prelim)], IBM corporation.)
39+
dnl Package version is kept in the top-level VERSION file (line 1: numeric
40+
dnl X.Y.Z.W, line 2: optional suffix) so the autotools and CMake builds share
41+
dnl a single source of truth. The awk joins them into "X.Y.Z.W suffix".
42+
AC_INIT([LTFS],
43+
m4_esyscmd_s([awk 'NR==1{n=$0} NR==2{s=$0} END{if(s=="")printf "%s",n; else printf "%s %s",n,s}' VERSION]),
44+
IBM corporation.)
4045
AC_CONFIG_SRCDIR([src/main.c])
4146
AC_CONFIG_AUX_DIR([build-aux])
4247
AC_CONFIG_MACRO_DIRS([m4])

0 commit comments

Comments
 (0)