summaryrefslogtreecommitdiff
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
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>
-rw-r--r--configure.ac19
-rw-r--r--include/X11/Xcursor/Xcursor.h.in (renamed from include/X11/Xcursor/Xcursor.h)11
2 files changed, 20 insertions, 10 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)]),
diff --git a/include/X11/Xcursor/Xcursor.h b/include/X11/Xcursor/Xcursor.h.in
index a2c0488..1a14386 100644
--- a/include/X11/Xcursor/Xcursor.h
+++ b/include/X11/Xcursor/Xcursor.h.in
@@ -69,14 +69,13 @@ typedef XcursorUInt XcursorPixel;
#define XCURSOR_MAGIC 0x72756358 /* "Xcur" LSBFirst */
/*
- * Current Xcursor version number. This same number
- * must appear in the Xcursor configure.ac file. Yes,
- * it'a a pain to synchronize version numbers like this.
+ * Current Xcursor version number. Will be substituted by configure
+ * from the version in the libXcursor configure.ac file.
*/
-#define XCURSOR_LIB_MAJOR 1
-#define XCURSOR_LIB_MINOR 1
-#define XCURSOR_LIB_REVISION 9
+#undef XCURSOR_LIB_MAJOR
+#undef XCURSOR_LIB_MINOR
+#undef XCURSOR_LIB_REVISION
#define XCURSOR_LIB_VERSION ((XCURSOR_LIB_MAJOR * 10000) + \
(XCURSOR_LIB_MINOR * 100) + \
(XCURSOR_LIB_REVISION))