summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-16 21:41:41 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-19 17:30:15 -0700
commit334dc4f4df69d780f312f23b860df11bee5e9009 (patch)
tree659b0cf8ac0703a3a56bc908aaaf64ef8a4bdc61 /configure.ac
parente086eb1bf49f2a8c270eaebd5beb595c1dc2973e (diff)
Set Xcursor.h version numbers from configure.ac
Based on similar commit dac73a519816 to libXft Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 15 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 80d4a80..f7e777e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,14 +24,12 @@
AC_PREREQ([2.60])
#
# This is the package version number, not the shared library
-# version. This same version number must appear in Xcursor.h
-# Yes, it is a pain to synchronize version numbers. Unfortunately, it's
-# not possible to extract the version number here from Xcursor.h
+# version. This version number will be substituted into Xcursor.h
#
AC_INIT([libXcursor], [1.1.12],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],[libXcursor])
AC_CONFIG_SRCDIR([Makefile.am])
-AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_HEADERS([config.h include/X11/Xcursor/Xcursor.h])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -46,6 +44,19 @@ m4_ifndef([XORG_MACROS_VERSION],
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
+# Set library version for Xcursor.h from package version set in AC_INIT
+# copied from PACKAGE_VERSION_* settings in XORG_VERSION
+AC_DEFINE_UNQUOTED([XCURSOR_LIB_MAJOR],
+ [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+ [Major version of libXcursor])
+AC_DEFINE_UNQUOTED([XCURSOR_LIB_MINOR],
+ [`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`],
+ [Minor version of libXcursor])
+AC_DEFINE_UNQUOTED([XCURSOR_LIB_REVISION],
+ [`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`],
+ [Micro revision of libXcursor])
+
+
AC_ARG_WITH(icondir,
AS_HELP_STRING([--with-icondir=<path>],
[Set default icon directory (default: ${datadir}/icons)]),