commit 5c59cc83f6d041f067ce182c58acdc5674686443
Author: Jakub Kaszycki <jakub@kaszycki.net.pl>
Date:   Sat Aug 26 17:51:59 2017 +0200

    Out-of-source builds are now possible

diff --git a/Makefile.am b/Makefile.am
index e5dc0cc97..1e6fd4ead 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -62,7 +62,7 @@ $(top_srcdir)/.version: gen-version
 	@true
 .PHONY: gen-version
 gen-version:
-	@V=`$(top_srcdir)/build-aux/git-version-gen $(top_srcdir)/.tarball-version` &&			\
+	@V=`cd $(top_srcdir) && ./build-aux/git-version-gen .tarball-version` &&			\
 	if [ -e $(top_srcdir)/.version ] && [ "x`cat $(top_srcdir)/.version`" = "x$$V" ]; then		\
 	  true;												\
 	else												\
diff --git a/ccode/Makefile.am b/ccode/Makefile.am
index 0f86b9646..6e49d5e7a 100644
--- a/ccode/Makefile.am
+++ b/ccode/Makefile.am
@@ -4,7 +4,7 @@ NULL =
 
 AM_CPPFLAGS = \
 	$(COVERAGE_CFLAGS) \
-	-I$(top_srcdir)/gee \
+	-I$(top_builddir)/gee \
 	$(GLIB_CFLAGS) \
 	$(NULL)
 
@@ -81,7 +81,7 @@ ccode.vapi ccode.vala.stamp: $(libvalaccode_la_VALASOURCES)
 		$(VALAFLAGS) \
 		-C \
 		--vapidir $(top_srcdir)/vapi --pkg gobject-2.0 \
-		--vapidir $(top_srcdir)/gee --pkg gee \
+		--vapidir $(top_builddir)/gee --pkg gee \
 		--pkg config \
 		--use-header \
 		-H valaccode.h \
diff --git a/codegen/Makefile.am b/codegen/Makefile.am
index 82defe454..54d3872fd 100644
--- a/codegen/Makefile.am
+++ b/codegen/Makefile.am
@@ -4,9 +4,9 @@ NULL =
 
 AM_CPPFLAGS = \
 	$(COVERAGE_CFLAGS) \
-	-I$(top_srcdir)/gee \
-	-I$(top_srcdir)/ccode \
-	-I$(top_srcdir)/vala \
+	-I$(top_builddir)/gee \
+	-I$(top_builddir)/ccode \
+	-I$(top_builddir)/vala \
 	$(GLIB_CFLAGS) \
 	$(NULL)
 
@@ -58,9 +58,9 @@ codegen.vapi codegen.vala.stamp: $(libvalaccodegen_la_VALASOURCES)
 		$(VALAFLAGS) \
 		-C \
 		--vapidir $(top_srcdir)/vapi --pkg gobject-2.0 \
-		--vapidir $(top_srcdir)/gee --pkg gee \
-		--vapidir $(top_srcdir)/ccode --pkg ccode \
-		--vapidir $(top_srcdir)/vala --pkg vala \
+		--vapidir $(top_builddir)/gee --pkg gee \
+		--vapidir $(top_builddir)/ccode --pkg ccode \
+		--vapidir $(top_builddir)/vala --pkg vala \
 		--use-header \
 		-H valacodegen.h \
 		--library codegen \
diff --git a/compiler/Makefile.am b/compiler/Makefile.am
index ff8759e25..9ca5ef0c8 100644
--- a/compiler/Makefile.am
+++ b/compiler/Makefile.am
@@ -4,10 +4,11 @@ NULL =
 
 AM_CPPFLAGS = \
 	$(COVERAGE_CFLAGS) \
-	-I$(top_srcdir)/gee \
-	-I$(top_srcdir)/ccode \
-	-I$(top_srcdir)/vala \
-	-I$(top_srcdir)/codegen \
+	-I$(top_builddir)/gee \
+	-I$(top_builddir)/ccode \
+	-I$(top_builddir)/vala \
+	-I$(top_builddir)/codegen \
+	-I. \
 	$(GLIB_CFLAGS) \
 	-DPACKAGE_DATADIR=\"$(pkgdatadir)\" \
 	$(NULL)
@@ -33,10 +34,11 @@ valac.vala.stamp: $(valac_VALASOURCES)
 		$(VALAFLAGS) \
 		-C \
 		--vapidir $(top_srcdir)/vapi --pkg gobject-2.0 \
-		--vapidir $(top_srcdir)/gee --pkg gee \
-		--vapidir $(top_srcdir)/ccode --pkg ccode \
-		--vapidir $(top_srcdir)/vala --pkg vala \
-		--vapidir $(top_srcdir)/codegen --pkg codegen \
+		--vapidir $(top_builddir)/gee --pkg gee \
+		--vapidir $(top_builddir)/ccode --pkg ccode \
+		--vapidir $(top_builddir)/vala --pkg vala \
+		--vapidir $(top_builddir)/codegen --pkg codegen \
+		--vapidir $(srcdir) --pkg exeext \
 		--pkg config \
 		$^
 	@touch $@
diff --git a/libvaladoc/Makefile.am b/libvaladoc/Makefile.am
index 387eeb859..b6fa7e2b5 100644
--- a/libvaladoc/Makefile.am
+++ b/libvaladoc/Makefile.am
@@ -9,7 +9,7 @@ AM_CFLAGS = \
 	$(LIBGVC_CFLAGS) \
 	$(GLIB_CFLAGS) \
 	$(GMODULE_CFLAGS) \
-	-I$(top_srcdir)/gee \
+	-I$(top_builddir)/gee \
 	$(NULL)
 
 AM_VALAFLAGS = \
@@ -183,7 +183,7 @@ libvaladoc.vala.stamp: $(libvaladoc_la_VALASOURCES)
 		--vapi valadoc@PACKAGE_SUFFIX@.vapi \
 		--vapidir $(top_srcdir)/vapi --pkg gmodule-2.0 \
 		--vapidir $(top_srcdir)/valadoc/vapi --pkg libgvc \
-		--vapidir $(top_srcdir)/gee --pkg gee \
+		--vapidir $(top_builddir)/gee --pkg gee \
 		--pkg config \
 		$(filter %.vala %.c,$^)
 	touch $@
diff --git a/vala/Makefile.am b/vala/Makefile.am
index e6cf9f0a6..893cf320b 100644
--- a/vala/Makefile.am
+++ b/vala/Makefile.am
@@ -4,7 +4,7 @@ NULL =
 
 AM_CPPFLAGS = \
 	$(COVERAGE_CFLAGS) \
-	-I$(top_srcdir)/gee \
+	-I$(top_builddir)/gee \
 	$(GLIB_CFLAGS) \
 	$(GMODULE_CFLAGS) \
 	-DPACKAGE_DATADIR=\"$(pkgdatadir)\" \
@@ -185,7 +185,7 @@ vala.vapi vala.vala.stamp: $(libvala_la_VALASOURCES)
 		$(VALAFLAGS) \
 		-C \
 		--vapidir $(top_srcdir)/vapi --pkg gmodule-2.0 --pkg gobject-2.0 \
-		--vapidir $(top_srcdir)/gee --pkg gee \
+		--vapidir $(top_builddir)/gee --pkg gee \
 		--pkg config \
 		--use-header \
 		-H vala.h \
@@ -207,7 +207,7 @@ libvala@PACKAGE_SUFFIX@_la_LIBADD = \
 vapidir = $(datadir)/vala/vapi
 dist_vapi_DATA = libvala@PACKAGE_SUFFIX@.vapi
 
-libvala@PACKAGE_SUFFIX@.vapi: $(top_srcdir)/gee/gee.vapi $(top_srcdir)/vala/vala.vapi
+libvala@PACKAGE_SUFFIX@.vapi: $(top_builddir)/gee/gee.vapi $(top_builddir)/vala/vala.vapi
 	cat $^ > $@
 
 EXTRA_DIST = $(libvala_la_VALASOURCES) vala.vapi vala.vala.stamp vala.h
diff --git a/valadoc/Makefile.am b/valadoc/Makefile.am
index a830df857..eeb98e3d1 100644
--- a/valadoc/Makefile.am
+++ b/valadoc/Makefile.am
@@ -11,11 +11,11 @@ SUBDIRS = \
 AM_CFLAGS = \
 	-DPACKAGE_DATADIR=\"$(libdir)/valadoc\" \
 	-DPACKAGE_VERSION=\"$(VERSION)\" \
-	-I$(top_srcdir)/libvaladoc/ \
-	-I$(top_srcdir)/gee \
-	-I$(top_srcdir)/ccode \
-	-I$(top_srcdir)/vala \
-	-I$(top_srcdir)/codegen \
+	-I$(top_builddir)/libvaladoc/ \
+	-I$(top_builddir)/gee \
+	-I$(top_builddir)/ccode \
+	-I$(top_builddir)/vala \
+	-I$(top_builddir)/codegen \
 	$(GLIB_CFLAGS) \
 	$(GMODULE_CFLAGS) \
 	$(LIBGVC_CFLAGS) \
@@ -49,17 +49,17 @@ valadoc_LDADD = \
 	$(LIBGVC_LIBS) \
 	$(NULL)
 
-valadoc.vala.stamp: $(valadoc_VALASOURCES) $(top_srcdir)/vala/libvala@PACKAGE_SUFFIX@.vapi $(top_srcdir)/libvaladoc/valadoc@PACKAGE_SUFFIX@.vapi
+valadoc.vala.stamp: $(valadoc_VALASOURCES) $(top_builddir)/vala/libvala@PACKAGE_SUFFIX@.vapi $(top_builddir)/libvaladoc/valadoc@PACKAGE_SUFFIX@.vapi
 	$(VALA_V)$(VALAC) \
 		$(VALAFLAGS) \
 		-C \
-		--vapidir $(top_srcdir)/vala \
+		--vapidir $(top_builddir)/vala \
 		--vapidir $(top_srcdir)/vapi \
 		--pkg gmodule-2.0 \
 		--pkg gobject-2.0 \
-		--vapidir $(top_srcdir)/ccode --pkg ccode \
-		--vapidir $(top_srcdir)/codegen --pkg codegen \
-		--vapidir $(top_srcdir)/libvaladoc --pkg valadoc@PACKAGE_SUFFIX@ \
+		--vapidir $(top_builddir)/ccode --pkg ccode \
+		--vapidir $(top_builddir)/codegen --pkg codegen \
+		--vapidir $(top_builddir)/libvaladoc --pkg valadoc@PACKAGE_SUFFIX@ \
 		--pkg config \
 		$(filter %.vala %.c,$^)
 	touch $@
diff --git a/valadoc/doclets/devhelp/Makefile.am b/valadoc/doclets/devhelp/Makefile.am
index 456826ba4..6251b1300 100644
--- a/valadoc/doclets/devhelp/Makefile.am
+++ b/valadoc/doclets/devhelp/Makefile.am
@@ -4,8 +4,8 @@ NULL =
 
 AM_CFLAGS = \
 	-DPACKAGE_ICONDIR=\"$(datadir)/valadoc/icons/\" \
-	-I$(top_srcdir)/gee/ \
-	-I$(top_srcdir)/libvaladoc/ \
+	-I$(top_builddir)/gee/ \
+	-I$(top_builddir)/libvaladoc/ \
 	$(GLIB_CFLAGS) \
 	$(LIBGVC_CFLAGS) \
 	$(NULL)
@@ -31,9 +31,9 @@ libdoclet.vala.stamp: $(libdoclet_la_VALASOURCES)
 	$(VALA_V)$(VALAC) \
 		$(VALAFLAGS) \
 		-C \
-		--vapidir $(top_srcdir)/vala --pkg libvala@PACKAGE_SUFFIX@ \
+		--vapidir $(top_builddir)/vala --pkg libvala@PACKAGE_SUFFIX@ \
 		--vapidir $(top_srcdir)/vapi \
-		--vapidir $(top_srcdir)/libvaladoc --pkg valadoc@PACKAGE_SUFFIX@ \
+		--vapidir $(top_builddir)/libvaladoc --pkg valadoc@PACKAGE_SUFFIX@ \
 		$(filter %.vala %.c,$^)
 	touch $@
 
diff --git a/valadoc/doclets/gtkdoc/Makefile.am b/valadoc/doclets/gtkdoc/Makefile.am
index a1a3852e5..370e63387 100644
--- a/valadoc/doclets/gtkdoc/Makefile.am
+++ b/valadoc/doclets/gtkdoc/Makefile.am
@@ -4,8 +4,8 @@ NULL =
 
 AM_CFLAGS = \
 	-DPACKAGE_ICONDIR=\"$(datadir)/valadoc/icons/\" \
-	-I$(top_srcdir)/gee/ \
-	-I$(top_srcdir)/libvaladoc/ \
+	-I$(top_builddir)/gee/ \
+	-I$(top_builddir)/libvaladoc/ \
 	$(GLIB_CFLAGS) \
 	$(LIBGVC_CFLAGS) \
 	$(NULL)
@@ -36,9 +36,9 @@ libdoclet.vala.stamp: $(libdoclet_la_VALASOURCES)
 	$(VALA_V)$(VALAC) \
 		$(VALAFLAGS) \
 		-C \
-		--vapidir $(top_srcdir)/vala --pkg libvala@PACKAGE_SUFFIX@ \
+		--vapidir $(top_builddir)/vala --pkg libvala@PACKAGE_SUFFIX@ \
 		--vapidir $(top_srcdir)/vapi \
-		--vapidir $(top_srcdir)/libvaladoc --pkg valadoc@PACKAGE_SUFFIX@ \
+		--vapidir $(top_builddir)/libvaladoc --pkg valadoc@PACKAGE_SUFFIX@ \
 		$(filter %.vala %.c,$^)
 	touch $@
 
diff --git a/valadoc/doclets/html/Makefile.am b/valadoc/doclets/html/Makefile.am
index 43ae56e37..d4f16245a 100644
--- a/valadoc/doclets/html/Makefile.am
+++ b/valadoc/doclets/html/Makefile.am
@@ -4,8 +4,8 @@ NULL =
 
 AM_CFLAGS = \
 	-DPACKAGE_ICONDIR=\"$(datadir)/valadoc/icons/\" \
-	-I$(top_srcdir)/gee/ \
-	-I$(top_srcdir)/libvaladoc/ \
+	-I$(top_builddir)/gee/ \
+	-I$(top_builddir)/libvaladoc/ \
 	$(GLIB_CFLAGS) \
 	$(LIBGVC_CFLAGS) \
 	$(NULL)
@@ -31,9 +31,9 @@ libdoclet.vala.stamp: $(libdoclet_la_VALASOURCES)
 	$(VALA_V)$(VALAC) \
 		$(VALAFLAGS) \
 		-C \
-		--vapidir $(top_srcdir)/vala --pkg libvala@PACKAGE_SUFFIX@ \
+		--vapidir $(top_builddir)/vala --pkg libvala@PACKAGE_SUFFIX@ \
 		--vapidir $(top_srcdir)/vapi \
-		--vapidir $(top_srcdir)/libvaladoc --pkg valadoc@PACKAGE_SUFFIX@ \
+		--vapidir $(top_builddir)/libvaladoc --pkg valadoc@PACKAGE_SUFFIX@ \
 		$(filter %.vala %.c,$^)
 	touch $@
 
diff --git a/valadoc/tests/Makefile.am b/valadoc/tests/Makefile.am
index e18e15856..239bd4778 100644
--- a/valadoc/tests/Makefile.am
+++ b/valadoc/tests/Makefile.am
@@ -2,6 +2,8 @@ include $(top_srcdir)/Makefile.common
 
 NULL =
 
+VPATH = $(srcdir) $(builddir)
+
 TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) PACKAGE_SUFFIX=$(PACKAGE_SUFFIX) TOPBUILDDIR=$(abs_top_builddir) TOPSRCDIR=$(abs_top_srcdir) $(srcdir)/testrunner.sh
 
 TESTS = \
@@ -23,11 +25,11 @@ AM_CFLAGS = \
 	-DPACKAGE_DATADIR=\"$(libdir)/valadoc\" \
 	-DPACKAGE_VERSION=\"$(VERSION)\" \
 	-DTOP_SRC_DIR=\"$(abs_top_srcdir)\" \
-	-I$(top_srcdir)/libvaladoc/ \
-	-I$(top_srcdir)/gee \
-	-I$(top_srcdir)/ccode \
-	-I$(top_srcdir)/vala \
-	-I$(top_srcdir)/codegen \
+	-I$(top_builddir)/libvaladoc/ \
+	-I$(top_builddir)/gee \
+	-I$(top_builddir)/ccode \
+	-I$(top_builddir)/vala \
+	-I$(top_builddir)/codegen \
 	$(GLIB_CFLAGS) \
 	$(GMODULE_CFLAGS) \
 	$(LIBGVC_CFLAGS) \
@@ -49,8 +51,8 @@ driver_VALASOURCES = \
 
 driver_SOURCES = \
 	driver.vala.stamp \
-	drivers/driver-test.c \
-	drivers/generic-api-test.c \
+	driver-test.c \
+	generic-api-test.c \
 	driver.c \
 	girwriter.c \
 	initializerbuilder.c \
@@ -68,7 +70,10 @@ driver_LDADD = \
 	$(LIBGVC_LIBS) \
 	$(NULL)
 
-driver.vala.stamp: $(driver_VALASOURCES) $(top_srcdir)/vala/libvala@PACKAGE_SUFFIX@.vapi $(top_srcdir)/libvaladoc/valadoc@PACKAGE_SUFFIX@.vapi
+drivers/driver-test.c drivers/generic-api-test.c driver.c girwriter.c \
+initializerbuilder.c symbolresolver.c treebuilder.c: driver.vala.stamp
+
+driver.vala.stamp: $(driver_VALASOURCES) $(top_builddir)/vala/libvala@PACKAGE_SUFFIX@.vapi $(top_builddir)/libvaladoc/valadoc@PACKAGE_SUFFIX@.vapi
 	$(VALA_V)$(VALAC) \
 		$(VALAFLAGS) \
 		-C \
@@ -76,10 +81,10 @@ driver.vala.stamp: $(driver_VALASOURCES) $(top_srcdir)/vala/libvala@PACKAGE_SUFF
 		--pkg gmodule-2.0 \
 		--pkg gobject-2.0 \
 		--pkg libgvc \
-		--vapidir $(top_srcdir)/vala --pkg libvala@PACKAGE_SUFFIX@ \
-		--vapidir $(top_srcdir)/ccode --pkg ccode \
-		--vapidir $(top_srcdir)/codegen --pkg codegen \
-		--vapidir $(top_srcdir)/libvaladoc --pkg valadoc@PACKAGE_SUFFIX@ \
+		--vapidir $(top_builddir)/vala --pkg libvala@PACKAGE_SUFFIX@ \
+		--vapidir $(top_builddir)/ccode --pkg ccode \
+		--vapidir $(top_builddir)/codegen --pkg codegen \
+		--vapidir $(top_builddir)/libvaladoc --pkg valadoc@PACKAGE_SUFFIX@ \
 		--pkg config \
 		$(filter %.vala %.c,$^)
 	touch $@
diff --git a/valadoc/tests/drivers/generic-api-test.vala b/valadoc/tests/drivers/generic-api-test.vala
index 759120543..8da2f2f04 100644
--- a/valadoc/tests/drivers/generic-api-test.vala
+++ b/valadoc/tests/drivers/generic-api-test.vala
@@ -2723,6 +2723,9 @@ public static void test_driver () {
 	settings.vapi_directories = { Path.build_filename (TOP_SRC_DIR, "vapi") };
 	settings.pkg_name = "out";
 	settings.path = "out";
+	settings.vapi_directories = {
+		TOP_SRC_DIR + "/vapi"
+	};
 
 
 	var driver = new Valadoc.Drivers.Driver ();
diff --git a/valadoc/tests/testrunner.sh b/valadoc/tests/testrunner.sh
index 842082d47..98edb947f 100755
--- a/valadoc/tests/testrunner.sh
+++ b/valadoc/tests/testrunner.sh
@@ -26,12 +26,8 @@ topsrcdir=$TOPSRCDIR
 vapidir=$topsrcdir/vapi
 
 export G_DEBUG=fatal_warnings
-export PKG_CONFIG_PATH=$topbuilddir/libvaladoc
-export LD_LIBRARY_PATH=$topbuilddir/vala/.libs:$topbuilddir/libvaladoc/.libs
-
 VALAC=$topbuilddir/compiler/valac$EXEEXT
-VALAFLAGS="-X -D -X TOP_SRC_DIR=\"$topsrcdir\" --vapidir $vapidir --pkg libgvc --vapidir $topsrcdir/vala --pkg libvala$PACKAGE_SUFFIX --vapidir $topsrcdir/libvaladoc --pkg valadoc$PACKAGE_SUFFIX --disable-warnings --main main --save-temps -X -g -X -O0 -X -pipe -X -lm -X -Werror=return-type -X -Werror=init-self -X -Werror=implicit -X -Werror=sequence-point -X -Werror=return-type -X -Werror=uninitialized -X -Werror=pointer-arith -X -Werror=int-to-pointer-cast -X -Werror=pointer-to-int-cast -X -Wformat -X -Werror=format-security -X -Werror=format-nonliteral -X -Werror=redundant-decls -X -Werror=int-conversion -X -L$topbuilddir/vala/.libs -X -lvala$PACKAGE_SUFFIX -X -L$topbuilddir/libvaladoc/.libs -X -lvaladoc$PACKAGE_SUFFIX -X -I$topsrcdir/gee -X -I$topsrcdir/vala -X -I$topsrcdir/libvaladoc $topsrcdir/valadoc/tests/libvaladoc/parser/generic-scanner.vala"
-
+VALAFLAGS="-X -D -X TOP_SRC_DIR=\"$topsrcdir\" --vapidir $vapidir --pkg libgvc --vapidir $topbuilddir/vala --pkg libvala$PACKAGE_SUFFIX --vapidir $topbuilddir/libvaladoc --pkg valadoc$PACKAGE_SUFFIX --disable-warnings --main main --save-temps -X -g -X -O0 -X -pipe -X -lm -X -Werror=return-type -X -Werror=init-self -X -Werror=implicit -X -Werror=sequence-point -X -Werror=return-type -X -Werror=uninitialized -X -Werror=pointer-arith -X -Werror=int-to-pointer-cast -X -Werror=pointer-to-int-cast -X -Wformat -X -Werror=format-security -X -Werror=format-nonliteral -X -Werror=redundant-decls -X -Werror=int-conversion -X -L$topbuilddir/gee/.libs -X -lgee -X -L$topbuilddir/libvaladoc/.libs -X -lvaladoc$PACKAGE_SUFFIX -X -I$topbuilddir/gee -X -I$topbuilddir/libvaladoc $topsrcdir/valadoc/tests/libvaladoc/parser/generic-scanner.vala"
 
 # Incorporate the user's CFLAGS. Matters if the user decided to insert
 # -m32 in CFLAGS, for example.
@@ -56,7 +52,7 @@ void main (string[] args) {
 	switch (args[1]) {
 EOF
 
-PACKAGES=gio-2.0
+PACKAGES="gio-2.0 gobject-2.0 glib-2.0"
 SOURCEFILES=
 for testfile in "$@"; do
 	rm -f prepare check
diff --git a/vapigen/Makefile.am b/vapigen/Makefile.am
index ece0c6c7a..3200dab8d 100644
--- a/vapigen/Makefile.am
+++ b/vapigen/Makefile.am
@@ -8,9 +8,9 @@ SUBDIRS = \
 
 AM_CPPFLAGS = \
 	$(GLIB_CFLAGS) \
-	-I$(top_srcdir)/gee \
-	-I$(top_srcdir)/ccode \
-	-I$(top_srcdir)/vala \
+	-I$(top_builddir)/gee \
+	-I$(top_builddir)/ccode \
+	-I$(top_builddir)/vala \
 	-I$(top_srcdir)/gobject-introspection \
 	$(NULL)
 
@@ -45,8 +45,8 @@ vapigen.vala.stamp: $(vapigen_VALASOURCES)
 		$(VALAFLAGS) \
 		-C \
 		--vapidir $(top_srcdir)/vapi \
-		--vapidir $(top_srcdir)/gee --pkg gee \
-		--vapidir $(top_srcdir)/vala --pkg vala \
+		--vapidir $(top_builddir)/gee --pkg gee \
+		--vapidir $(top_builddir)/vala --pkg vala \
 		--vapidir $(top_srcdir)/gobject-introspection --pkg gidl \
 		--pkg config \
 		$^
@@ -57,8 +57,8 @@ vapicheck.vala.stamp: $(vapicheck_VALASOURCES)
 		$(VALAFLAGS) \
 		-C \
 		--vapidir $(top_srcdir)/vapi \
-		--vapidir $(top_srcdir)/gee --pkg gee \
-		--vapidir $(top_srcdir)/vala --pkg vala \
+		--vapidir $(top_builddir)/gee --pkg gee \
+		--vapidir $(top_builddir)/vala --pkg vala \
 		--vapidir $(top_srcdir)/gobject-introspection --pkg gidl \
 		--pkg config \
 		$^
