ACLOCAL_AMFLAGS = -Im4
lib_LTLIBRARIES = libfuckit.la
-bin_PROGRAMS = segfault
+check_PROGRAMS = segfault
EXTRA_DIST = version
libfuckit_la_CXXFLAGS = -std=gnu++0x @LLVM_CFLAGS@ $(AM_CFLAGS) -Wall -Wextra -pedantic -Werror
libfuckit_la_SOURCES = fuckit.cpp
segfault_SOURCES = segfault.c
+
+check_SCRIPTS = check_segfault
+TESTS = check_segfault
--- /dev/null
+#!/bin/bash
+
+set -e
+
+LIBS=@top_builddir@/.libs
+test -f $LIBS/libfuckit.so
+
+LD_PRELOAD=$LIBS/libfuckit.so @top_builddir@/segfault
AX_PATH_GENERIC([llvm],,,,[AC_MSG_ERROR([llvm-config is required])])
AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([check_segfault], [chmod a+x check_segfault])
AC_OUTPUT