[glibmm] gmmproc: Write glibmm version in generated files.
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] gmmproc: Write glibmm version in generated files.
- Date: Fri, 7 Jun 2013 14:56:39 +0000 (UTC)
commit 621835cfd37ed364945eb7653bc6c3b4ea5f7499
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Fri Jun 7 16:52:48 2013 +0200
gmmproc: Write glibmm version in generated files.
* tools/gmmproc.in: Use autoconf's substitution variable @PACKAGE_VERSION
* tools/m4/base.m4: _START() macro: Add argument glibmm_version.
* tools/pm/Output.pm: output_temp_g1(): Add argument glibmm_version.
The problems with gtkmm 2.24.3 (bug 697835 and bug 700495) show that it can
be useful to easily see which version of gmmproc/glibmm has generated a file.
ChangeLog | 11 +++++++++++
tools/gmmproc.in | 7 +++++--
tools/m4/base.m4 | 9 +++++----
tools/pm/Output.pm | 9 ++++-----
4 files changed, 25 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 589ebca..67e5620 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-06-07 Kjell Ahlstedt <kjell ahlstedt bredband net>
+
+ gmmproc: Write glibmm version in generated files.
+
+ * tools/gmmproc.in: Use autoconf's substitution variable @PACKAGE_VERSION
+ * tools/m4/base.m4: _START() macro: Add argument glibmm_version.
+ * tools/pm/Output.pm: output_temp_g1(): Add argument glibmm_version.
+
+ The problems with gtkmm 2.24.3 (bug 697835 and bug 700495) show that it can
+ be useful to easily see which version of gmmproc/glibmm has generated a file.
+
2013-06-06 José Alburquerque <jaalburquerque gmail com>
Gio::DBusInterfaceSkeleton: Constant corrections.
diff --git a/tools/gmmproc.in b/tools/gmmproc.in
index 68f53ca..eb9b35f 100644
--- a/tools/gmmproc.in
+++ b/tools/gmmproc.in
@@ -27,7 +27,8 @@
#
# 'classes':
# WrapParser: steps through .hg and .ccg files, outputting appropriate m4 code with Outputter.
-# Outputter: Used by WrapParser to ouput wrapper code. Ouputs *.g1 temp file and uses m4 to generate *.g2
from it. Then outputs .h and .cc files.
+# Outputter: Used by WrapParser to output wrapper code. Outputs *.g1 temp file
+# and uses m4 to generate *.g2 from it. Then outputs .h and .cc files.
# Function: Contains information about C and C++ functions and signals.
#
######################################################################
@@ -36,6 +37,7 @@
$main::procdir;
$main::m4path;
+$main::glibmm_version;
BEGIN {
# get prefix info from configure
@@ -46,6 +48,7 @@ BEGIN {
# This line must match the install directory
$main::procdir = $libdir . '/@GLIBMM_MODULE_NAME@/proc';
$main::m4path = "@M4@";
+ $main::glibmm_version = "@PACKAGE_VERSION@";
push(@INC, $main::procdir . '/pm');
}
@@ -89,7 +92,7 @@ $objWrapParser->read_file($main::srcdir, $main::source);
$objWrapParser->parse_and_build_output();
# Write out *.g1 temporary file:
-$objOutputter->output_temp_g1($$objWrapParser{module}); # e.g. "gtk"
+$objOutputter->output_temp_g1($$objWrapParser{module}, $main::glibmm_version); # e.g. gtkmm, 2.38.0
# Execute m4 to get *.g2 file:
{
diff --git a/tools/m4/base.m4 b/tools/m4/base.m4
index c846cfc..2824026 100644
--- a/tools/m4/base.m4
+++ b/tools/m4/base.m4
@@ -238,13 +238,14 @@ _POP()
dnl Start of processing
dnl
-dnl _START(filname, module,modulecanonical) .e.g _START(button, gtkmm, gtkmm)
+dnl _START(filename,module,module_canonical,glibmm_version) .e.g _START(button, gtkmm, gtkmm, 2.38.0)
define(`_START',`dnl
define(`__MODULE__',$2)dnl
define(`__MODULE_CANONICAL__',$3)dnl
define(`__HEADER_GUARD__',`_`'_UPPER(m4_translit(`$3`'_`'$1', `-', `_'))')dnl
define(`__FILE__',$1)dnl
define(`__DEPRECATION_GUARD__',`_UPPER($3)'`_DISABLE_DEPRECATED')dnl
+define(`__GLIBMM_VERSION__',$4)dnl
_SECTION(SECTION_HEADER1)
')
@@ -281,7 +282,7 @@ m4_divert(0)dnl
#S 0 dnl Marks the beginning of the header file.
// -*- c++ -*-
-// Generated by gtkmmproc -- DO NOT MODIFY!
+// Generated by gmmproc __GLIBMM_VERSION__ -- DO NOT MODIFY!
#ifndef __HEADER_GUARD__`'_H
#define __HEADER_GUARD__`'_H
@@ -304,7 +305,7 @@ _DEPRECATE_IFDEF_CLASS_END
#S 1 dnl Marks the beginning of the private header file.
// -*- c++ -*-
-// Generated by gtkmmproc -- DO NOT MODIFY!
+// Generated by gmmproc __GLIBMM_VERSION__ -- DO NOT MODIFY!
#ifndef __HEADER_GUARD__`'_P_H
#define __HEADER_GUARD__`'_P_H
_DEPRECATE_IFDEF_CLASS_START
@@ -314,7 +315,7 @@ _DEPRECATE_IFDEF_CLASS_END
#S 2 dnl Marks the beginning of the source file.
-// Generated by gtkmmproc -- DO NOT MODIFY!
+// Generated by gmmproc __GLIBMM_VERSION__ -- DO NOT MODIFY!
_IMPORT(SECTION_CC_PRE_INCLUDES)
diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm
index 2d093d5..c7adaec 100644
--- a/tools/pm/Output.pm
+++ b/tools/pm/Output.pm
@@ -817,19 +817,18 @@ sub add_m4_quotes($)
$$text = "`" . $$text . "'";
}
-# vpod output_temp_g1($filename, $section) e.g. output_temp_g1(button, gtk)
-sub output_temp_g1($$)
+# void output_temp_g1($module, $glibmm_version) e.g. output_temp_g1(gtkmm, 2.38.0)
+sub output_temp_g1($$$)
{
- my ($self, $section) = @_;
+ my ($self, $module, $glibmm_version) = @_;
# Write out *.g1 temporary file
open(FILE, '>', "$$self{tmpdir}/gtkmmproc_$$.g1"); # $$ is the Process ID
print FILE "include(base.m4)dnl\n";
- my $module = $section;
my $module_canonical = Util::string_canonical($module); #In case there is a / character in the module.
- print FILE "_START($$self{source},$module,$module_canonical)dnl\n";
+ print FILE "_START($$self{source},$module,$module_canonical,$glibmm_version)dnl\n";
print FILE join("", @{$$self{out}});
print FILE "_END()\n";
close(FILE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]