Index: build_shared/Makefile_build_gensrc.am_fragment
===================================================================
--- build_shared/Makefile_build_gensrc.am_fragment	(revision 2071)
+++ build_shared/Makefile_build_gensrc.am_fragment	(working copy)
@@ -16,11 +16,37 @@
 ## files_all_cc			libgtkmm_la_SOURCES = $(files_all_cc)
 ## common_ldflags		libgtkmm_la_LDFLAGS = $(common_ldflags)
 
+tools_dir	= $(top_srcdir)/tools
+tools_dir_m4= $(top_srcdir)/tools/m4
+tools_dir_pm= $(top_srcdir)/tools/pm
 
+gensrc_destdir = $(srcdir)/../$(sublib_name)
+
+include $(top_srcdir)/tools/Makefile_list_of_sources.am_fragment
+tools_m4	= $(files_tools_m4:%.m4=$(tools_dir_m4)/%.m4)
+
 include $(srcdir)/../src/Makefile_list_of_hg.am_fragment
 
-files_built_cc		= $(files_hg:.hg=.cc) wrap_init.cc
+#Installed gtkmmproc stuff, from gtkmm:
+gmmproc_path	= $(GMM_PROC)
+gmmproc_dir	= $(GMM_PROCDIR)
+
+# We use our own m4 and pm files as well as the ones installed by gtkmm:
+# Our override m4 include seems to need to be before the default one.
+gmmproc_args	= -I $(tools_dir_m4) --defs $(srcdir)/../src
+run_gmmproc	= $(gmmproc_path) $(gmmproc_args)
+
+files_ccg		= $(files_hg:%.hg=%.ccg)
+files_built_cc_ccg	= $(files_hg:.hg=.cc)
+files_built_cc		= $(files_built_cc_ccg) wrap_init.cc
 files_built_h		= $(files_hg:.hg=.h)
 files_extra_h		+= wrap_init.h
 
+BUILT_SOURCES = $(files_built_h)
+
+$(files_built_h): $(addprefix $(srcdir)/../src/,$(files_hg))
+	$(run_gmmproc) $(notdir $(<:.hg=)) $(srcdir)/../src $(srcdir)
+$(files_built_cc_ccg): $(addprefix $(srcdir)/../src/,$(files_ccg))
+	$(run_gmmproc) $(notdir $(<:.ccg=)) $(srcdir)/../src $(srcdir)
+
 include $(top_srcdir)/build_shared/Makefile_build.am_fragment
