<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.26.0">
</HEAD>
<BODY>
On Fri, 2010-04-16 at 06:31 -0700, Dan Nicholson wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
<TT><FONT COLOR="#1a1a1a">It might be nicer, but could get messy when you consider all the corner cases.</FONT></TT><BR>
<BR>
</BLOCKQUOTE>
True, and the mess can be contained in a macro. Reusing the design for ChangeLog is worth a shot. <BR>
Not to mention the script brings a mess of it's own in the build. It introduces multiple points of failure.<BR>
Finding a home for the mess is not obvious. <BR>
<BR>
<TT><FONT COLOR="#1a1a1a">.PHONY: xorg-git-version.h</FONT></TT>
<PRE>
<TT><FONT COLOR="#1a1a1a">xorg-git-version.h:</FONT></TT>
<TT><FONT COLOR="#1a1a1a"> </FONT></TT><TT>$(XORG_GENERATE_VERSION_CMD)</TT>
In xserver/m4/xorg_generate_version.m4:
(Replace the ChangeLog script with generate version script.)
AC_DEFUN([<TT>XORG_GENERATE_VERSION</TT>], [
<TT>XORG_GENERATE_VERSION</TT>_CMD="(GIT_DIR=\$(top_srcdir)/.git git lo<TT><FONT COLOR="#1a1a1a">g > \$(top_srcdir)/.changelog.tmp && \</FONT></TT>
mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
echo 'git directory not found: installing possibly empty changelog.' >&2)"
AC_SUBST([<TT>XORG_GENERATE_VERSION</TT>_CMD])
]) # <TT>XORG_GENERATE_VERSION</TT>
</PRE>
I went through the same thought process with the INSTALL_CMD. I started with something different and ended up copying and modifying the ChangeLog command because it did consider all the corner cases. The script is just a bit more complex, but it does not matter as it is hidden. At the end of the day, it just writes a file.<BR>
<BR>
<BR>
</BODY>
</HTML>