+# test/Makefile.am for libevent
+# Copyright 2000-2007 Niels Provos
+# Copyright 2007-2012 Niels Provos and Nick Mathewson
+#
+# See LICENSE for copying information.
+
AUTOMAKE_OPTIONS = foreign
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/compat -I$(top_srcdir)/include -I../include -DTINYTEST_LOCAL
-EXTRA_DIST = regress.rpc regress.gen.h regress.gen.c test.sh
+EXTRA_DIST = regress.rpc regress.gen.h regress.gen.c rpcgen_wrapper.sh test.sh
noinst_PROGRAMS = test-init test-eof test-weof test-time \
bench bench_cascade bench_http bench_httpclient test-ratelim \
EXTRA_PROGRAMS = regress
noinst_HEADERS = tinytest.h tinytest_macros.h regress.h tinytest_local.h
-TESTS = $(top_srcdir)/test/test.sh
+# TESTS = $(top_srcdir)/test/test.sh
BUILT_SOURCES =
if BUILD_REGRESS
if OPENSSL
regress_SOURCES += regress_ssl.c
-regress_LDADD += ../libevent_openssl.la
+regress_LDADD += ../libevent_openssl.la -lssl -lcrypto ${OPENSSL_LIBADD}
endif
bench_SOURCES = bench.c
bench_httpclient_SOURCES = bench_httpclient.c
bench_httpclient_LDADD = $(LIBEVENT_GC_SECTIONS) ../libevent_core.la
-regress.gen.c regress.gen.h: regress.rpc $(top_srcdir)/event_rpcgen.py
- $(top_srcdir)/event_rpcgen.py $(srcdir)/regress.rpc || echo "No Python installed"
+regress.gen.c regress.gen.h: rpcgen-attempted
+
+rpcgen-attempted: $(srcdir)/regress.rpc $(srcdir)/../event_rpcgen.py $(srcdir)/rpcgen_wrapper.sh
+ date -u > $@
+ if $(srcdir)/rpcgen_wrapper.sh $(srcdir); then \
+ echo "rpcgen okay"; \
+ else \
+ echo "No Python installed; stubbing out RPC test." >&2; \
+ echo " "> regress.gen.c; \
+ echo "#define NO_PYTHON_EXISTS" > regress.gen.h; \
+ fi
+
+CLEANFILES = rpcgen-attempted
DISTCLEANFILES = *~