From: Timo Sirainen Date: Tue, 4 Mar 2025 14:15:37 +0000 (+0200) Subject: global: Split parts of lib-dns to lib-dns-client X-Git-Tag: 2.4.1~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce0464aa105756d84cc11c7a80169688f53302ab;p=thirdparty%2Fdovecot%2Fcore.git global: Split parts of lib-dns to lib-dns-client The next commit requires dns-util in lib-settings, while lib-dns-client requires lib-settings. --- diff --git a/configure.ac b/configure.ac index 9c5468e532..0537fb6f20 100644 --- a/configure.ac +++ b/configure.ac @@ -566,6 +566,7 @@ LIBDOVECOT_LA_LIBS='\ $(top_builddir)/src/lib-fs/libfs.la \ $(top_builddir)/src/lib-dict/libdict.la \ $(top_builddir)/src/lib-dns/libdns.la \ + $(top_builddir)/src/lib-dns-client/libdns-client.la \ $(top_builddir)/src/lib-imap/libimap.la \ $(top_builddir)/src/lib-mail/libmail.la \ $(top_builddir)/src/lib-sasl/libsasl.la \ @@ -807,6 +808,7 @@ src/lib-dict/Makefile src/lib-dict-backend/Makefile src/lib-dict-extra/Makefile src/lib-dns/Makefile +src/lib-dns-client/Makefile src/lib-doveadm/Makefile src/lib-fs/Makefile src/lib-language/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 2ae86b8e54..c7532536f5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,11 +12,12 @@ LIBDOVECOT_SUBDIRS = \ lib-test \ lib \ lib-var-expand \ + lib-dns \ lib-settings \ lib-otp \ lib-auth \ lib-auth-client \ - lib-dns \ + lib-dns-client \ lib-ssl-iostream \ lib-master \ lib-login \ diff --git a/src/auth/Makefile.am b/src/auth/Makefile.am index 7615c81fa7..4c6c4575f9 100644 --- a/src/auth/Makefile.am +++ b/src/auth/Makefile.am @@ -42,7 +42,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib-json \ -I$(top_srcdir)/src/lib-ldap \ -I$(top_srcdir)/src/lib-dict \ - -I$(top_srcdir)/src/lib-dns \ + -I$(top_srcdir)/src/lib-dns-client \ -I$(top_srcdir)/src/lib-http \ -I$(top_srcdir)/src/lib-sql \ -I$(top_srcdir)/src/lib-settings \ diff --git a/src/lib-dns-client/Makefile.am b/src/lib-dns-client/Makefile.am new file mode 100644 index 0000000000..9719dc1747 --- /dev/null +++ b/src/lib-dns-client/Makefile.am @@ -0,0 +1,55 @@ +noinst_LTLIBRARIES = libdns-client.la + +AM_CPPFLAGS = \ + -I$(top_srcdir)/src/lib \ + -I$(top_srcdir)/src/lib-test + +libdns_client_la_SOURCES = \ + dns-client-cache.c \ + dns-lookup.c + +headers = \ + dns-client-cache.h \ + dns-lookup.h + +test_programs = \ + test-dns-lookup + +noinst_PROGRAMS = $(test_programs) + +test_libs = \ + libdns-client.la \ + ../lib-dns/libdns.la \ + ../lib-test/libtest.la \ + ../lib/liblib.la + +test_dns_lookup_SOURCES = test-dns-lookup.c +test_dns_lookup_LDADD = $(test_libs) + +check-local: + for bin in $(test_programs); do \ + if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ + done + + +pkginc_libdir=$(pkgincludedir) +pkginc_lib_HEADERS = $(headers) + +# Internally, the dns methods yield via lua_yieldk() as implemented in Lua +# 5.3 and newer. +if DLUA_WITH_YIELDS +noinst_LTLIBRARIES += libdns_lua.la + +libdns_lua_la_SOURCES = \ + dns-lua.c +libdns_lua_la_CPPFLAGS = \ + $(AM_CPPFLAGS) \ + $(LUA_CFLAGS) \ + -I$(top_srcdir)/src/lib-lua +libdns_lua_la_LIBADD = +libdns_lua_la_DEPENDENCIES = \ + libdns-client.la + +headers += \ + dns-lua.h +endif diff --git a/src/lib-dns/dns-client-cache.c b/src/lib-dns-client/dns-client-cache.c similarity index 100% rename from src/lib-dns/dns-client-cache.c rename to src/lib-dns-client/dns-client-cache.c diff --git a/src/lib-dns/dns-client-cache.h b/src/lib-dns-client/dns-client-cache.h similarity index 100% rename from src/lib-dns/dns-client-cache.h rename to src/lib-dns-client/dns-client-cache.h diff --git a/src/lib-dns/dns-lookup.c b/src/lib-dns-client/dns-lookup.c similarity index 100% rename from src/lib-dns/dns-lookup.c rename to src/lib-dns-client/dns-lookup.c diff --git a/src/lib-dns/dns-lookup.h b/src/lib-dns-client/dns-lookup.h similarity index 100% rename from src/lib-dns/dns-lookup.h rename to src/lib-dns-client/dns-lookup.h diff --git a/src/lib-dns/dns-lua.c b/src/lib-dns-client/dns-lua.c similarity index 100% rename from src/lib-dns/dns-lua.c rename to src/lib-dns-client/dns-lua.c diff --git a/src/lib-dns/dns-lua.h b/src/lib-dns-client/dns-lua.h similarity index 100% rename from src/lib-dns/dns-lua.h rename to src/lib-dns-client/dns-lua.h diff --git a/src/lib-dns/test-dns-lookup.c b/src/lib-dns-client/test-dns-lookup.c similarity index 100% rename from src/lib-dns/test-dns-lookup.c rename to src/lib-dns-client/test-dns-lookup.c diff --git a/src/lib-dns/Makefile.am b/src/lib-dns/Makefile.am index a6c66580c6..fca2dccc71 100644 --- a/src/lib-dns/Makefile.am +++ b/src/lib-dns/Makefile.am @@ -5,17 +5,12 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib-test libdns_la_SOURCES = \ - dns-client-cache.c \ - dns-lookup.c \ dns-util.c headers = \ - dns-client-cache.h \ - dns-lookup.h \ dns-util.h test_programs = \ - test-dns-lookup \ test-dns-util noinst_PROGRAMS = $(test_programs) @@ -28,9 +23,6 @@ test_libs = \ test_dns_util_SOURCES = test-dns-util.c test_dns_util_LDADD = $(test_libs) -test_dns_lookup_SOURCES = test-dns-lookup.c -test_dns_lookup_LDADD = $(test_libs) - check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ @@ -39,22 +31,3 @@ check-local: pkginc_libdir=$(pkgincludedir) pkginc_lib_HEADERS = $(headers) - -# Internally, the dns methods yield via lua_yieldk() as implemented in Lua -# 5.3 and newer. -if DLUA_WITH_YIELDS -noinst_LTLIBRARIES += libdns_lua.la - -libdns_lua_la_SOURCES = \ - dns-lua.c -libdns_lua_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(LUA_CFLAGS) \ - -I$(top_srcdir)/src/lib-lua -libdns_lua_la_LIBADD = -libdns_lua_la_DEPENDENCIES = \ - libdns.la - -headers += \ - dns-lua.h -endif diff --git a/src/lib-doveadm/Makefile.am b/src/lib-doveadm/Makefile.am index 4dd4e43d15..07e7da69b5 100644 --- a/src/lib-doveadm/Makefile.am +++ b/src/lib-doveadm/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib \ -I$(top_srcdir)/src/lib-settings \ -I$(top_srcdir)/src/lib-auth-client \ - -I$(top_srcdir)/src/lib-dns \ + -I$(top_srcdir)/src/lib-dns-client \ -I$(top_srcdir)/src/lib-mail \ -I$(top_srcdir)/src/lib-master \ -I$(top_srcdir)/src/lib-ssl-iostream diff --git a/src/lib-http/Makefile.am b/src/lib-http/Makefile.am index 85a7af8506..bafefec4ec 100644 --- a/src/lib-http/Makefile.am +++ b/src/lib-http/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib \ -I$(top_srcdir)/src/lib-test \ -I$(top_srcdir)/src/lib-settings \ - -I$(top_srcdir)/src/lib-dns \ + -I$(top_srcdir)/src/lib-dns-client \ -I$(top_srcdir)/src/lib-ssl-iostream \ -I$(top_srcdir)/src/lib-master \ -I$(top_srcdir)/src/lib-var-expand \ @@ -148,6 +148,7 @@ test_http_request_parser_DEPENDENCIES = $(test_deps) test_http_libs = \ libhttp.la \ + ../lib-dns-client/libdns-client.la \ ../lib-dns/libdns.la \ ../lib-ssl-iostream/libssl_iostream.la \ ../lib-master/libmaster.la \ @@ -155,6 +156,7 @@ test_http_libs = \ $(test_libs) test_http_deps = \ libhttp.la \ + ../lib-dns-client/libdns-client.la \ ../lib-dns/libdns.la \ ../lib-ssl-iostream/libssl_iostream.la \ ../lib-master/libmaster.la \ diff --git a/src/lib-imap-client/Makefile.am b/src/lib-imap-client/Makefile.am index b081780f0b..da22a85140 100644 --- a/src/lib-imap-client/Makefile.am +++ b/src/lib-imap-client/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib \ -I$(top_srcdir)/src/lib-test \ -I$(top_srcdir)/src/lib-settings \ - -I$(top_srcdir)/src/lib-dns \ + -I$(top_srcdir)/src/lib-dns-client \ -I$(top_srcdir)/src/lib-sasl \ -I$(top_srcdir)/src/lib-ssl-iostream \ -I$(top_srcdir)/src/lib-mail \ @@ -39,6 +39,7 @@ test_deps = \ ../lib-imap/libimap.la \ ../lib-mail/libmail.la \ ../lib-charset/libcharset.la \ + ../lib-dns-client/libdns-client.la \ ../lib-dns/libdns.la \ ../lib-auth/libauth.la \ ../lib-otp/libotp.la \ diff --git a/src/lib-login/Makefile.am b/src/lib-login/Makefile.am index 56a16a4b42..61c7e68321 100644 --- a/src/lib-login/Makefile.am +++ b/src/lib-login/Makefile.am @@ -31,6 +31,7 @@ test_libs = \ liblogin.la \ ../lib-master/libmaster.la \ ../lib-auth-client/libauth-client.la \ + ../lib-dns-client/libdns-client.la \ ../lib-dns/libdns.la \ ../lib-ssl-iostream/libssl_iostream.la \ ../lib-settings/libsettings.la \ @@ -43,6 +44,7 @@ test_deps = \ liblogin.la \ ../lib-master/libmaster.la \ ../lib-auth-client/libauth-client.la \ + ../lib-dns-client/libdns-client.la \ ../lib-dns/libdns.la \ ../lib-ssl-iostream/libssl_iostream.la \ ../lib-settings/libsettings.la \ diff --git a/src/lib-lua/Makefile.am b/src/lib-lua/Makefile.am index 1115e850be..6a7be9e262 100644 --- a/src/lib-lua/Makefile.am +++ b/src/lib-lua/Makefile.am @@ -3,7 +3,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib-test \ -I$(top_srcdir)/src/lib-dict \ -I$(top_srcdir)/src/lib-doveadm \ - -I$(top_srcdir)/src/lib-dns \ + -I$(top_srcdir)/src/lib-dns-client \ -I$(top_srcdir)/src/lib-http \ -I$(top_srcdir)/src/lib-ssl-iostream \ -I$(top_srcdir)/src/lib-settings \ @@ -30,7 +30,7 @@ if DLUA_WITH_YIELDS WITH_YIELDS_LUA += \ ../lib-doveadm/libdoveadm_client_lua.la \ ../lib-dict/libdict_lua.la \ - ../lib-dns/libdns_lua.la + ../lib-dns-client/libdns_lua.la test_programs += \ test-dict-lua \ test-dns-lua diff --git a/src/lib-master/Makefile.am b/src/lib-master/Makefile.am index 3403c12e37..bb52e06e10 100644 --- a/src/lib-master/Makefile.am +++ b/src/lib-master/Makefile.am @@ -5,7 +5,7 @@ noinst_LTLIBRARIES = libmaster.la AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib \ -I$(top_srcdir)/src/lib-auth \ - -I$(top_srcdir)/src/lib-dns \ + -I$(top_srcdir)/src/lib-dns-client \ -I$(top_srcdir)/src/lib-test \ -I$(top_srcdir)/src/lib-settings \ -I$(top_srcdir)/src/lib-ssl-iostream \ @@ -57,6 +57,7 @@ test_deps = \ ../lib-settings/libsettings.la \ ../lib-var-expand/libvar_expand.la \ ../lib-test/libtest.la \ + ../lib-dns-client/libdns-client.la \ ../lib-dns/libdns.la \ ../lib/liblib.la diff --git a/src/lib-oauth2/Makefile.am b/src/lib-oauth2/Makefile.am index 1750a217f5..7f29a5488a 100644 --- a/src/lib-oauth2/Makefile.am +++ b/src/lib-oauth2/Makefile.am @@ -38,6 +38,7 @@ test_libs = \ ../lib-dcrypt/libdcrypt.la \ ../lib-http/libhttp.la \ ../lib-json/libjson.la \ + ../lib-dns-client/libdns-client.la \ ../lib-dns/libdns.la \ ../lib-ssl-iostream/libssl_iostream.la \ ../lib-master/libmaster.la \ @@ -54,6 +55,7 @@ test_deps = \ ../lib-dcrypt/libdcrypt.la \ ../lib-http/libhttp.la \ ../lib-json/libjson.la \ + ../lib-dns-client/libdns-client.la \ ../lib-dns/libdns.la \ ../lib-ssl-iostream/libssl_iostream.la \ ../lib-master/libmaster.la \ diff --git a/src/lib-program-client/Makefile.am b/src/lib-program-client/Makefile.am index 0615238622..561188c5d5 100644 --- a/src/lib-program-client/Makefile.am +++ b/src/lib-program-client/Makefile.am @@ -3,7 +3,7 @@ noinst_LTLIBRARIES = libprogram_client.la AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib \ -I$(top_srcdir)/src/lib-test \ - -I$(top_srcdir)/src/lib-dns \ + -I$(top_srcdir)/src/lib-dns-client \ -I$(top_srcdir)/src/lib-mail \ -I$(top_srcdir)/src/lib-settings \ -I$(top_srcdir)/src/lib-var-expand \ @@ -32,6 +32,7 @@ noinst_PROGRAMS = $(test_programs) test_libs = \ libprogram_client.la \ + ../lib-dns-client/libdns-client.la \ ../lib-dns/libdns.la \ ../lib-test/libtest.la \ ../lib-mail/libmail.la \ diff --git a/src/lib-smtp/Makefile.am b/src/lib-smtp/Makefile.am index 358f80afd0..d8468ac6e5 100644 --- a/src/lib-smtp/Makefile.am +++ b/src/lib-smtp/Makefile.am @@ -8,7 +8,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib-sasl \ -I$(top_srcdir)/src/lib-auth-client \ -I$(top_srcdir)/src/lib-ssl-iostream \ - -I$(top_srcdir)/src/lib-dns \ + -I$(top_srcdir)/src/lib-dns-client \ -I$(top_srcdir)/src/lib-program-client \ -I$(top_srcdir)/src/lib-mail \ -I$(top_srcdir)/src/lib-var-expand \ @@ -104,6 +104,7 @@ EXTRA_DIST = \ test_libs = \ $(noinst_LTLIBRARIES) \ ../lib-program-client/libprogram_client.la \ + ../lib-dns-client/libdns-client.la \ ../lib-dns/libdns.la \ ../lib-mail/libmail.la \ ../lib-charset/libcharset.la \ @@ -123,6 +124,7 @@ test_libs = \ test_deps = \ $(noinst_LTLIBRARIES) \ ../lib-program-client/libprogram_client.la \ + ../lib-dns-client/libdns-client.la \ ../lib-dns/libdns.la \ ../lib-mail/libmail.la \ ../lib-charset/libcharset.la \ diff --git a/src/lib-storage/index/pop3c/Makefile.am b/src/lib-storage/index/pop3c/Makefile.am index d9c40ee010..bf308af2a4 100644 --- a/src/lib-storage/index/pop3c/Makefile.am +++ b/src/lib-storage/index/pop3c/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib \ -I$(top_srcdir)/src/lib-settings \ -I$(top_srcdir)/src/lib-master \ - -I$(top_srcdir)/src/lib-dns \ + -I$(top_srcdir)/src/lib-dns-client \ -I$(top_srcdir)/src/lib-ssl-iostream \ -I$(top_srcdir)/src/lib-mail \ -I$(top_srcdir)/src/lib-imap \