Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/vte/Makefile.am,v
retrieving revision 1.21
diff -u -p -r1.21 Makefile.am
--- Makefile.am	20 Apr 2004 05:54:34 -0000	1.21
+++ Makefile.am	8 Nov 2005 02:39:16 -0000
@@ -1,5 +1,5 @@
 SUBDIRS = src python termcaps po doc
-EXTRA_DIST = HACKING vte.spec vte.pc.in vte-uninstalled.pc.in MESSAGE-OF-DOOM
+EXTRA_DIST = HACKING vte.spec vte.pc.in vte-uninstalled.pc.in
 if BUILD_GNOME_PTY_HELPER
 SUBDIRS += gnome-pty-helper
 endif
Index: autogen.sh
===================================================================
RCS file: /cvs/gnome/vte/autogen.sh,v
retrieving revision 1.25
diff -u -p -r1.25 autogen.sh
--- autogen.sh	29 Mar 2005 17:38:13 -0000	1.25
+++ autogen.sh	8 Nov 2005 02:39:16 -0000
@@ -103,7 +103,6 @@ automake-$automakev -a -c $am_opt
 $autoconf
 
 cd gnome-pty-helper
-$autoheader
 aclocal-$automakev $ACLOCAL_FLAGS
 $autoheader
 automake-$automakev -a -c $am_opt
Index: configure.in
===================================================================
RCS file: /cvs/gnome/vte/configure.in,v
retrieving revision 1.160
diff -u -p -r1.160 configure.in
--- configure.in	12 Aug 2005 14:21:46 -0000	1.160
+++ configure.in	8 Nov 2005 02:39:16 -0000
@@ -363,8 +363,16 @@ if $BUILD_PYTHON ; then
 	if pkg-config --exists pygtk-2.0 ; then
 		AC_MSG_RESULT([found])
 		PKG_CHECK_MODULES(PYGTK,[pygtk-2.0])
-		PYGTK_DATADIR=`pkg-config --variable=datadir pygtk-2.0`
-		AC_SUBST(PYGTK_DATADIR)
+
+		AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
+		if test "x$PYGTK_CODEGEN" = xno; then
+		  AC_MSG_ERROR(could not find pygtk-codegen-2.0 script)
+		fi
+
+		AC_MSG_CHECKING(for pygtk defs)
+		PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
+		AC_SUBST(PYGTK_DEFSDIR)
+		AC_MSG_RESULT($PYGTK_DEFSDIR)
 	else
 		AC_MSG_RESULT([not found])
 		BUILD_PYTHON=false
Index: python/Makefile.am
===================================================================
RCS file: /cvs/gnome/vte/python/Makefile.am,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile.am
--- python/Makefile.am	20 Apr 2004 05:37:50 -0000	1.10
+++ python/Makefile.am	8 Nov 2005 02:39:16 -0000
@@ -1,4 +1,4 @@
-EXTRA_DIST = vte.defs vte.override
+EXTRA_DIST = vte.defs vte.override cat.py unrealize.py vte-demo.py
 
 PYTHON_MODULES = vtemodule.la
 
@@ -9,11 +9,22 @@ pythonsiteexec_LTLIBRARIES = $(PYTHON_MO
 CLEANFILES = vte.c
 
 vtemodule_la_CFLAGS = @VTE_CFLAGS@ @X_CFLAGS@ @PYTHON_INCLUDES@ @PYGTK_CFLAGS@
-vtemodule_la_SOURCES = vtemodule.c vte.c
+vtemodule_la_SOURCES = vtemodule.c
 vtemodule_la_LIBADD = $(top_builddir)/src/libvte.la @LIBS@ @PYGTK_LIBS@ @VTE_LIBS@ @X_LIBS@
-vtemodule_la_LDFLAGS = -module -avoid-version -export-symbols-regex=initvte
+vtemodule_la_LDFLAGS = -module -avoid-version -export-symbols-regex initvte
+nodist_vtemodule_la_SOURCES = vte.c
 
 vte.c: vte.defs vte.override
-	pygtk-codegen-2.0 -p py$(PACKAGE) -o vte.override --register @PYGTK_DATADIR@/pygtk/2.0/defs/gtk-types.defs --register @PYGTK_DATADIR@/pygtk/2.0/defs/gdk-types.defs --register @PYGTK_DATADIR@/pygtk/2.0/defs/pango-types.defs $< > $@
+
+.defs.c:
+	(cd $(srcdir) \
+	 && $(PYGTK_CODEGEN) \
+            --register $(PYGTK_DEFSDIR)/pango-types.defs \
+            --register $(PYGTK_DEFSDIR)/gdk-types.defs \
+            --register $(PYGTK_DEFSDIR)/gtk-types.defs \
+            --override $*.override \
+            --prefix py$* $*.defs) > gen-$*.c \
+        && cp gen-$*.c $*.c \
+        && rm -f gen-$*.c
 
 endif
