On Fri, 2010-04-16 at 06:31 -0700, Dan Nicholson wrote:

> It might be nicer, but could get messy when you consider all the
> corner cases.
> 

True, and the mess can be contained in a macro. Reusing the design for
ChangeLog is worth a shot. 
Not to mention the script brings a mess of it's own in the build. It
introduces multiple points of failure.
Finding a home for the mess is not obvious. 

.PHONY: xorg-git-version.h

xorg-git-version.h:
       $(XORG_GENERATE_VERSION_CMD)


In xserver/m4/xorg_generate_version.m4:
(Replace the ChangeLog script with generate version script.)

AC_DEFUN([XORG_GENERATE_VERSION], [
XORG_GENERATE_VERSION_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > 
\$(top_srcdir)/.changelog.tmp && \
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([XORG_GENERATE_VERSION_CMD])
]) # XORG_GENERATE_VERSION


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.


Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to