summaryrefslogtreecommitdiffstats
path: root/src/lib-lua/Makefile.am
blob: 34164892fa905ddfaac915c7de7b1bb95d739878 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
AM_CPPFLAGS = \
	-I$(top_srcdir)/src/lib \
	-I$(top_srcdir)/src/lib-test \
	-I$(top_srcdir)/src/lib-dict \
	-I$(top_srcdir)/src/lib-http \
	-I$(top_srcdir)/src/lib-ssl-iostream \
	-I$(top_srcdir)/src/lib-master \
	$(LUA_CFLAGS)

pkglib_LTLIBRARIES = libdovecot-lua.la
libdovecot_lua_la_SOURCES = \
	dlua-script.c \
	dlua-pushstring.c \
	dlua-error.c \
	dlua-dovecot.c \
	dlua-dovecot-http.c \
	dlua-compat.c \
	dlua-resume.c \
	dlua-table.c \
	dlua-thread.c

test_programs = test-lua

LIBDICT_LUA=
if DLUA_WITH_YIELDS
LIBDICT_LUA += ../lib-dict/libdict_lua.la
test_programs += test-dict-lua
endif

# Note: the only things this lib should depend on are libdovecot and lua.
libdovecot_lua_la_DEPENDENCIES = \
	../lib-dovecot/libdovecot.la \
	$(LIBDICT_LUA)
libdovecot_lua_la_LIBADD = \
	../lib-dovecot/libdovecot.la \
	$(LIBDICT_LUA) \
	$(LUA_LIBS)
libdovecot_lua_la_LDFLAGS = -export-dynamic

headers = \
	dlua-compat.h \
	dlua-script.h \
	dlua-script-private.h \
	dlua-wrapper.h

pkginc_libdir=$(pkgincludedir)
pkginc_lib_HEADERS = $(headers)

noinst_PROGRAMS = $(test_programs)

test_libs =\
 libdovecot-lua.la \
 ../lib-dovecot/libdovecot.la

test_lua_SOURCES = test-lua.c
test_lua_CFLAGS = $(AM_CPPFLAGS) $(BINARY_CFLAGS)
test_lua_LDFLAGS = $(BINARY_LDFLAGS)
test_lua_LDADD = $(test_libs) $(LUA_LIBS)
test_lua_DEPENDENCIES = $(test_libs)

test_dict_lua_SOURCES = test-dict-lua.c
test_dict_lua_LDADD = $(test_libs) $(LUA_LIBS)
test_dict_lua_DEPENDENCIES = $(test_libs)

check-local:
	for bin in $(test_programs); do \
	  if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \
	done