AC_INIT([libsigrok], [sr_package_version], [sigrok-devel@lists.sourceforge.net],
[libsigrok], [http://www.sigrok.org])
-AC_CONFIG_HEADER([config.h])
+AC_CONFIG_HEADERS([config.h include/libsigrok/version.h])
AC_CONFIG_MACRO_DIR([autostuff])
AC_CONFIG_AUX_DIR([autostuff])
# We require at least 0.22, as "Requires.private" behaviour changed there.
PKG_PROG_PKG_CONFIG([0.22])
+AC_SUBST([SR_PACKAGE_VERSION], [sr_package_version])
+
+AC_DEFINE([SR_PACKAGE_VERSION_MAJOR], [sr_package_version_major], [.])
+AC_DEFINE([SR_PACKAGE_VERSION_MINOR], [sr_package_version_minor], [.])
+AC_DEFINE([SR_PACKAGE_VERSION_MICRO], [sr_package_version_micro], [.])
+AC_DEFINE_UNQUOTED([SR_PACKAGE_VERSION_STRING], ["$SR_PACKAGE_VERSION"], [.])
+
# Library version for libsigrok (NOT the same as the package version).
# Carefully read the libtool docs before updating these numbers!
# The algorithm for determining which number to change (and how) is nontrivial!
SR_LIB_VERSION_CURRENT=2
SR_LIB_VERSION_REVISION=0
SR_LIB_VERSION_AGE=0
-SR_LIB_VERSION="$SR_LIB_VERSION_CURRENT:$SR_LIB_VERSION_REVISION:$SR_LIB_VERSION_AGE"
-SR_LIB_LDFLAGS="-version-info $SR_LIB_VERSION"
-AC_SUBST(SR_LIB_VERSION_CURRENT)
-AC_SUBST(SR_LIB_VERSION_REVISION)
-AC_SUBST(SR_LIB_VERSION_AGE)
-AC_SUBST(SR_LIB_VERSION)
-AC_SUBST(SR_LIB_LDFLAGS)
+
+AC_SUBST([SR_LIB_VERSION], ["$SR_LIB_VERSION_CURRENT:$SR_LIB_VERSION_REVISION:$SR_LIB_VERSION_AGE"])
+AC_SUBST([SR_LIB_LDFLAGS], ["-version-info $SR_LIB_VERSION"])
+
+AC_DEFINE_UNQUOTED([SR_LIB_VERSION_CURRENT], [$SR_LIB_VERSION_CURRENT], [.])
+AC_DEFINE_UNQUOTED([SR_LIB_VERSION_REVISION], [$SR_LIB_VERSION_REVISION], [.])
+AC_DEFINE_UNQUOTED([SR_LIB_VERSION_AGE], [$SR_LIB_VERSION_AGE], [.])
+AC_DEFINE_UNQUOTED([SR_LIB_VERSION_STRING], ["$SR_LIB_VERSION"], [.])
AC_ARG_ENABLE(all-drivers, AC_HELP_STRING([--enable-all-drivers],
[enable all drivers by default [default=yes]]),
AC_SUBST(MAKEFLAGS, '--no-print-directory')
AC_SUBST(AM_LIBTOOLFLAGS, '--silent')
-SR_PACKAGE_VERSION_MAJOR=sr_package_version_major
-SR_PACKAGE_VERSION_MINOR=sr_package_version_minor
-SR_PACKAGE_VERSION_MICRO=sr_package_version_micro
-SR_PACKAGE_VERSION=sr_package_version
-
-AC_SUBST(SR_PACKAGE_VERSION_MAJOR)
-AC_SUBST(SR_PACKAGE_VERSION_MINOR)
-AC_SUBST(SR_PACKAGE_VERSION_MICRO)
-AC_SUBST(SR_PACKAGE_VERSION)
-
-AC_CONFIG_FILES([Makefile include/libsigrok/version.h libsigrok.pc
- bindings/cxx/libsigrokcxx.pc])
+AC_CONFIG_FILES([Makefile libsigrok.pc bindings/cxx/libsigrokcxx.pc])
AC_OUTPUT
*/
/** The libsigrok package 'major' version number. */
-#define SR_PACKAGE_VERSION_MAJOR @SR_PACKAGE_VERSION_MAJOR@
+#undef SR_PACKAGE_VERSION_MAJOR
/** The libsigrok package 'minor' version number. */
-#define SR_PACKAGE_VERSION_MINOR @SR_PACKAGE_VERSION_MINOR@
+#undef SR_PACKAGE_VERSION_MINOR
/** The libsigrok package 'micro' version number. */
-#define SR_PACKAGE_VERSION_MICRO @SR_PACKAGE_VERSION_MICRO@
+#undef SR_PACKAGE_VERSION_MICRO
/** The libsigrok package version ("major.minor.micro") as string. */
-#define SR_PACKAGE_VERSION_STRING "@SR_PACKAGE_VERSION@"
+#undef SR_PACKAGE_VERSION_STRING
/*
* Library/libtool version macros (can be used for conditional compilation).
*/
/** The libsigrok libtool 'current' version number. */
-#define SR_LIB_VERSION_CURRENT @SR_LIB_VERSION_CURRENT@
+#undef SR_LIB_VERSION_CURRENT
/** The libsigrok libtool 'revision' version number. */
-#define SR_LIB_VERSION_REVISION @SR_LIB_VERSION_REVISION@
+#undef SR_LIB_VERSION_REVISION
/** The libsigrok libtool 'age' version number. */
-#define SR_LIB_VERSION_AGE @SR_LIB_VERSION_AGE@
+#undef SR_LIB_VERSION_AGE
/** The libsigrok libtool version ("current:revision:age") as string. */
-#define SR_LIB_VERSION_STRING "@SR_LIB_VERSION@"
+#undef SR_LIB_VERSION_STRING
/** @} */