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

@ -514,7 +514,7 @@ sub dissect_element($$$;$$)
} else { } else {
die ("Unrecognized type: $type\n"); die ("Unrecognized type: $type\n");
} }
if ($adjustlength && defined($lentype)) { if ($adjustlength && defined($lentype)) {
# Some requests end with a list of unspecified length # Some requests end with a list of unspecified length
# Adjust the length field here so that the next $lencalc will be accurate # Adjust the length field here so that the next $lencalc will be accurate
@ -912,7 +912,7 @@ static void $header$name(tvbuff_t *tvb, int *offsetp, proto_tree *t, int little_
eot eot
; ;
} }
my $varpat = $header.'_'.$name.'_%s'; my $varpat = $header.'_'.$name.'_%s';
my $humanpat = "$header.$name.%s"; my $humanpat = "$header.$name.%s";
@ -1042,12 +1042,29 @@ eot
push @register, $header; 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 { sub add_generated_header {
my ($out) = @_; my ($out, $using) = @_;
my $ver = find_version($using);
print $out <<eot print $out <<eot
/* Do not modify this file. */ /* Do not modify this file. */
/* It was automatically generated by $0. */ /* It was automatically generated by $0
using $using version $ver */
eot eot
; ;
# Since this file is checked in, add its SVN revision # 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' $error = new IO::File '> x11-extension-errors.h'
or die ("Cannot open x11-extension-errors.h for writing\n"); or die ("Cannot open x11-extension-errors.h for writing\n");
add_generated_header($impl); add_generated_header($impl, 'xcbproto');
add_generated_header($error); add_generated_header($error, 'xcbproto');
# Open the files generated by process-x11-fields.pl for appending # Open the files generated by process-x11-fields.pl for appending
$reg = new IO::File '>> x11-register-info.h' $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') { if (-e 'mesa/src/mesa/glapi/gl_API.xml') {
$enum = new IO::File '> x11-glx-render-enum.h' $enum = new IO::File '> x11-glx-render-enum.h'
or die ("Cannot open x11-glx-render-enum.h for writing\n"); 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 $enum "static const value_string mesa_enum[] = {\n";
print $impl '#include "x11-glx-render-enum.h"'."\n\n"; print $impl '#include "x11-glx-render-enum.h"'."\n\n";
@ -1155,14 +1172,14 @@ static void dispatch_glx_render(tvbuff_t *tvb, packet_info *pinfo, int *offsetp,
op = VALUE16(tvb, *offsetp + 2); op = VALUE16(tvb, *offsetp + 2);
ti = proto_tree_add_uint(t, hf_x11_glx_render_op_name, tvb, *offsetp, len, op); ti = proto_tree_add_uint(t, hf_x11_glx_render_op_name, tvb, *offsetp, len, op);
tt = proto_item_add_subtree(ti, ett_x11_list_of_rectangle); tt = proto_item_add_subtree(ti, ett_x11_list_of_rectangle);
ti = proto_tree_add_item(tt, hf_x11_request_length, tvb, *offsetp, 2, little_endian); ti = proto_tree_add_item(tt, hf_x11_request_length, tvb, *offsetp, 2, little_endian);
*offsetp += 2; *offsetp += 2;
proto_tree_add_item(tt, hf_x11_glx_render_op_name, tvb, *offsetp, 2, little_endian); proto_tree_add_item(tt, hf_x11_glx_render_op_name, tvb, *offsetp, 2, little_endian);
*offsetp += 2; *offsetp += 2;
if (len < 4) { if (len < 4) {
expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR, "Invalid Length"); expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR, "Invalid Length");
/* Eat the rest of the packet, mark it undecoded */ /* Eat the rest of the packet, mark it undecoded */

View File

@ -1,5 +1,6 @@
/* Do not modify this file. */ /* 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$ */ /* $Id$ */
/* /*

View File

@ -1,5 +1,6 @@
/* Do not modify this file. */ /* 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$ */ /* $Id$ */
/* /*
@ -3709,14 +3710,14 @@ static void dispatch_glx_render(tvbuff_t *tvb, packet_info *pinfo, int *offsetp,
op = VALUE16(tvb, *offsetp + 2); op = VALUE16(tvb, *offsetp + 2);
ti = proto_tree_add_uint(t, hf_x11_glx_render_op_name, tvb, *offsetp, len, op); ti = proto_tree_add_uint(t, hf_x11_glx_render_op_name, tvb, *offsetp, len, op);
tt = proto_item_add_subtree(ti, ett_x11_list_of_rectangle); tt = proto_item_add_subtree(ti, ett_x11_list_of_rectangle);
ti = proto_tree_add_item(tt, hf_x11_request_length, tvb, *offsetp, 2, little_endian); ti = proto_tree_add_item(tt, hf_x11_request_length, tvb, *offsetp, 2, little_endian);
*offsetp += 2; *offsetp += 2;
proto_tree_add_item(tt, hf_x11_glx_render_op_name, tvb, *offsetp, 2, little_endian); proto_tree_add_item(tt, hf_x11_glx_render_op_name, tvb, *offsetp, 2, little_endian);
*offsetp += 2; *offsetp += 2;
if (len < 4) { if (len < 4) {
expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR, "Invalid Length"); expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR, "Invalid Length");
/* Eat the rest of the packet, mark it undecoded */ /* Eat the rest of the packet, mark it undecoded */

View File

@ -1,5 +1,6 @@
/* Do not modify this file. */ /* 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$ */ /* $Id$ */
/* /*