-# SPDX-License-Identifier: LGPL-2.1-only
-
-dnl Version infos
-m4_define([V_MAJOR], [2])
-m4_define([V_MINOR], [13])
-m4_define([V_PATCH], [0])
-m4_define([V_EXTRA], [pre])
-m4_define([V_NAME], [[Codename TBD]])
-m4_define([V_DESC], [[Description TBD]])
-
-m4_define([V_STRING], [V_MAJOR.V_MINOR.V_PATCH])
-m4_ifdef([V_EXTRA], [m4_append([V_STRING], [-V_EXTRA])])
-
-AC_PREREQ([2.69])
-AC_INIT([lttng-ust], V_STRING, [mathieu dot desnoyers at efficios dot com], [], [https://lttng.org])
-
-dnl Substitute minor/major/patchlevel version numbers
-AC_SUBST([MAJOR_VERSION], [V_MAJOR])
-AC_SUBST([MINOR_VERSION], [V_MINOR])
-AC_SUBST([PATCHLEVEL_VERSION], [V_PATCH])
+dnl SPDX-License-Identifier: LGPL-2.1-only
+dnl
+dnl Copyright (C) 2021 EfficiOS, Inc.
+dnl
+dnl Process this file with autoconf to produce a configure script.
+
+
+# Project version information
+m4_define([ust_version_major], [2])
+m4_define([ust_version_minor], [13])
+m4_define([ust_version_patch], [0])
+m4_define([ust_version_dev_stage], [-pre])
+m4_define([ust_version], ust_version_major[.]ust_version_minor[.]ust_version_patch[]ust_version_dev_stage)
+m4_define([ust_version_name], [[Codename TBD]])
+m4_define([ust_version_description], [[Description TBD]])
+
+# Library version information of "liblttng-ust"
+# Following the numbering scheme proposed by libtool for the library version
+# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
+m4_define([ust_lib_version_current], [1])
+m4_define([ust_lib_version_revision], [0])
+m4_define([ust_lib_version_age], [0])
+m4_define([ust_lib_version], ust_lib_version_current[:]ust_lib_version_revision[:]ust_lib_version_age)
+# Library version information of "liblttng-ust-ctl"
# Following the numbering scheme proposed by libtool for the library version
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
-# This is the library version of liblttng-ust.
-m4_define([UST_LIB_V_MAJOR], [1])
-m4_define([UST_LIB_V_MINOR], [0])
-m4_define([UST_LIB_V_PATCH], [0])
+m4_define([ust_ctl_lib_version_current], [5])
+m4_define([ust_ctl_lib_version_revision], [0])
+m4_define([ust_ctl_lib_version_age], [0])
+m4_define([ust_ctl_lib_version], ust_ctl_lib_version_current[:]ust_ctl_lib_version_revision[:]ust_ctl_lib_version_age)
+
-AC_SUBST([LTTNG_UST_LIBRARY_VERSION], [UST_LIB_V_MAJOR:UST_LIB_V_MINOR:UST_LIB_V_PATCH])
-AC_DEFINE([CONFIG_LTTNG_UST_LIBRARY_VERSION_MAJOR], [UST_LIB_V_MAJOR], [Major SONAME number of the ust library])
-# note: remember to update tracepoint.h dlopen() to match this version
-# number. TODO: eventually automate by exporting the major number.
+## ##
+## Autoconf base setup ##
+## ##
-# This is the library version of liblttng-ust-ctl, used internally by
-# liblttng-ust, lttng-sessiond, and lttng-consumerd.
-AC_SUBST([LTTNG_UST_CTL_LIBRARY_VERSION], [5:0:0])
+AC_PREREQ([2.69])
+AC_INIT([lttng-ust],[ust_version],[mathieu dot desnoyers at efficios dot com],[],[https://lttng.org])
-AC_CONFIG_HEADERS([include/config.h include/lttng/ust-config.h])
+AC_CONFIG_HEADERS([include/config.h include/lttng/ust-config.h include/lttng/ust-version.h])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([include/lttng/tracepoint.h])
AC_CANONICAL_TARGET
AC_CANONICAL_HOST
+
+## ##
+## Automake base setup ##
+## ##
+
AM_INIT_AUTOMAKE([1.12 foreign dist-bzip2 no-dist-gzip tar-ustar nostdinc -Wall -Wno-portability -Werror])
AM_MAINTAINER_MODE([enable])
AM_CONDITIONAL([ENABLE_MAN_PAGES], [test "x$man_pages_opt" != "xno"])
AM_CONDITIONAL([HAVE_ASCIIDOC_XMLTO], [test "x$have_asciidoc_xmlto" = "xyes"])
+
+# Defined in include/lttng/ust-version.h
+AC_DEFINE([LTTNG_UST_MAJOR_VERSION], ust_version_major, [LTTng UST major version])
+AC_DEFINE([LTTNG_UST_MINOR_VERSION], ust_version_minor, [LTTng UST minor version])
+AC_DEFINE([LTTNG_UST_PATCHLEVEL_VERSION], ust_version_patch, [LTTng UST patch version])
+AC_DEFINE([LTTNG_UST_VERSION], ["]ust_version["], [LTTng UST version string])
+AC_DEFINE([LTTNG_UST_LIB_SONAME_MAJOR], [ust_lib_version_current], [Major SONAME number of liblttng-ust])
+AC_DEFINE([LTTNG_UST_CTL_LIB_SONAME_MAJOR], [ust_ctl_lib_version_current], [Major SONAME number of liblttng-ust-ctl])
+
+
AM_CFLAGS="-Wall $URCU_CFLAGS $PTHREAD_CFLAGS"
AC_SUBST(AM_CFLAGS)
AC_SUBST(JNI_CPPFLAGS)
+
+## ##
+## Output files generated by configure ##
+## ##
+
+# List of files to be generated from '.in' templates by AC_OUTPUT
AC_CONFIG_FILES([
Makefile
doc/Makefile
doc/examples/Makefile
doc/man/Makefile
include/Makefile
- include/lttng/ust-version.h
snprintf/Makefile
libcounter/Makefile
libmsgpack/Makefile
AC_OUTPUT
-#
-# Mini-report on what will be built.
-#
+## ##
+## Mini-report on what will be built. ##
+## ##
PPRINT_INIT
PPRINT_SET_INDENT(1)
PPRINT_SET_TS(38)
AS_ECHO
-AS_ECHO("${PPRINT_COLOR_BLDBLU}LTTng-ust $PACKAGE_VERSION \"V_NAME\"$PPRINT_COLOR_RST")
+AS_IF([test -n "ust_version_name"], [
+ AS_ECHO("${PPRINT_COLOR_BLDBLU}LTTng-ust $PACKAGE_VERSION \"ust_version_name\"$PPRINT_COLOR_RST")
+], [
+ AS_ECHO("${PPRINT_COLOR_BLDBLU}LTTng-ust $PACKAGE_VERSION")
+])
+
AS_ECHO
-AS_ECHO("V_DESC")
+AS_IF([test -n "ust_version_description"], [
+ AS_IF([test -n "$FOLD"], [
+ AS_ECHO("`AS_ECHO("ust_version_description") | $FOLD -s`")
+ ], [
+ AS_ECHO("ust_version_description")
+ ])
+ AS_ECHO
+])
-AS_ECHO
PPRINT_SUBTITLE([System])
PPRINT_PROP_STRING([Target architecture], $host_cpu)