[gobject-introspection/wip/nonrecursive-make: 4/5] Switch to nonrecursive make for core (i.e. not tests/)



commit 23a81ba427c58971a4def1f068f44562d5fd67c3
Author: Colin Walters <walters verbum org>
Date:   Thu Nov 4 13:12:12 2010 -0400

    Switch to nonrecursive make for core (i.e. not tests/)
    
    This is cleaner and faster, and prepares us better for an incoming
    import of CMPH.

 .gitignore                                     |   64 ++++++++--------
 Makefile-examples.am                           |    5 +
 gir/Makefile.am => Makefile-gir.am             |   99 +++++++----------------
 Makefile-girepository.am                       |   73 +++++++++++++++++
 giscanner/Makefile.am => Makefile-giscanner.am |   73 ++++++++---------
 Makefile-tools.am                              |   33 ++++++++
 Makefile.am                                    |   29 ++++++-
 common.mk                                      |    4 +-
 configure.ac                                   |   10 +--
 docs/reference/Makefile.am                     |    2 +-
 examples/Makefile.am                           |    5 -
 girepository/Makefile.am                       |   73 -----------------
 giscanner/giscannermodule.c                    |   10 ++-
 giscanner/sourcescanner.py                     |   10 ++-
 tests/offsets/Makefile.am                      |    2 +-
 tests/repository/Makefile.am                   |    6 +-
 tests/scanner/Makefile.am                      |    6 +-
 tests/warn/Makefile.am                         |    2 +-
 tests/warn/warningtester.py                    |    4 +
 tools/Makefile.am                              |   35 --------
 20 files changed, 267 insertions(+), 278 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 4d38d0a..4d83c36 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,7 +33,9 @@ ylwrap
 py-compile
 omf.make
 xmldocs.make
-examples/glib-print
+glib-print
+scannerlexer.c
+scannerparser.[ch]
 docs/reference/gi-decl-list.txt
 docs/reference/gi-decl.txt
 docs/reference/gi-undeclared.txt
@@ -48,31 +50,31 @@ docs/reference/html
 docs/reference/xml
 docs/reference/tmpl
 docs/reference/*.bak
-gir/DBus-1.0.typelib
-gir/DBusGLib-1.0.typelib
-gir/Everything-1.0.gir
-gir/Everything-1.0.typelib
-gir/GIMarshallingTests-1.0.gir
-gir/GIMarshallingTests-1.0.typelib
-gir/GIRepository-2.0.gir
-gir/GIRepository-2.0.typelib
-gir/GL-1.0.typelib
-gir/GLib-2.0.gir
-gir/GLib-2.0.typelib
-gir/GModule-2.0.gir
-gir/GModule-2.0.typelib
-gir/GObject-2.0.gir
-gir/GObject-2.0.typelib
-gir/Gio-2.0.gir
-gir/Gio-2.0.typelib
-gir/cairo-1.0.typelib
-gir/fontconfig-2.0.typelib
-gir/freetype2-2.0.typelib
-gir/libxml2-2.0.typelib
-gir/xfixes-4.0.typelib
-gir/xft-2.0.typelib
-gir/xlib-2.0.typelib
-gir/xrandr-1.3.typelib
+DBus-1.0.typelib
+DBusGLib-1.0.typelib
+Everything-1.0.gir
+Everything-1.0.typelib
+GIMarshallingTests-1.0.gir
+GIMarshallingTests-1.0.typelib
+GIRepository-2.0.gir
+GIRepository-2.0.typelib
+GL-1.0.typelib
+GLib-2.0.gir
+GLib-2.0.typelib
+GModule-2.0.gir
+GModule-2.0.typelib
+GObject-2.0.gir
+GObject-2.0.typelib
+Gio-2.0.gir
+Gio-2.0.typelib
+cairo-1.0.typelib
+fontconfig-2.0.typelib
+freetype2-2.0.typelib
+libxml2-2.0.typelib
+xfixes-4.0.typelib
+xft-2.0.typelib
+xlib-2.0.typelib
+xrandr-1.3.typelib
 giscanner/config.py
 giscanner/scannerlexer.c
 giscanner/scannerparser.c
@@ -116,8 +118,8 @@ tests/scanner/Foo-1.0.typelib
 tests/scanner/Utility-1.0.gir
 tests/scanner/Utility-1.0.typelib
 tests/extended.gir.test
-tools/g-ir-compiler
-tools/g-ir-generate
-tools/g-ir-scanner
-tools/g-ir-annotation-tool
-tools/g-ir-docgen
+g-ir-compiler
+g-ir-generate
+g-ir-scanner
+g-ir-annotation-tool
+g-ir-docgen
diff --git a/Makefile-examples.am b/Makefile-examples.am
new file mode 100644
index 0000000..0d9cedc
--- /dev/null
+++ b/Makefile-examples.am
@@ -0,0 +1,5 @@
+noinst_PROGRAMS += glib-print
+
+glib_print_SOURCES = examples/glib-print.c
+glib_print_CFLAGS = $(GOBJECT_CFLAGS) -I$(top_srcdir)/girepository
+glib_print_LDADD = libgirepository-1.0.la $(GOBJECT_LIBS)
diff --git a/gir/Makefile.am b/Makefile-gir.am
similarity index 66%
rename from gir/Makefile.am
rename to Makefile-gir.am
index 8e835bc..393abba 100644
--- a/gir/Makefile.am
+++ b/Makefile-gir.am
@@ -1,26 +1,18 @@
-include $(top_srcdir)/common.mk
-include $(top_srcdir)/Makefile.introspection
-
-EXPECTEDGIRS =
 BUILT_GIRSOURCES =
-CLEANFILES =
-EXTRA_DIST =
-
-BASE_GIRSOURCES =               \
-        cairo-1.0.gir           \
-        DBus-1.0.gir           \
-        DBusGLib-1.0.gir           \
-        fontconfig-2.0.gir      \
-        freetype2-2.0.gir       \
-        GL-1.0.gir              \
-        libxml2-2.0.gir         \
-        xft-2.0.gir             \
-        xlib-2.0.gir            \
-        xfixes-4.0.gir          \
-        xrandr-1.3.gir
-EXTRA_DIST += $(BASE_GIRSOURCES)
-
-INTROSPECTION_GIRS =
+
+STATIC_GIRSOURCES =               \
+        gir/cairo-1.0.gir           \
+        gir/DBus-1.0.gir           \
+        gir/DBusGLib-1.0.gir           \
+        gir/fontconfig-2.0.gir      \
+        gir/freetype2-2.0.gir       \
+        gir/GL-1.0.gir              \
+        gir/libxml2-2.0.gir         \
+        gir/xft-2.0.gir             \
+        gir/xlib-2.0.gir            \
+        gir/xfixes-4.0.gir          \
+        gir/xrandr-1.3.gir
+EXTRA_DIST += $(STATIC_GIRSOURCES)
 
 # glib with source (to enable documentation)
 if WITH_GLIBSRC
@@ -64,9 +56,11 @@ GLib_2_0_gir_CFLAGS = \
 GLib_2_0_gir_FILES =  \
                 $(GLIB_LIBDIR)/glib-2.0/include/glibconfig.h \
 	$(GLIB_INCLUDEDIR)/glib/*.h \
-                glib-2.0.c
+                gir/glib-2.0.c
 
-INTROSPECTION_GIRS += GLib-2.0.gir
+BUILT_GIRSOURCES += GLib-2.0.gir
+
+GLib-2.0.gir: g-ir-scanner
 
 DBusGLib-1.0.typelib: GObject-2.0.gir
 
@@ -96,9 +90,9 @@ GObject_2_0_gir_CFLAGS = \
             -DGOBJECT_COMPILATION \
                 -I$(GOBJECT_INCLUDEDIR) \
             -I$(GOBJECT_LIBDIR)/glib-2.0/include
-GObject_2_0_gir_FILES = $(GLIB_INCLUDEDIR)/gobject/*.h gobject-2.0.c
+GObject_2_0_gir_FILES = $(GLIB_INCLUDEDIR)/gobject/*.h gir/gobject-2.0.c
 
-INTROSPECTION_GIRS += GObject-2.0.gir
+BUILT_GIRSOURCES += GObject-2.0.gir
 
 # gmodule
 GMODULE_INCLUDEDIR=$(shell pkg-config --variable=includedir gmodule-2.0)/glib-2.0
@@ -126,7 +120,7 @@ GModule_2_0_gir_CFLAGS = \
             -I$(GMODULE_LIBDIR)/glib-2.0/include
 GModule_2_0_gir_FILES = $(GLIB_INCLUDEDIR)/gmodule.h
 
-INTROSPECTION_GIRS += GModule-2.0.gir
+BUILT_GIRSOURCES += GModule-2.0.gir
 
 # gio
 GIO_INCLUDEDIR=$(shell pkg-config --variable=includedir gio-2.0)/glib-2.0
@@ -165,15 +159,15 @@ Gio_2_0_gir_CFLAGS = \
 Gio_2_0_gir_FILES = \
             $(GIO_UNIX_HDRS) \
             $(GIO_INCLUDEDIR)/gio/*.h \
-            gio-2.0.c
+            gir/gio-2.0.c
 
-INTROSPECTION_GIRS += Gio-2.0.gir
-EXTRA_DIST += glib-2.0.c gobject-2.0.c gio-2.0.c
+BUILT_GIRSOURCES += Gio-2.0.gir
+EXTRA_DIST += gir/glib-2.0.c gir/gobject-2.0.c gir/gio-2.0.c
 
 # girepository
-GIRepository-2.0.gir: GObject-2.0.gir $(top_builddir)/girepository/libgirepository-1.0.la
+GIRepository-2.0.gir: GObject-2.0.gir libgirepository-1.0.la
 
-GIRepository_2_0_gir_LIBS = $(top_builddir)/girepository/libgirepository-1.0.la
+GIRepository_2_0_gir_LIBS = libgirepository-1.0.la
 GIRepository_2_0_gir_SCANNERFLAGS = \
 	--warn-all \
         --identifier-prefix=GI \
@@ -194,49 +188,16 @@ GIRepository_2_0_gir_FILES = \
         $(top_srcdir)/girepository/gitypelib.h	    \
         $(top_srcdir)/girepository/gitypes.h
 
+BUILT_GIRSOURCES += GIRepository-2.0.gir
 
-INTROSPECTION_GIRS += GIRepository-2.0.gir
-
-# Generic rules
-CLEANFILES += $(INTROSPECTION_GIRS)
+CLEANFILES += $(BUILT_GIRSOURCES)
 
-GIRSOURCES =                    \
-        $(BASE_GIRSOURCES)      \
-        $(INTROSPECTION_GIRS)
+INTROSPECTION_GIRS += $(BUILT_GIRSOURCES)
 
 girdir = $(GIR_DIR)
-gir_DATA = $(GIRSOURCES)
+gir_DATA = $(STATIC_GIRSOURCES) $(BUILT_GIRSOURCES)
 
 typelibsdir = $(libdir)/girepository-1.0
 typelibs_DATA = $(GIRSOURCES:.gir=.typelib)
 
 CLEANFILES += $(typelibs_DATA)
-
-%.gir.check: %.gir
-	@diff -u -U 10 $(srcdir)/$*-expected.gir $*.gir && echo "  TEST  $*.gir"
-
-CHECKGIRS = $(EXPECTEDGIRS:-expected.gir=.gir.check)
-check-local: $(CHECKGIRS)
-
-# Check that typelib -> gir -> typelib transformation is lossless.
-# Comparing gir files is relatively fragile (whitespace, attribute default
-# values, etc.) but the typelibs should identical as long as the gir files are
-# semantically equivalent.
-
-%.test.gir: %.typelib $(top_builddir)/tools/g-ir-generate$(EXEEXT)
-	$(DEBUG) $(top_builddir)/tools/g-ir-generate$(EXEEXT) --includedir=. $< -o $@
-
-testlib-%: %.test.gir $(top_builddir)/tools/g-ir-generate$(EXEEXT)
-	$(DEBUG) $(top_builddir)/tools/g-ir-compiler$(EXEEXT) --includedir=. $< -o $*.test.typelib
-	cmp $*.typelib $*.test.typelib && rm $*.test.typelib
-
-testgir-%: %.test.gir
-	diff -u $*.gir $< && rm $<
-
-CLEANFILES += $(typelibs_DATA:%.typelib=%.test.gir)
-CLEANFILES += $(typelibs_DATA:%.typelib=%.test.typelib)
-
-#check-local: $(typelibs_DATA:%.typelib=testlib-%)
-check-gir: $(typelibs_DATA:%.typelib=testgir-%)
-
-EXTRA_DIST += $(EXPECTEDGIRS)
diff --git a/Makefile-girepository.am b/Makefile-girepository.am
new file mode 100644
index 0000000..fd9a51f
--- /dev/null
+++ b/Makefile-girepository.am
@@ -0,0 +1,73 @@
+girepodir = $(includedir)/gobject-introspection-1.0/
+girepo_HEADERS =					\
+	girepository/giarginfo.h			\
+	girepository/gibaseinfo.h			\
+	girepository/gicallableinfo.h			\
+	girepository/giconstantinfo.h			\
+	girepository/gienuminfo.h			\
+	girepository/gierrordomaininfo.h		\
+	girepository/gifieldinfo.h			\
+	girepository/gifunctioninfo.h			\
+	girepository/giinterfaceinfo.h			\
+	girepository/giobjectinfo.h			\
+	girepository/gipropertyinfo.h			\
+	girepository/giregisteredtypeinfo.h		\
+	girepository/girepository.h			\
+	girepository/girffi.h				\
+	girepository/gisignalinfo.h			\
+	girepository/gistructinfo.h			\
+	girepository/gitypeinfo.h			\
+	girepository/gitypelib.h			\
+	girepository/gitypes.h				\
+	girepository/giunioninfo.h			\
+	girepository/givfuncinfo.h
+
+lib_LTLIBRARIES += libgirepository-1.0.la
+noinst_LTLIBRARIES += libgirepository-parser.la
+
+libgirepository_1_0_la_SOURCES =			\
+	girepository/gdump.c				\
+	girepository/giarginfo.c			\
+	girepository/gibaseinfo.c			\
+	girepository/gicallableinfo.c			\
+	girepository/giconstantinfo.c			\
+	girepository/gienuminfo.c			\
+	girepository/gierrordomaininfo.c		\
+	girepository/gifieldinfo.c			\
+	girepository/gifunctioninfo.c			\
+	girepository/ginvoke.c				\
+	girepository/giinterfaceinfo.c			\
+	girepository/giobjectinfo.c			\
+	girepository/gipropertyinfo.c			\
+	girepository/giregisteredtypeinfo.c		\
+	girepository/girepository.c			\
+	girepository/girepository-private.h		\
+	girepository/girffi.c                           \
+	girepository/girffi.h				\
+	girepository/gisignalinfo.c			\
+	girepository/gistructinfo.c			\
+	girepository/gitypeinfo.c			\
+	girepository/gitypelib.c			\
+	girepository/gitypelib-internal.h		\
+	girepository/glib-compat.h			\
+	girepository/giunioninfo.c			\
+	girepository/givfuncinfo.c
+
+libgirepository_1_0_la_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository -DG_IREPOSITORY_COMPILATION
+libgirepository_1_0_la_LIBADD = $(GIREPO_LIBS)
+libgirepository_1_0_la_LDFLAGS = -no-undefined -version-number 1:0:0
+
+libgirepository_parser_la_SOURCES =				\
+	girepository/girmodule.c				\
+	girepository/girmodule.h				\
+	girepository/girnode.c					\
+	girepository/girnode.h					\
+	girepository/giroffsets.c				\
+	girepository/girparser.c				\
+	girepository/girparser.h				\
+	girepository/girwriter.c				\
+	girepository/girwriter.h
+libgirepository_parser_la_CFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
+
+gdumpdir = $(datadir)/gobject-introspection-1.0/
+gdump_DATA = girepository/gdump.c
diff --git a/giscanner/Makefile.am b/Makefile-giscanner.am
similarity index 52%
rename from giscanner/Makefile.am
rename to Makefile-giscanner.am
index 2779b70..509cfeb 100644
--- a/giscanner/Makefile.am
+++ b/Makefile-giscanner.am
@@ -1,60 +1,55 @@
 ## Process this file with automake to produce Makefile.in
 
-INCLUDES = -I$(top_srcdir)/girepository
-BUILT_SOURCES = 		\
+BUILT_SOURCES += 		\
 	scannerparser.c		\
 	scannerparser.h 	\
 	scannerlexer.c 		\
 	scannerlexer.h
 
-CLEANFILES = 		\
-	scannerparser.c		\
-	scannerparser.h 	\
-	scannerlexer.c 		\
-	scannerlexer.h
 AM_YFLAGS = -d -t
 
 # Why do I have to do this automake?
-scannerlexer.h: scannerlexer.c
+scannerlexer.h: giscanner/scannerlexer.c
 
-noinst_LTLIBRARIES = libgiscanner.la
+noinst_LTLIBRARIES += libgiscanner.la
 
 libgiscanner_la_SOURCES = \
-	sourcescanner.c				\
-	sourcescanner.h				\
-	scannerlexer.l				\
-	scannerparser.y				\
-	grealpath.h
+	giscanner/sourcescanner.c				\
+	giscanner/sourcescanner.h				\
+	giscanner/scannerlexer.l				\
+	giscanner/scannerparser.y				\
+	giscanner/grealpath.h
+libgiscanner_la_CPPFLAGS = -I$(top_srcdir)/girepository -I$(top_srcdir)/giscanner
 libgiscanner_la_LIBADD = $(GOBJECT_LIBS)
 libgiscanner_la_CFLAGS = $(GOBJECT_CFLAGS)
 
 # Python module
 pkgpyexecdir = $(pkglibdir)/giscanner
 pkgpyexec_LTLIBRARIES = _giscanner.la
-pkgpyexec_PYTHON = 		\
-	__init__.py		\
-	annotationmain.py	\
-	annotationparser.py	\
-	ast.py			\
-	cachestore.py		\
-	codegen.py		\
-	config.py		\
-	dumper.py		\
-	introspectablepass.py	\
-	girparser.py		\
-	girwriter.py		\
-	gdumpparser.py 	\
-	libtoolimporter.py	\
-	odict.py		\
-	maintransformer.py	\
-	message.py		\
-	shlibs.py		\
-	scannermain.py		\
-	sourcescanner.py	\
-	testcodegen.py		\
-	transformer.py		\
-	utils.py		\
-	xmlwriter.py
+pkgpyexec_PYTHON =			\
+	giscanner/__init__.py		\
+	giscanner/annotationmain.py	\
+	giscanner/annotationparser.py	\
+	giscanner/ast.py		\
+	giscanner/cachestore.py		\
+	giscanner/codegen.py		\
+	giscanner/config.py		\
+	giscanner/dumper.py		\
+	giscanner/introspectablepass.py	\
+	giscanner/girparser.py		\
+	giscanner/girwriter.py		\
+	giscanner/gdumpparser.py 	\
+	giscanner/libtoolimporter.py	\
+	giscanner/odict.py		\
+	giscanner/maintransformer.py	\
+	giscanner/message.py		\
+	giscanner/shlibs.py		\
+	giscanner/scannermain.py	\
+	giscanner/sourcescanner.py	\
+	giscanner/testcodegen.py	\
+	giscanner/transformer.py	\
+	giscanner/utils.py		\
+	giscanner/xmlwriter.py
 
 _giscanner_la_CFLAGS = \
 	$(PYTHON_INCLUDES) \
@@ -71,7 +66,7 @@ if OS_WIN32
 _giscanner_la_LDFLAGS += -Wl,$(pyexecdir)/../../libs/libpython25.a -no-undefined
 endif
 
-_giscanner_la_SOURCES = giscannermodule.c
+_giscanner_la_SOURCES = giscanner/giscannermodule.c
 
 if OS_WIN32
 BUILT_SOURCES += _giscanner.pyd
diff --git a/Makefile-tools.am b/Makefile-tools.am
new file mode 100644
index 0000000..1ee3212
--- /dev/null
+++ b/Makefile-tools.am
@@ -0,0 +1,33 @@
+bin_PROGRAMS += g-ir-compiler g-ir-generate
+bin_SCRIPTS += g-ir-scanner g-ir-annotation-tool
+EXTRA_DIST += g-ir-scanner.in g-ir-annotation-tool.in
+
+g-ir-scanner: tools/g-ir-scanner.in libgiscanner.la Makefile
+	$(AM_V_GEN) sed -e s,@libdir\@,$(libdir), -e s,@PYTHON\@,$(PYTHON), $< > $  tmp && mv $  tmp $@
+	@chmod a+x $@
+
+g-ir-annotation-tool: tools/g-ir-annotation-tool.in libgiscanner.la Makefile
+	$(AM_V_GEN) sed -e s,@libdir\@,$(libdir), -e s,@PYTHON\@,$(PYTHON), $< > $  tmp && mv $  tmp $@
+	@chmod a+x $@
+
+g_ir_compiler_SOURCES = tools/compiler.c
+g_ir_compiler_CPPFLAGS = -DGIREPO_DEFAULT_SEARCH_PATH="\"$(libdir)\"" \
+			 -I$(top_srcdir)/girepository
+g_ir_compiler_CFLAGS = $(GIREPO_CFLAGS)
+g_ir_compiler_LDADD = \
+	libgirepository-parser.la \
+	libgirepository-1.0.la
+
+g_ir_generate_SOURCES = tools/generate.c
+g_ir_generate_CPPFLAGS = -DGIREPO_DEFAULT_SEARCH_PATH="\"$(libdir)\"" \
+			 -I$(top_srcdir)/girepository
+g_ir_generate_CFLAGS = $(GIREPO_CFLAGS)
+g_ir_generate_LDADD = \
+	libgirepository-parser.la \
+	libgirepository-1.0.la
+
+GCOVSOURCES =					\
+	$(g_ir_compiler_SOURCES)		\
+	$(g_ir_generate_SOURCES)
+
+CLEANFILES += g-ir-scanner g-ir-annotation-tool
diff --git a/Makefile.am b/Makefile.am
index 33df173..1e11115 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,11 +1,34 @@
+man_MANS =
+EXTRA_DIST =
+lib_LTLIBRARIES =
+noinst_LTLIBRARIES =
+BUILT_SOURCES =
+CLEANFILES = $(BUILT_SOURCES)
+INTROSPECTION_GIRS =
+check_LTLIBRARIES =
+check_PROGRAMS =
+bin_PROGRAMS =
+bin_SCRIPTS =
+noinst_PROGRAMS =
+
+include common.mk
+include Makefile.introspection
+
+include Makefile-girepository.am
+include Makefile-giscanner.am
+include Makefile-examples.am
+include Makefile-gir.am
+include Makefile-tools.am
+
 ## Process this file with automake to produce Makefile.in
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = girepository giscanner tools gir docs tests examples
+SUBDIRS = . docs tests
+
 DIST_SUBDIRS = m4 $(SUBDIRS)
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
 
-man_MANS = 			\
+man_MANS += 			\
 	docs/g-ir-compiler.1	\
 	docs/g-ir-generate.1	\
 	docs/g-ir-scanner.1
@@ -19,7 +42,7 @@ m4_DATA = m4/introspection.m4
 makedir = $(datadir)/gobject-introspection-1.0
 dist_make_DATA = Makefile.introspection
 
-EXTRA_DIST = 			\
+EXTRA_DIST += 			\
 	COPYING.LGPL		\
 	COPYING.GPL		\
 	CONTRIBUTORS		\
diff --git a/common.mk b/common.mk
index 40aff8a..3514d72 100644
--- a/common.mk
+++ b/common.mk
@@ -11,7 +11,7 @@ INTROSPECTION_SCANNER = \
         PYTHONPATH=$(top_builddir):$(top_srcdir) \
 	UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) \
 	UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
-    $(top_builddir)/tools/g-ir-scanner$(EXEEXT)
+    $(top_builddir)/g-ir-scanner$(EXEEXT)
 INTROSPECTION_SCANNER_ARGS = \
     --verbose \
     -I$(top_srcdir) \
@@ -20,7 +20,7 @@ INTROSPECTION_SCANNER_ARGS = \
     --add-include-path=$(builddir) \
     --add-include-path=$(top_builddir)/gir
 
-INTROSPECTION_COMPILER = $(top_builddir)/tools/g-ir-compiler$(EXEEXT)
+INTROSPECTION_COMPILER = $(top_builddir)/g-ir-compiler$(EXEEXT)
 INTROSPECTION_COMPILER_ARGS = \
     --includedir=$(srcdir) \
     --includedir=$(top_srcdir)/gir \
diff --git a/configure.ac b/configure.ac
index d0077c3..5c7c1df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,8 +118,9 @@ GIR_DIR="$EXPANDED_DATADIR/$GIR_SUFFIX"
 AC_SUBST(GIR_DIR)
 AC_DEFINE_UNQUOTED(GIR_DIR, "$GIR_DIR", [Director prefix for gir installation])
 
-PKG_CHECK_MODULES(GOBJECT, [gobject-2.0 gio-2.0])
-PKG_CHECK_MODULES(GTHREAD, [gthread-2.0])
+PKG_CHECK_MODULES(GLIB, [glib-2.0])
+PKG_CHECK_MODULES(GOBJECT, [gobject-2.0])
+PKG_CHECK_MODULES(GIO, [gio-2.0])
 PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0], have_gio_unix=true, have_gio_unix=false)
 AM_CONDITIONAL(HAVE_GIO_UNIX, test x$have_gio_unix = xtrue)
 
@@ -240,18 +241,13 @@ AC_MSG_RESULT([$GLIBSRC])
 
 AC_CONFIG_FILES([
 Makefile
-gir/Makefile
-girepository/Makefile
-giscanner/Makefile
 giscanner/config.py
 m4/Makefile
-tools/Makefile
 tests/Makefile
 tests/offsets/Makefile
 tests/scanner/Makefile
 tests/repository/Makefile
 tests/warn/Makefile
-examples/Makefile
 docs/Makefile
 docs/reference/Makefile
 gobject-introspection-1.0.pc
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index a573fdf..f63a590 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -29,7 +29,7 @@ IGNORE_HFILES= \
     girmodule.h
 
 INCLUDES=$(GIREPO_CFLAGS) -I$(top_srcdir)
-GTKDOC_LIBS = $(GIREPO_LIBS) $(top_builddir)/girepository/libgirepository-1.0.la $(top_builddir)/girepository/libgirepository-parser.la
+GTKDOC_LIBS = $(GIREPO_LIBS) $(top_builddir)/libgirepository-1.0.la $(top_builddir)/libgirepository-parser.la
 
 content_files = \
     gi-gir-reference.xml    \
diff --git a/giscanner/giscannermodule.c b/giscanner/giscannermodule.c
index abea985..a8061db 100644
--- a/giscanner/giscannermodule.c
+++ b/giscanner/giscannermodule.c
@@ -678,8 +678,14 @@ DL_EXPORT(void)
 init_giscanner(void)
 {
     PyObject *m, *d;
-
-    m = Py_InitModule ("giscanner._giscanner",
+    gboolean is_uninstalled;
+
+    /* Hack to avoid having to create a fake directory structure; when
+     * running uninstalled, the module will be in the top builddir,
+     * with no _giscanner prefix.
+     */
+    is_uninstalled = g_getenv ("UNINSTALLED_INTROSPECTION_SRCDIR") != NULL;
+    m = Py_InitModule (is_uninstalled ? "_giscanner" : "giscanner._giscanner",
 		       (PyMethodDef*)pyscanner_functions);
     d = PyModule_GetDict (m);
 
diff --git a/giscanner/sourcescanner.py b/giscanner/sourcescanner.py
index 20339e4..e3968e3 100644
--- a/giscanner/sourcescanner.py
+++ b/giscanner/sourcescanner.py
@@ -26,6 +26,12 @@ import tempfile
 from .libtoolimporter import LibtoolImporter
 from .message import Position
 
+with LibtoolImporter(None, None):
+    if 'UNINSTALLED_INTROSPECTION_SRCDIR' in os.environ:
+        from _giscanner import SourceScanner as CSourceScanner
+    else:
+        from giscanner._giscanner import SourceScanner as CSourceScanner
+
 (CSYMBOL_TYPE_INVALID,
  CSYMBOL_TYPE_ELLIPSIS,
  CSYMBOL_TYPE_CONST,
@@ -211,9 +217,7 @@ class SourceSymbol(object):
 class SourceScanner(object):
 
     def __init__(self):
-        with LibtoolImporter(None, None):
-            from giscanner._giscanner import SourceScanner
-        self._scanner = SourceScanner()
+        self._scanner = CSourceScanner()
         self._filenames = []
         self._cpp_options = []
 
diff --git a/tests/offsets/Makefile.am b/tests/offsets/Makefile.am
index 5426137..60d37b3 100644
--- a/tests/offsets/Makefile.am
+++ b/tests/offsets/Makefile.am
@@ -36,7 +36,7 @@ check_PROGRAMS += gitestoffsets
 
 nodist_gitestoffsets_SOURCES = gitestoffsets.c
 gitestoffsets_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
-gitestoffsets_LDADD = $(top_builddir)/girepository/libgirepository-1.0.la $(GIREPO_LIBS)
+gitestoffsets_LDADD = $(top_builddir)/libgirepository-1.0.la $(GIREPO_LIBS)
 
 gitestoffsets.c: gen-gitestoffsets offsets.h
 	$(AM_V_GEN) $(PYTHON) $(srcdir)/gen-gitestoffsets $(srcdir)/offsets.h > $@ || ( rm -f $@ && false )
diff --git a/tests/repository/Makefile.am b/tests/repository/Makefile.am
index 36f738d..b7ed21c 100644
--- a/tests/repository/Makefile.am
+++ b/tests/repository/Makefile.am
@@ -6,12 +6,12 @@ noinst_PROGRAMS = gitestrepo gitestthrows
 
 gitestrepo_SOURCES = $(srcdir)/gitestrepo.c
 gitestrepo_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
-gitestrepo_LDADD = $(top_builddir)/girepository/libgirepository-1.0.la $(GIREPO_LIBS)
+gitestrepo_LDADD = $(top_builddir)/libgirepository-1.0.la $(GIREPO_LIBS)
 
 gitestthrows_SOURCES = $(srcdir)/gitestthrows.c
 gitestthrows_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
-gitestthrows_LDADD = $(top_builddir)/girepository/libgirepository-1.0.la $(GIREPO_LIBS)
+gitestthrows_LDADD = $(top_builddir)/libgirepository-1.0.la $(GIREPO_LIBS)
 
 TESTS = gitestrepo gitestthrows
 TESTS_ENVIRONMENT=env top_builddir="$(top_builddir)" \
-   XDG_DATA_DIRS="$(top_srcdir)/gir:$(XDG_DATA_DIRS)" $(DEBUG)
\ No newline at end of file
+   XDG_DATA_DIRS="$(top_srcdir)/gir:$(XDG_DATA_DIRS)" $(DEBUG)
diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am
index 1801c45..a7dbc0a 100644
--- a/tests/scanner/Makefile.am
+++ b/tests/scanner/Makefile.am
@@ -26,7 +26,7 @@ LIBS = $(GOBJECT_LIBS) $(GTHREAD_LIBS)
 libannotation_la_SOURCES = $(srcdir)/annotation.c $(srcdir)/annotation.h
 libtestinherit_la_SOURCES = $(srcdir)/drawable.c $(srcdir)/drawable.h
 libfoo_la_SOURCES = $(srcdir)/foo.c $(srcdir)/foo.h
-libfoo_la_LIBADD = $(top_builddir)/girepository/libgirepository-1.0.la
+libfoo_la_LIBADD = $(top_builddir)/libgirepository-1.0.la
 libutility_la_SOURCES = $(srcdir)/utility.c $(srcdir)/utility.h
 libgtkfrob_la_SOURCES = $(srcdir)/gtkfrob.c $(srcdir)/gtkfrob.h
 libregress_la_SOURCES = $(srcdir)/regress.c $(srcdir)/regress.h
@@ -52,7 +52,7 @@ CLEANFILES = $(TYPELIBS) $(GIRS)
 BUILT_SOURCES = $(TYPELIBS) $(GIRS)
 EXTRA_DIST = $(EXPECTEDGIRS)
 
-Regress-1.0.gir: $(top_builddir)/gir/Gio-2.0.gir libregress.la
+Regress-1.0.gir: $(top_builddir)/Gio-2.0.gir libregress.la
 Regress_1_0_gir_LIBS = libregress.la
 Regress_1_0_gir_INCLUDES = cairo-1.0 Gio-2.0
 Regress_1_0_gir_FILES = $(libregress_la_SOURCES)
@@ -101,7 +101,7 @@ GIRS += GtkFrob-1.0.gir
 noinst_PROGRAMS = barapp
 
 barapp_SOURCES = $(srcdir)/barapp.c $(srcdir)/barapp.h
-barapp_LDADD = $(top_builddir)/girepository/libgirepository-1.0.la
+barapp_LDADD = $(top_builddir)/libgirepository-1.0.la
 barapp_LDFLAGS = -export-dynamic
 
 Bar-1.0.gir: barapp
diff --git a/tests/warn/Makefile.am b/tests/warn/Makefile.am
index 3cd44b0..8b44cfc 100644
--- a/tests/warn/Makefile.am
+++ b/tests/warn/Makefile.am
@@ -15,5 +15,5 @@ TESTS = \
 
 EXTRA_DIST = warningtester.py common.h $(TESTS)
 
-TESTS_ENVIRONMENT = PYTHONPATH=$(top_builddir):$(top_srcdir) TOP_BUILDDIR=$(top_builddir) $(PYTHON) $(srcdir)/warningtester.py
+TESTS_ENVIRONMENT = PYTHONPATH=$(top_builddir):$(top_srcdir) TOP_BUILDDIR=$(top_builddir) UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) $(PYTHON) $(srcdir)/warningtester.py
 
diff --git a/tests/warn/warningtester.py b/tests/warn/warningtester.py
index d43b6d5..f8f5565 100644
--- a/tests/warn/warningtester.py
+++ b/tests/warn/warningtester.py
@@ -4,6 +4,10 @@ import os.path
 import sys
 from StringIO import StringIO
 
+path=os.getenv('UNINSTALLED_INTROSPECTION_SRCDIR', None)
+assert path is not None
+sys.path.insert(0, path)
+
 from giscanner.annotationparser import AnnotationParser
 from giscanner.ast import Include, Namespace
 from giscanner.introspectablepass import IntrospectablePass



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