diff --git a/t/vala-libs-distcheck.sh b/t/vala-libs-distcheck.sh
new file mode 100644
index 0000000..99f1e90
--- /dev/null
+++ b/t/vala-libs-distcheck.sh
@@ -0,0 +1,196 @@
+#! /bin/sh
+# Copyright (C) 2012-2016 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Building libraries (libtool and static) from Vala sources.
+# And use of vapi files to call C code from Vala.
+
+required="valac cc pkg-config libtoolize GNUmake"
+am_create_testdir=empty
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AC_INIT([atest],[0.1])
+AC_CONFIG_SRCDIR([data/atest.pc.in])
+
+AC_SUBST([API_VERSION],[0])
+
+AM_INIT_AUTOMAKE
+AM_MAINTAINER_MODE([enable])
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AM_PROG_AR
+PKG_PROG_PKG_CONFIG([0.22])
+AM_PROG_VALAC([0.32])
+
+PKG_CHECK_MODULES(ATEST, [gio-2.0])
+
+LT_INIT
+AC_CONFIG_FILES([
+	Makefile
+
+	src/Makefile
+
+	src/atest-$API_VERSION.deps:src/atest.deps.in
+
+	data/Makefile
+	data/atest-$API_VERSION.pc:data/atest.pc.in
+
+],[],
+[API_VERSION='$API_VERSION'])
+AC_OUTPUT
+END
+
+
+cat > Makefile.am << 'END'
+SUBDIRS=data src
+END
+
+mkdir data
+
+cat > data/atest.pc.in << 'END'
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+datarootdir=@datarootdir@
+datadir=@datadir@
+includedir=@includedir@
+
+Name: atest-@API_VERSION@
+Description: atest library
+Version: @VERSION@
+Requires: glib-2.0 gobject-2.0
+Libs: -L${libdir} -latest-@API_VERSION@
+Cflags: -I${includedir}/atest-@API_VERSION@
+END
+
+
+cat > data/Makefile.am << 'END'
+# pkg-config data
+# Note that the template file is called atest.pc.in, but generates a
+# versioned .pc file using some magic in AC_CONFIG_FILES.
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = atest-$(API_VERSION).pc
+
+DISTCLEANFILES = $(pkgconfig_DATA)
+EXTRA_DIST = atest.pc.in
+END
+
+mkdir src
+
+cat > src/atest.deps.in << 'END'
+glib-2.0
+END
+
+
+cat > src/atest.vala << 'END'
+using GLib;
+
+namespace Atest {
+	public class A {
+		public bool foo() { return false; }
+	}
+}
+END
+
+cat > src/Makefile.am << 'END'
+lib_LTLIBRARIES = libatest-@API_VERSION@.la
+
+libatest_@API_VERSION@_la_SOURCES = \
+	atest.vala \
+	cservice.c \
+	cservice.h \
+	$(NULL)
+
+
+libatest_@API_VERSION@_la_CPPFLAGS = \
+	-DOKOKIMDEFINED=1 \
+	$(NULL)
+
+libatest_@API_VERSION@_la_CFLAGS = \
+	$(ATEST_CFLAGS) \
+	$(WARN_CFLAGS) \
+	$(NULL)
+
+libatest_@API_VERSION@_la_LIBADD = \
+	$(ATEST_LIBS) \
+	$(NULL)
+
+libatest_@API_VERSION@_la_LDFLAGS = \
+	$(WARN_LDFLAGS) \
+	$(NULL)
+
+libatest_@API_VERSION@_la_VALAFLAGS = \
+	--vapidir=$(VAPIDIR) \
+	--vapidir=$(srcdir) \
+	--pkg cservice \
+	--thread \
+	--target-glib=2.44 \
+	--pkg glib-2.0 \
+	-H atest.h \
+	--library atest-@API_VERSION@ \
+	$(NULL)
+
+header_DATA=atest.h
+headerdir=$(includedir)/atest-@API_VERSION@/atest
+
+atest-@API_VERSION@.deps:
+	cp atest.deps atest-@API_VERSION@.deps
+
+vapi_DATA=atest-@API_VERSION@.vapi atest-@API_VERSION@.deps
+vapidir=$(VAPIDIR)
+
+CLEANFILES = atest-@API_VERSION@.deps
+END
+
+
+cat > src/cservice.c << 'END'
+#include "cservice.h"
+int c_service_mu_call (void)
+{
+  return OKOKIMDEFINED;
+}
+END
+
+cat > src/cservice.h << 'END'
+int c_service_mu (void);
+END
+
+cat > src/cservice.vapi <<'END'
+namespace CService {
+  public class Mu {
+    [CCode (cheader_filename = "cservice.h", cname = "c_service_mu_call")]
+    public int call ();
+  }
+}
+END
+
+
+libtoolize
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE
+test -f src/libatest_0_la_vala.stamp
+test -f src/libatest-0.la
+
+$MAKE distcheck
+
+:
+
diff --git a/t/vala-libs-vpath.sh b/t/vala-libs-vpath.sh
new file mode 100644
index 0000000..330ce23
--- /dev/null
+++ b/t/vala-libs-vpath.sh
@@ -0,0 +1,108 @@
+#! /bin/sh
+# Copyright (C) 2012-2016 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Building libraries (libtool and static) from Vala sources.
+# And use of vapi files to call C code from Vala.
+
+required="valac cc pkg-config libtoolize GNUmake"
+am_create_testdir=empty
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AC_INIT([valalibs],[0.1])
+
+AC_CONFIG_MACRO_DIR([m4])
+
+AM_INIT_AUTOMAKE
+AM_PROG_AR
+LT_INIT
+
+AC_PROG_CC
+AC_CONFIG_FILES([Makefile src/Makefile])
+
+AM_PROG_VALAC([0.7.3])
+PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
+
+AC_OUTPUT
+END
+
+
+cat > Makefile.am << 'END'
+SUBDIRS=src
+END
+
+mkdir src
+
+cat > src/Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+lib_LTLIBRARIES = libservice.la
+libservice_la_SOURCES = service.vala cservice.c cservice.h
+libservice_la_CPPFLAGS = -DOKOKIMDEFINED=1
+libservice_la_VALAFLAGS = --vapidir=$(srcdir) --pkg cservice --library service
+AM_CFLAGS = $(GOBJECT_CFLAGS)
+END
+
+libtoolize
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+cat > src/cservice.c << 'END'
+#include "cservice.h"
+int c_service_mu_call (void)
+{
+  return OKOKIMDEFINED;
+}
+END
+
+cat > src/cservice.h << 'END'
+int c_service_mu (void);
+END
+
+cat > src/cservice.vapi <<'END'
+namespace CService {
+  public class Mu {
+    [CCode (cheader_filename = "cservice.h", cname = "c_service_mu_call")]
+    public int call ();
+  }
+}
+END
+
+cat > src/service.vala << 'END'
+namespace CService {
+public class Generator : Object {
+	public Generator () {
+		stdout.printf ("construct generator");
+	}
+	public void init () {
+		stdout.printf ("init generator");
+	}
+}
+}
+END
+
+mkdir build
+cd build
+../configure
+
+$MAKE
+pwd
+test -f src/libservice_la_vala.stamp
+test -f src/libservice.la
+
+
+:
+
