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

Dan Nicholson dbn.lists at gmail.com
Wed Apr 21 06:20:36 PDT 2010


On Tue, Apr 20, 2010 at 11:06 PM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
>
> would also be good checking through Matthias' script from radeonhd for any
> obvious use-cases that this patch doesn't cover. It certainly seems more
> complex.

Another way to handle this would be distributing a script from the
macro. So, instead of substituting a huge make command, the macro
would install a script which you'd just have to distribute from the
Makefile. Then it would be a lot easier to have a complex script. Just
a scratch implementation:

AC_DEFUN([XORG_GIT_MODULE_VERSION],
[# use m4 so it only happens when you run autoconf
m4_syscmd([install -m755 /usr/share/xorg-macros/xorg-git-version.sh "$srcdir"])
AC_SUBST([xorg_git_version_sh], ['$(top_srcdir)/xorg-git-version.sh'])
])

module's configure.ac:
XORG_GIT_MODULE_VERSION

module's Makefile.am:
EXTRA_DIST = $(xorg_git_version_sh)
xorg-git-version.h:
    $(SHELL) $(xorg_git_version_sh) $@
DISTCLEANFILES = xorg-git-version.h
.PHONY: xorg-git-version.h

And then you could put any fanciness you want in the script. The only
minor worry I'd have is that the script wouldn't have all the make
variables available to it like $(top_srcdir) since automake
intentionally unexports the variables.

--
Dan


More information about the xorg-devel mailing list