Commit b700ec40 authored by Nils Goroll's avatar Nils Goroll

better automake definitions - use shared lib for command line utilities

parent d05cee2f
......@@ -104,6 +104,10 @@ AM_CONDITIONAL([BUILD_VMOD], [test "x$VARNISHSRC" != x])
if test "x$VARNISHSRC" = x; then
AC_MSG_WARN([No Varnish source - wont build the vmod])
else
if test "x$enable_shared" != "xyes"; then
AC_MSG_FAILURE([--enable-shared is required for building the vmod])
fi
AC_CHECK_PROGS(PYTHON, [python3 python3.1 python3.2 python2.7 python2.6 python2.5 python2 python], [AC_MSG_ERROR([Python is needed to build this vmod, please install python.])])
VARNISHSRC=`cd $VARNISHSRC && pwd`
......
......@@ -3,36 +3,40 @@
AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS = gen
AM_CPPFLAGS = -Igen
bin_PROGRAMS = dcs dcs_test
SUBDIRS = gen
dcs_match_SOURCES = \
gen/dcs_classifier.h \
include_HEADERS = \
dcs_match.h \
dcs_match.c
dcs_type.h
dcs_type_SOURCES = \
gen/dcs_classifier.h \
dcs_type.h \
dcs_type.c
lib_LTLIBRARIES = libdcs.la
dcs_test_CPPFLAGS = -Igen
bin_PROGRAMS = dcs dcs_test
dcs_test_SOURCES = \
libdcs_la_SOURCES = \
gen/dcs_classifier.h \
gen/dcs_classifier.c \
$(dcs_match_SOURCES) \
$(dcs_type_SOURCES) \
dcs_test.c
dcs_match.c \
dcs_type.c
# -- dcs
dcs_CPPFLAGS = -Igen
dcs_LDADD = libdcs.la
dcs_SOURCES = \
gen/dcs_classifier.c \
$(dcs_match_SOURCES) \
$(dcs_type_SOURCES) \
dcs.c
# -- dcs_test
dcs_test_LDADD = libdcs.la
dcs_test_SOURCES = \
dcs_test.c
# -
EXTRA_DIST = gen_dcs_classifier.pl
# included c source
......@@ -56,6 +60,11 @@ endif
## varnish 3 vmod
if BUILD_VMOD
# no libvmod_dcs_la_LIBADD here: vmod_dcs.c includes dcs_varnish.c, so
# libvmod_dcs.so will include an own copy of the code without the
# overhead of library calls - at the cost of some memory overhead
vmoddir = $(VMODDIR)
vmod_LTLIBRARIES = libvmod_dcs.la
......@@ -87,7 +96,7 @@ VMOD_TESTS = tests/*.vtc
.PHONY: $(VMOD_TESTS)
tests/*.vtc:
tests/*.vtc: libvmod_dcs.la
$(VARNISHSRC)/bin/varnishtest/varnishtest -Dvarnishd=$(VARNISHSRC)/bin/varnishd/varnishd -Dvmod_topbuild=$(abs_top_builddir) $@
check: $(VMOD_TESTS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment