+# Note: to reliably test linking against the installed library we directly
+# refer to the just-installed .la file, rather than more typical library flags
+# (-Lfoo -lfoo). Otherwise libtool can pick up libcdecl.la from the current
+# working directory which defeats the point of an install check.
+EXTRA_PROGRAMS += t/installcheck
+t_installcheck_CPPFLAGS = -I$(DESTDIR)$(includedir)
+t_installcheck_LDADD = $(DESTDIR)$(libdir)/libcdecl.la
+t_installcheck_CFLAGS =
+t_installcheck_SHORTNAME = x
+
+installcheck-local:
+ rm -f t/installcheck$(EXEEXT) $(t_installcheck_OBJECTS)
+ $(MAKE) $(AM_MAKEFLAGS) t/installcheck$(EXEEXT)
+ t/installcheck$(EXEEXT) | diff - $(srcdir)/t/installcheck.exp
+.PHONY: installcheck-local
+EXTRA_DIST += t/installcheck.c t/installcheck.exp
+CLEANFILES += t/installcheck$(EXEEXT)
+