[glibmm] Prepend tools/pm/ to Perl include path



commit 21479056f6895e940c5a0518aa033c813cf2d873
Author: Daniel Elstner <danielk openismus com>
Date:   Tue Aug 18 17:53:39 2009 +0200

    Prepend tools/pm/ to Perl include path
    
    * g{lib,io}/src/Makefile.am (gmmproc): Pass -I$(top_srcdir)/tools/pm
    to the Perl interpreter when invoking the local gmmproc, so that it
    will pick up the modules from the source tree instead of an existing
    glibmm installation.
    * tools/gmmproc.in (BEGIN): Substitute @GLIBMM_MODULE_NAME@ instead
    of hard-coding the location.

 ChangeLog            |   11 +++++++++++
 gio/src/Makefile.am  |    2 +-
 glib/src/Makefile.am |    4 ++--
 tools/gmmproc.in     |   26 +++++++++-----------------
 4 files changed, 23 insertions(+), 20 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2e5c9c3..7b9fd9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2009-08-18  Daniel Elstner  <danielk openismus com>
 
+	Prepend tools/pm/ to Perl include path
+
+	* g{lib,io}/src/Makefile.am (gmmproc): Pass -I$(top_srcdir)/tools/pm
+	to the Perl interpreter when invoking the local gmmproc, so that it
+	will pick up the modules from the source tree instead of an existing
+	glibmm installation.
+	* tools/gmmproc.in (BEGIN): Substitute @GLIBMM_MODULE_NAME@ instead
+	of hard-coding the location.
+
+2009-08-18  Daniel Elstner  <danielk openismus com>
+
 	Implement parametric Doxygen alias @since{m,n}
 
 	* docs/reference/Doxyfile.in (ALIASES): Define a parametrized alias
diff --git a/gio/src/Makefile.am b/gio/src/Makefile.am
index 469c22b..226d3a9 100644
--- a/gio/src/Makefile.am
+++ b/gio/src/Makefile.am
@@ -16,7 +16,7 @@
 ## along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
 # Override code generator commands to use the uninstalled tools.
-gmmproc       = $(PERL) -- $(top_builddir)/tools/gmmproc
+gmmproc = $(PERL) -I$(top_srcdir)/tools/pm -- $(top_builddir)/tools/gmmproc
 gen_wrap_init = $(PERL) -- $(top_builddir)/tools/generate_wrap_init.pl
 
 binding_name    = giomm
diff --git a/glib/src/Makefile.am b/glib/src/Makefile.am
index cb209cd..5561d7b 100644
--- a/glib/src/Makefile.am
+++ b/glib/src/Makefile.am
@@ -16,7 +16,7 @@
 ## along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
 # Override code generator commands to use the uninstalled tools.
-gmmproc       = $(PERL) -- $(top_builddir)/tools/gmmproc
+gmmproc = $(PERL) -I$(top_srcdir)/tools/pm -- $(top_builddir)/tools/gmmproc
 gen_wrap_init = $(PERL) -- $(top_builddir)/tools/generate_wrap_init.pl
 
 binding_name    = glibmm
@@ -34,7 +34,7 @@ include $(top_srcdir)/build/generate-binding.am
 
 files_src_m4 = $(glibmm_files_cc_m4) $(glibmm_files_h_m4)
 
-other_built_sources += $(files_src_m4:%.m4=$(binding_outputdir)/%)
+other_built_sources += $(patsubst %.m4,$(binding_outputdir)/%,$(files_src_m4))
 dist_noinst_DATA    += $(files_src_m4) template.macros.m4
 
 $(binding_outputdir)/%: %.m4 template.macros.m4
diff --git a/tools/gmmproc.in b/tools/gmmproc.in
index 8c05acb..d33e25b 100644
--- a/tools/gmmproc.in
+++ b/tools/gmmproc.in
@@ -43,12 +43,11 @@ BEGIN {
   my $exec_prefix = "@exec_prefix@";
   my $libdir = "@libdir@";
 
-  # This line must match the install directory in m4/Makefile.am
-  $main::procdir = "$libdir/glibmm-2.4/proc";
+  # This line must match the install directory
+  $main::procdir = $libdir . '/@GLIBMM_MODULE_NAME@/proc';
   $main::m4path = "@M4@";
 
-  # This line must match install dir from pm/Makefile.am
-  push @INC,"$main::procdir/pm";
+  push(@INC, $main::procdir . '/pm');
 }
 
 use strict;
@@ -59,21 +58,15 @@ use WrapParser;
 
 # initialize globals 
 @main::macrodirs = ();
-$main::srcdir = ".";
-$main::defsdir = ".";
-$main::source = "";
-$main::debug = 0;
+$main::srcdir    = '.';
+$main::defsdir   = '.';
+$main::source    = '';
 $main::unwrapped = 1;
-
-{ # checking the environment for a set variable can trigger a warning
-  no warnings;
-  $main::debug = 1 if ($ENV{'GMMPROC_DEBUG'} eq 1);
-}
+$main::debug     = (exists $ENV{'GMMPROC_DEBUG'}) ? $ENV{'GMMPROC_DEBUG'} : '';
 
 # prototypes
 sub parse_command_line_args();
 
-
 #main()
 parse_command_line_args();
 
@@ -227,13 +220,12 @@ sub parse_command_line_args()
 
   if ($#ARGV != 1)
   {
-    print STDERR "Invalid number of arguments (", $#ARGV+2, ")\n";
+    print STDERR ('Invalid number of arguments (', $#ARGV + 2, ")\n");
     print_usage();
   }
 
   $main::srcdir = $ARGV[0];
   $main::source = $_;
 
-  push @main::macrodirs,"$main::procdir/m4";
+  push @main::macrodirs, $main::procdir . '/m4';
 }
-



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]