]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Refactor auth to use libauth.la
authorAki Tuomi <aki.tuomi@dovecot.fi>
Fri, 28 Apr 2017 07:25:14 +0000 (10:25 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Fri, 28 Apr 2017 08:54:15 +0000 (11:54 +0300)
This makes writing new unit tests easier, as you can link
to libauth.la.

src/auth/Makefile.am

index 0841f522f918fc8fb6b781035d8b9dc9a9e5ea1e..0f10f97d93737751d6dd544b38203ceba6fabb93 100644 (file)
@@ -1,4 +1,4 @@
-noinst_LTLIBRARIES = libpassword.la
+noinst_LTLIBRARIES = libpassword.la libauth.la
 auth_moduledir = $(moduledir)/auth
 
 # automake seems to force making this unconditional..
@@ -35,6 +35,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/src/lib-otp \
        -I$(top_srcdir)/src/lib-master \
        -I$(top_srcdir)/src/lib-oauth2 \
+       -I$(top_srcdir)/src/lib-ssl-iostream \
        -DAUTH_MODULE_DIR=\""$(auth_moduledir)"\" \
        -DPKG_LIBEXECDIR=\""$(pkglibexecdir)"\" \
        -DPKG_RUNDIR=\""$(rundir)"\" \
@@ -53,20 +54,22 @@ libpassword_la_SOURCES = \
        password-scheme-pbkdf2.c
 
 auth_libs = \
+       libauth.la \
        libstats_auth.la \
        libpassword.la \
        ../lib-ntlm/libntlm.la \
        ../lib-otp/libotp.la \
        $(LIBDOVECOT_SQL)
 
-auth_CPPFLAGS = $(AM_CPPFLAGS) $(BINARY_CFLAGS) \
-       -I$(top_srcdir)/src/lib-ssl-iostream
+auth_CPPFLAGS = $(AM_CPPFLAGS) $(BINARY_CFLAGS)
 auth_LDADD = $(auth_libs) $(LIBDOVECOT) $(AUTH_LIBS) $(BINARY_LDFLAGS)
 auth_DEPENDENCIES = $(auth_libs) $(LIBDOVECOT_DEPS)
+auth_SOURCES = main.c
 
 ldap_sources = db-ldap.c passdb-ldap.c userdb-ldap.c
 
-auth_SOURCES = \
+libauth_la_DEPENDENCIES = $(LIBDOVECOT_DEPS)
+libauth_la_SOURCES = \
        auth.c \
        auth-cache.c \
        auth-client-connection.c \
@@ -91,7 +94,6 @@ auth_SOURCES = \
        db-oauth2.c \
        db-sql.c \
        db-passwd-file.c \
-       main.c \
        mech.c \
        mech-anonymous.c \
        mech-plain.c \
@@ -234,13 +236,15 @@ test_libs = \
 test_auth_cache_SOURCES = auth-cache.c test-auth-cache.c
 test_auth_cache_LDADD = $(test_libs)
 test_auth_cache_DEPENDENCIES = $(pkglibexec_PROGRAMS) $(test_libs)
+# this is needed to force auth-cache.c recompilation
+test_auth_cache_CPPFLAGS = $(AM_CPPFLAGS)
 
-test_auth_request_var_expand_SOURCES = auth-request-var-expand.c auth-fields.c test-auth-request-var-expand.c
-test_auth_request_var_expand_LDADD = $(test_libs)
+test_auth_request_var_expand_SOURCES = test-auth-request-var-expand.c
+test_auth_request_var_expand_LDADD = $(test_libs) libauth.la
 test_auth_request_var_expand_DEPENDENCIES = $(pkglibexec_PROGRAMS) $(test_libs)
 
-test_db_dict_SOURCES = db-dict-cache-key.c test-db-dict.c
-test_db_dict_LDADD = $(test_libs)
+test_db_dict_SOURCES = test-db-dict.c
+test_db_dict_LDADD = $(test_libs) libauth.la
 test_db_dict_DEPENDENCIES = $(pkglibexec_PROGRAMS) $(test_libs)
 
 check: check-am check-test