AC_CONFIG_SRCDIR([ustctl/ustctl.c])
AC_CONFIG_HEADERS([config.h include/ust/config.h])
AH_TEMPLATE([HAVE_EFFICIENT_UNALIGNED_ACCESS], [Use efficient unaligned access.])
+# Compute minor/major version numbers
+major_version=`echo AC_PACKAGE_VERSION | sed 's/\..*//'`
+minor_version=`echo AC_PACKAGE_VERSION | sed 's/.*\.//' | sed 's/^0//'`
+AC_SUBST([MAJOR_VERSION], [$major_version])
+AC_SUBST([MINOR_VERSION], [$minor_version])
+AC_DEFINE_UNQUOTED([VERSION_MAJOR], $major_version, [UST major version number])
+AC_DEFINE_UNQUOTED([VERSION_MINOR], $minor_version, [UST minor version number])
+
# Checks for programs.
AC_PROG_CC
libustctl/Makefile
snprintf/Makefile
ust.pc
+ include/ust/version.h
])
AC_OUTPUT
--- /dev/null
+#ifndef _UST_VERSION_H
+#define _UST_VERSION_H
+
+/*
+ * ust/version.h.in. Contains the UST versions
+ *
+ * (C) Copyright 2011 Yannick Brosseau <Yannick.Brosseau@polymtl.ca>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define UST_MAJOR_VERSION @MAJOR_VERSION@
+#define UST_MINOR_VERSION @MINOR_VERSION@
+#define UST_VERSION @PACKAGE_VERSION@
+
+#endif /* _UST_VERSION_H */