Put the git version of mesa and xcbproto in the generated header files.

From me: Don't use 'which' to find git--it wouldn't work on Windows.

svn path=/trunk/; revision=29865
This commit is contained in:
Jeff Morriss 2009-09-11 18:06:50 +00:00
parent d764400291
commit c6261aee41
4 changed files with 34 additions and 14 deletions

View File

@ -1042,12 +1042,29 @@ eot
push @register, $header;
}
sub find_version {
#my $git = `which git`;
#chomp($git);
#-x $git or return 'unknown';
my $lib = shift;
# this will generate an error on stderr if git isn't in our $PATH
# but that's OK. The version is still set to 'unknown' in that case
# and at least the operator could see it.
my $ver = `git --git-dir=$lib/.git describe`;
$ver //= 'unknown';
chomp $ver;
return $ver;
}
sub add_generated_header {
my ($out) = @_;
my ($out, $using) = @_;
my $ver = find_version($using);
print $out <<eot
/* Do not modify this file. */
/* It was automatically generated by $0. */
/* It was automatically generated by $0
using $using version $ver */
eot
;
# Since this file is checked in, add its SVN revision
@ -1090,8 +1107,8 @@ $impl = new IO::File '> x11-extension-implementation.h'
$error = new IO::File '> x11-extension-errors.h'
or die ("Cannot open x11-extension-errors.h for writing\n");
add_generated_header($impl);
add_generated_header($error);
add_generated_header($impl, 'xcbproto');
add_generated_header($error, 'xcbproto');
# Open the files generated by process-x11-fields.pl for appending
$reg = new IO::File '>> x11-register-info.h'
@ -1106,7 +1123,7 @@ print $decl "\n/* Generated by $0 below this line */\n";
if (-e 'mesa/src/mesa/glapi/gl_API.xml') {
$enum = new IO::File '> x11-glx-render-enum.h'
or die ("Cannot open x11-glx-render-enum.h for writing\n");
add_generated_header($enum);
add_generated_header($enum, 'mesa');
print $enum "static const value_string mesa_enum[] = {\n";
print $impl '#include "x11-glx-render-enum.h"'."\n\n";

View File

@ -1,5 +1,6 @@
/* Do not modify this file. */
/* It was automatically generated by process-x11-xcb.pl. */
/* It was automatically generated by process-x11-xcb.pl
using xcbproto version 1.5-4-ga507629 */
/* $Id$ */
/*

View File

@ -1,5 +1,6 @@
/* Do not modify this file. */
/* It was automatically generated by process-x11-xcb.pl. */
/* It was automatically generated by process-x11-xcb.pl
using xcbproto version 1.5-4-ga507629 */
/* $Id$ */
/*

View File

@ -1,5 +1,6 @@
/* Do not modify this file. */
/* It was automatically generated by process-x11-xcb.pl. */
/* It was automatically generated by process-x11-xcb.pl
using mesa version mesa_7_5_1-3181-gd9dc4cb */
/* $Id$ */
/*