Skip to content

Commit 53a2571

Browse files
stweilzdenop
authored andcommitted
autoconf: Get version components from PACKAGE_VERSION (#1431)
AX_SPLIT_VERSION only works after AM_INIT_AUTOMAKE, so that macro had to be moved. GENERIC_MAJOR_VERSION, GENERIC_MINOR_VERSION and GENERIC_MICRO_VERSION are now set automatically and can be used in further processing. Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent 3fcb952 commit 53a2571

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

configure.ac

+10-10
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ AC_CONFIG_AUX_DIR([config])
1919
AC_CONFIG_SRCDIR([api/tesseractmain.cpp])
2020
AC_PREFIX_DEFAULT([/usr/local])
2121

22+
# Automake configuration. Do not require README file (we use README.md).
23+
AM_INIT_AUTOMAKE([foreign subdir-objects])
24+
2225
# Define date of package, etc. Could be useful in auto-generated
2326
# documentation.
2427
PACKAGE_YEAR=2018
@@ -38,16 +41,19 @@ AC_SUBST([PACKAGE_DATE])
3841

3942
GENERIC_LIBRARY_NAME=tesseract
4043

41-
# Release versioning
42-
GENERIC_MAJOR_VERSION=4
43-
GENERIC_MINOR_VERSION=0
44-
GENERIC_MICRO_VERSION=0
44+
# Release versioning. Get versions from PACKAGE_VERSION.
45+
AX_SPLIT_VERSION
46+
GENERIC_MAJOR_VERSION=$AX_MAJOR_VERSION
47+
GENERIC_MINOR_VERSION=$AX_MINOR_VERSION
48+
GENERIC_MICRO_VERSION=`echo "$AX_POINT_VERSION" | $SED 's/^\([[0-9]][[0-9]]*\).*/\1/'`
4549

4650
# API version (often = GENERIC_MAJOR_VERSION.GENERIC_MINOR_VERSION)
4751
GENERIC_API_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
4852
GENERIC_LIBRARY_VERSION=$GENERIC_MAJOR_VERSION:$GENERIC_MINOR_VERSION
4953
AC_SUBST([GENERIC_API_VERSION])
5054
AC_SUBST([GENERIC_MAJOR_VERSION])
55+
AC_SUBST([GENERIC_MINOR_VERSION])
56+
AC_SUBST([GENERIC_MICRO_VERSION])
5157

5258
AC_SUBST([GENERIC_LIBRARY_VERSION])
5359
PACKAGE=$GENERIC_LIBRARY_NAME
@@ -58,12 +64,6 @@ GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
5864
AC_SUBST([GENERIC_RELEASE])
5965
AC_SUBST([GENERIC_VERSION])
6066

61-
# ----------------------------------------
62-
# Automake configuration
63-
# ----------------------------------------
64-
65-
# Do not require README file (we use README.md)
66-
AM_INIT_AUTOMAKE([foreign subdir-objects])
6767
AC_CONFIG_HEADERS([config_auto.h:config/config.h.in])
6868
AM_MAINTAINER_MODE
6969

0 commit comments

Comments
 (0)