diff --git a/configure.in b/configure.in
index a473cde..82a65f7 100644
--- a/configure.in
+++ b/configure.in
@@ -1700,6 +1700,37 @@ AC_SUBST(GDK_DEP_LIBS)
 AC_SUBST(GDK_DEP_CFLAGS)
 
 
+#################################
+# Check for GObject Introspection
+#################################
+have_introspection=false
+PKG_CHECK_MODULES(INTROSPECTION, gobject-introspection-1.0 >= 0.6.2, have_introspection=true, have_introspection=false)
+AM_CONDITIONAL(HAVE_INTROSPECTION, $have_introspection)
+
+G_IR_SCANNER=
+G_IR_COMPILER=
+G_IR_GENERATE=
+GIRDIR=
+TYPELIBDIR=
+if test $have_introspection; then
+   G_IR_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+   G_IR_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+   G_IR_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+   GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+   TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+fi
+AC_SUBST(G_IR_SCANNER)
+AC_SUBST(G_IR_COMPILER)
+AC_SUBST(G_IR_GENERATE)
+AC_SUBST(GIRDIR)
+AC_SUBST(TYPELIBDIR)
+
+GDK_TARGET_GIRS=
+if test "$gdktarget" = x11; then
+   GDK_TARGET_GIRS=xlib-2.0
+fi
+AC_SUBST(GDK_TARGET_GIRS)
+
 ########################################
 # Check for Accessibility Toolkit flags
 ########################################
diff --git a/gdk-pixbuf/Makefile.am b/gdk-pixbuf/Makefile.am
index c1ac554..3db6a1a 100644
--- a/gdk-pixbuf/Makefile.am
+++ b/gdk-pixbuf/Makefile.am
@@ -639,6 +639,48 @@ CLEANFILES += xgen-gmh
 MAINTAINERCLEANFILES += stamp-gdk-pixbuf-marshal.h
 
 #
+# introspection
+#
+GdkPixbuf-2.0.gir: $(libgdk_pixbuf_2_0_la_SOURCES)
+GdkPixbuf-2.0.gir: $(libgdk_pixbufinclude_HEADERS)
+GdkPixbuf-2.0.gir: libgdk_pixbuf-$(GTK_API_VERSION).la
+	$(G_IR_SCANNER) -v --namespace GdkPixbuf \
+	--add-include-path=$(srcdir) \
+	--add-include-path=. \
+	--strip-prefix=Gdk \
+	--nsversion=2.0 \
+	--include=Gio-2.0 \
+	--library=gdk_pixbuf-2.0 \
+	--libtool="$(LIBTOOL)" \
+	--output $@ \
+	--pkg gobject-2.0 \
+	--pkg gio-2.0 \
+	-I$(top_srcdir) \
+	$(GDK_PIXBUF_CFLAGS) \
+	$(libgdk_pixbuf_2_0_la_SOURCES) \
+	$(libgdk_pixbufinclude_HEADERS)
+
+if HAVE_INTROSPECTION
+
+girdir = $(GIRDIR)
+dist_gir_DATA = GdkPixbuf-2.0.gir
+
+CLEANFILES += GdkPixbuf-2.0.gir
+EXTRA_DIST += GdkPixbuf-2.0.gir
+
+typelibsdir = $(TYPELIBDIR)
+typelibs_DATA = GdkPixbuf-2.0.typelib
+
+%.typelib: %.gir $(G_IR_COMPILER)
+	LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) \
+	--includedir=$(srcdir) \
+	--includedir=. \
+	$(G_IR_COMPILER_OPTS) \
+	$< -o $(top_builddir)/gdk-pixbuf/$(@F)
+
+endif # HAVE_INTROSPECTION
+
+#
 # gdk-pixbuf-marshal.c
 #
 $(srcdir)/gdk-pixbuf-marshal.c: @REBUILD@ $(srcdir)/gdk-pixbuf-marshal.list
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 500c950..e9aedcd 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -230,6 +230,56 @@ EXTRA_DIST += $(gdk_built_sources)
 EXTRA_HEADERS =
 
 #
+# introspection
+#
+Gdk-2.0.gir: $(gdk_c_sources)
+Gdk-2.0.gir: $(gdk_public_h_sources)
+Gdk-2.0.gir: $(gdktargetlib)
+Gdk-2.0.gir: $(G_IR_SCANNER)
+	$(G_IR_SCANNER) -v --namespace Gdk \
+             --nsversion=2.0 \
+             --add-include-path=$(srcdir) \
+             --add-include-path=. \
+             --add-include-path=$(top_builddir)/gdk-pixbuf \
+             --include=Gio-2.0 \
+             --include=cairo-1.0 \
+             --include=Pango-1.0 \
+             --include=GdkPixbuf-2.0 \
+	     $(GDK_TARGET_GIRS:%=--include=%) \
+	     --library=gdk-$(gdktarget)-2.0 \
+	     --libtool="$(LIBTOOL)" \
+             --output $@ \
+             --pkg gobject-2.0 \
+             --pkg gio-2.0 \
+             --pkg cairo \
+             --pkg atk \
+             --pkg pango \
+             --pkg gdk-$(gdktarget)-2.0 \
+	    -I$(top_srcdir) \
+	     -DGDK_COMPILATION \
+	     $(gdk_c_sources) \
+	     $(gdk_public_h_sources)
+
+if HAVE_INTROSPECTION
+
+girdir = $(GIRDIR)
+dist_gir_DATA = Gdk-2.0.gir
+
+EXTRA_DIST += Gdk-2.0.gir
+
+typelibsdir = $(TYPELIBDIR)
+typelibs_DATA = $(Gdk-2.0.gir:.gir=.typelib)
+
+%.typelib: %.gir $(G_IR_COMPILER)
+	LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) \
+	--includedir=$(srcdir) \
+	--includedir=. \
+	$(G_IR_COMPILER_OPTS) \
+	$< -o $(top_builddir)/gdk-pixbuf/$(@F)
+
+endif # HAVE_INTROSPECTION
+
+#
 # Rule to install gdkconfig.h header file
 #
 configexecincludedir = $(libdir)/gtk-2.0/include
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index a3e9eed..9334c2c 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -802,7 +802,7 @@ stamp-gtkmarshalers.h: @REBUILD@ gtkmarshalers.list
 	$(GLIB_GENMARSHAL) --prefix=_gtk_marshal $(srcdir)/gtkmarshalers.list --header >> xgen-gmlh \
 	&& (cmp -s xgen-gmlh gtkmarshalers.h || cp xgen-gmlh gtkmarshalers.h) \
 	&& rm -f xgen-gmlh \
-	&& echo timestamp > $(@F)	
+	&& echo timestamp > $(@F)
 gtkmarshalers.c: @REBUILD@ gtkmarshalers.list
 	(echo "#include \"gtkmarshalers.h\""; \
 	 echo "#include \"gtkalias.h\""; \
@@ -885,7 +885,69 @@ libgtk_target_ldflags = $(gtk_win32_res_ldflag) $(gtk_win32_symbols)
 endif
 EXTRA_LTLIBRARIES = libgtk-x11-2.0.la libgtk-win32-2.0.la libgtk-quartz-2.0.la libgtk-directfb-2.0.la
 
-install-exec-hook: 
+#
+# introspection
+#
+Gtk-2.0.gir: $(gtk_c_sources)
+Gtk-2.0.gir: $(gtk_public_h_sources)
+Gtk-2.0.gir: $(gtktargetlib)
+Gtk-2.0.gir: $(G_IR_SCANNER)
+	$(G_IR_SCANNER) -v --namespace Gtk --nsversion=2.0 \
+	--add-include-path=$(srcdir) \
+	--add-include-path=. \
+	--add-include-path=$(top_builddir)/gdk-pixbuf \
+	--add-include-path=$(top_builddir)/gdk \
+	--include=Gio-2.0 \
+	--include=cairo-1.0 \
+	--include=Atk-1.0 \
+	--include=Pango-1.0 \
+	--include=GdkPixbuf-2.0 \
+	--include=Gdk-2.0 \
+	--library=gtk-$(gdktarget)-2.0 \
+	--libtool="$(LIBTOOL)" \
+	--pkg gobject-2.0 \
+	--pkg gio-2.0 \
+	--pkg cairo \
+	--pkg atk \
+	--pkg pango \
+	--pkg gdk-$(gdktarget)-2.0 \
+	--pkg gtk+-$(gdktarget)-2.0 \
+	--output $@ \
+	 -DGTK_COMPILATION \
+	 -D__GTK_FILE_CHOOSER_UTILS_H__ \
+	 -D__GTK_FILE_CHOOSER_PRIVATE_H__ \
+	 -D__GTK_FILE_SYSTEM_H__ \
+	 -D__GTK_FILE_SYSTEM_MODEL_H__ \
+	 -D__GTK_QUERY_H__ \
+	 -D__GTK_SEARCH_ENGINE_H__ \
+	 -D__GTK_TEXT_LAYOUT_H__ \
+	 -D__GTK_TEXT_DISPLAY_H__ \
+	 -I$(top_srcdir) \
+	 -I$(top_srcdir)/gdk \
+	 -DGTK_COMPILATION \
+	  $(gtk_c_sources) \
+	  $(gtk_public_h_sources)
+
+if HAVE_INTROSPECTION
+
+girdir = $(GIRDIR)
+dist_gir_DATA = Gtk-2.0.gir
+
+EXTRA_DIST += Gtk-2.0.gir
+
+typelibsdir = $(TYPELIBDIR)
+typelibs_DATA = Gtk-2.0.typelib
+
+%.typelib: %.gir $(G_IR_COMPILER)
+	LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) \
+	--includedir=$(srcdir) \
+	--includedir=. \
+	$(G_IR_COMPILER_OPTS) \
+	$< -o $(top_builddir)/gdk-pixbuf/$(@F)
+
+endif # HAVE_INTROSPECTION
+
+install-exec-hook:
 if DISABLE_EXPLICIT_DEPS
 	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gtktargetlib)
 endif
