[PATCH v3 util-macros] XORG_GIT_MODULE_VERSION: writes module version in xorg-git-version.h

Gaetan Nadon memsize at videotron.ca
Wed Apr 21 13:35:09 PDT 2010


Generates the git module version according to the "git describe HEAD"
If not building under git, #undef XORG_GIT_VERSION is written

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 xorg-macros.m4.in |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index 916b472..c5f5a5b 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -1009,3 +1009,19 @@ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
 AC_SUBST([INSTALL_CMD])
 ]) # XORG_INSTALL
+
+# XORG_GIT_MODULE_VERSION()
+# -------------------------
+# Minimum version: 1.8.0
+#
+# Generates the git module version according to the "git describe HEAD"
+# If not building under git, #undef XORG_GIT_VERSION is written
+#
+AC_DEFUN([XORG_GIT_MODULE_VERSION], [
+GIT_MODULE_VERSION_CMD="VER=\`GIT_DIR=\$(top_srcdir)/.git git describe HEAD 2>/dev/null\`; \
+OUTSTR=\"\#undef XORG_GIT_VERSION\" ; \
+test -n \"\$\$VER\" && OUTSTR=\"\#define XORG_GIT_VERSION \$\$VER\"; \
+test -e \"\$(@)\" || echo \"\$\$OUTSTR\" > \"\$(@)\"; \
+CONTENT=\`cat \$(@)\` && test \"\$\$CONTENT\" = \"\$\$OUTSTR\" || echo \$\$OUTSTR > \$(@);"
+AC_SUBST([GIT_MODULE_VERSION_CMD])
+]) # XORG_GIT_MODULE_VERSION
-- 
1.6.0.4

Third edition.

Removed dirty repo marking
replace OUTFILE with $@



More information about the xorg-devel mailing list