e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainennoinst_LTLIBRARIES = libdict_backend.la
2ce0021487fbd7ef3384f3456fa4a176309c4ebfTimo Sirainenmodule_dictdir = $(moduledir)/dict
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainendict_drivers = @dict_drivers@
e5224c0589916fb22f95f959326cf4b6221715b0Timo SirainenAM_CPPFLAGS = \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen -I$(top_srcdir)/src/lib \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen -I$(top_srcdir)/src/lib-test \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen -I$(top_srcdir)/src/lib-dict \
2ce0021487fbd7ef3384f3456fa4a176309c4ebfTimo Sirainen -I$(top_srcdir)/src/lib-ldap \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen -I$(top_srcdir)/src/lib-sql \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen -I$(top_srcdir)/src/lib-settings \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen $(SQL_CFLAGS)
e5224c0589916fb22f95f959326cf4b6221715b0Timo SirainenNOPLUGIN_LDFLAGS =
02b352f203caaee32b3f6de9b07ce619499e849bTimo Sirainenldap_sources = \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainenlibdict_backend_la_SOURCES = \
02b352f203caaee32b3f6de9b07ce619499e849bTimo Sirainen $(ldap_sources)
02b352f203caaee32b3f6de9b07ce619499e849bTimo Sirainenlibdict_backend_la_LIBADD =
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainennodist_libdict_backend_la_SOURCES = \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainennoinst_HEADERS = \
02b352f203caaee32b3f6de9b07ce619499e849bTimo Sirainenif LDAP_PLUGIN
2ce0021487fbd7ef3384f3456fa4a176309c4ebfTimo Sirainenlibdict_ldap_la_DEPENDENCIES = $(LIBDOVECOT_LDAP) $(LIBDOVECOT_DEPS)
2ce0021487fbd7ef3384f3456fa4a176309c4ebfTimo Sirainenlibdict_ldap_la_LDFLAGS = -module -avoid-version
2ce0021487fbd7ef3384f3456fa4a176309c4ebfTimo Sirainenlibdict_ldap_la_LIBADD = $(LIBDOVECOT_LDAP) $(LIBDOVECOT)
02b352f203caaee32b3f6de9b07ce619499e849bTimo Sirainenlibdict_ldap_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_BUILD
02b352f203caaee32b3f6de9b07ce619499e849bTimo Sirainenlibdict_ldap_la_SOURCES = $(ldap_sources)
02b352f203caaee32b3f6de9b07ce619499e849bTimo Sirainenlibdict_backend_la_LIBADD += $(LIBDOVECOT_LDAP)
02b352f203caaee32b3f6de9b07ce619499e849bTimo Sirainendict_drivers += ldap
2ce0021487fbd7ef3384f3456fa4a176309c4ebfTimo Sirainenmodule_dict_LTLIBRARIES = \
2ce0021487fbd7ef3384f3456fa4a176309c4ebfTimo Sirainen $(LIBDICT_LDAP)
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainendict-drivers-register.c: Makefile $(top_builddir)/config.h
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo '/* this file automatically generated by Makefile */' >$@
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo '#include "lib.h"' >>$@
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo '#include "dict.h"' >>$@
02b352f203caaee32b3f6de9b07ce619499e849bTimo Sirainen echo '#include "ldap-client.h"' >>$@
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo '#include "dict-sql.h"' >>$@
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen for i in $(dict_drivers) null; do \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen if [ "$${i}" != "null" ]; then \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo "extern struct dict dict_driver_$${i};" >>$@ ; \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo 'void dict_drivers_register_all(void) {' >>$@
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo 'dict_drivers_register_builtin();' >>$@
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo 'dict_sql_register();' >>$@
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen for i in $(dict_drivers) null; do \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen if [ "$${i}" != "null" ]; then \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo "dict_driver_register(&dict_driver_$${i});" >>$@ ; \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo '}' >>$@
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo 'void dict_drivers_unregister_all(void) {' >>$@
02b352f203caaee32b3f6de9b07ce619499e849bTimo Sirainen echo '#ifdef BUILTIN_LDAP' >>$@
02b352f203caaee32b3f6de9b07ce619499e849bTimo Sirainen echo 'ldap_clients_cleanup();' >>$@
02b352f203caaee32b3f6de9b07ce619499e849bTimo Sirainen echo '#endif' >>$@
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo 'dict_drivers_unregister_builtin();' >>$@
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo 'dict_sql_unregister();' >>$@
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen for i in $(dict_drivers) null; do \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen if [ "$${i}" != "null" ]; then \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo "dict_driver_unregister(&dict_driver_$${i});" >>$@ ; \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen echo '}' >>$@
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainendistclean-generic:
4907296246c66d85ccc3600bd150151e5e074be6Timo Sirainentest_programs = \
4907296246c66d85ccc3600bd150151e5e074be6Timo Sirainen test-dict-sql
4907296246c66d85ccc3600bd150151e5e074be6Timo Sirainennoinst_PROGRAMS = $(test_programs)
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainentest_dict_sql_CFLAGS = $(AM_CPPFLAGS) -DDICT_SRC_DIR=\"$(top_srcdir)/src/lib-dict-backend\"
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainentest_dict_sql_SOURCES = \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainentest_dict_sql_LDADD = \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen $(noinst_LTLIBRARIES) \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainentest_dict_sql_DEPENDENCIES = \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen $(noinst_LTLIBRARIES) \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen for bin in $(test_programs) $(check_PROGRAMS); do \
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \