X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=Makefile.am;h=ce8f2472ee5e20e7422162f57159b07fb095a5e3;hp=2e982f50672746c69d8267d37866774179b1e4f4;hb=59b8f6b628145586e87b8a4f6e29c755ad7d61ed;hpb=a4892054059c483a695e4250713b5ed8948a1c2f diff --git a/Makefile.am b/Makefile.am index 2e982f506..ce8f2472e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -201,6 +201,7 @@ AM_CPPFLAGS = \ -I $(top_srcdir)/src/timedate \ -I $(top_srcdir)/src/timesync \ -I $(top_srcdir)/src/resolve \ + -I $(top_builddir)/src/resolve \ -I $(top_srcdir)/src/systemd \ -I $(top_builddir)/src/core \ -I $(top_srcdir)/src/core \ @@ -1148,45 +1149,50 @@ CLEANFILES += \ src/shared/errno-list.txt \ src/shared/errno-from-name.gperf \ src/shared/af-list.txt \ - src/shared/af-from-name.gperf + src/shared/af-from-name.gperf \ + src/shared/dns_type-list.txt \ + src/shared/dns_type-from-name.gperf BUILT_SOURCES += \ src/shared/errno-from-name.h \ src/shared/errno-to-name.h \ src/shared/af-from-name.h \ - src/shared/af-to-name.h + src/shared/af-to-name.h \ + src/resolve/dns_type-from-name.h \ + src/resolve/dns_type-to-name.h -src/shared/errno-list.txt: - $(AM_V_at)$(MKDIR_P) $(dir $@) - $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - < /dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' > $@ +%-from-name.gperf: %-list.txt + $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@ + +%-from-name.h: %-from-name.gperf + $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@ -src/shared/errno-from-name.gperf: src/shared/errno-list.txt - $(AM_V_at)$(MKDIR_P) $(dir $@) - $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct errno_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' < $< > $@ -src/shared/errno-from-name.h: src/shared/errno-from-name.gperf +src/shared/errno-list.txt: $(AM_V_at)$(MKDIR_P) $(dir $@) - $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_errno -H hash_errno_name -p -C < $< > $@ + $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - $@ src/shared/errno-to-name.h: src/shared/errno-list.txt - $(AM_V_at)$(MKDIR_P) $(dir $@) - $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@ + $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@ + src/shared/af-list.txt: $(AM_V_at)$(MKDIR_P) $(dir $@) - $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/socket.h - < /dev/null | grep -v AF_UNSPEC | grep -v AF_MAX | $(AWK) '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $$2; }' > $@ + $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/socket.h - $@ -src/shared/af-from-name.gperf: src/shared/af-list.txt - $(AM_V_at)$(MKDIR_P) $(dir $@) - $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct af_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' < $< > $@ +src/shared/af-to-name.h: src/shared/af-list.txt + $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const af_names[] = { "} !/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@ -src/shared/af-from-name.h: src/shared/af-from-name.gperf - $(AM_V_at)$(MKDIR_P) $(dir $@) - $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_af -H hash_af_name -p -C < $< > $@ -src/shared/af-to-name.h: src/shared/af-list.txt +src/resolve/dns_type-list.txt: src/resolve/dns-type.h $(AM_V_at)$(MKDIR_P) $(dir $@) - $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const af_names[] = { "} !/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@ + $(AM_V_GEN)$(SED) -n -r 's/.* DNS_TYPE_(\w+).*/\1/p' <$< >$@ + +src/resolve/dns_type-to-name.h: src/resolve/dns_type-list.txt + $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *dns_type_to_string(int type) {\n\tswitch(type) {" } {printf " case DNS_TYPE_%s: return ", $$1; sub(/_/, "-"); printf "\"%s\";\n", $$1 } END{ print "\ndefault: return NULL;\n\t}\n}\n" }' <$< >$@ + +src/resolve/dns_type-from-name.gperf: src/resolve/dns_type-list.txt + $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct dns_type_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { s=$$1; sub(/_/, "-", s); printf "%s, ", $$s; printf "DNS_TYPE_%s\n", $$1 }' <$< >$@ # ------------------------------------------------------------------------------ systemd_SOURCES = \ @@ -4732,10 +4738,13 @@ endif # ------------------------------------------------------------------------------ if ENABLE_RESOLVED systemd_resolved_SOURCES = \ - src/resolve/resolved.h \ src/resolve/resolved.c \ src/resolve/resolved-manager.c \ + src/resolve/resolved-manager.h \ + src/resolve/resolved-conf.c \ + src/resolve/resolved-conf.h \ src/resolve/resolved-bus.c \ + src/resolve/resolved-bus.h \ src/resolve/resolved-link.h \ src/resolve/resolved-link.c \ src/resolve/resolved-dns-domain.h \ @@ -4750,6 +4759,8 @@ systemd_resolved_SOURCES = \ src/resolve/resolved-dns-packet.c \ src/resolve/resolved-dns-query.h \ src/resolve/resolved-dns-query.c \ + src/resolve/resolved-dns-transaction.h \ + src/resolve/resolved-dns-transaction.c \ src/resolve/resolved-dns-scope.h \ src/resolve/resolved-dns-scope.c \ src/resolve/resolved-dns-server.h \ @@ -4759,13 +4770,18 @@ systemd_resolved_SOURCES = \ src/resolve/resolved-dns-zone.h \ src/resolve/resolved-dns-zone.c \ src/resolve/resolved-dns-stream.h \ - src/resolve/resolved-dns-stream.c + src/resolve/resolved-dns-stream.c \ + src/resolve/dns-type.c \ + src/resolve/dns-type.h \ + src/resolve/dns_type-from-name.h \ + src/resolve/dns_type-to-name.h nodist_systemd_resolved_SOURCES = \ src/resolve/resolved-gperf.c EXTRA_DIST += \ - src/resolve/resolved-gperf.gperf + src/resolve/resolved-gperf.gperf \ + src/resolve/dns_type-from-name.gperf CLEANFILES += \ src/resolve/resolved-gperf.c @@ -4775,7 +4791,9 @@ systemd_resolved_LDADD = \ libsystemd-network.la \ libsystemd-label.la \ libsystemd-internal.la \ - libsystemd-shared.la + libsystemd-shared.la \ + -lm \ + $(LIBIDN_LIBS) rootlibexec_PROGRAMS += \ systemd-resolved @@ -4826,7 +4844,8 @@ test_dns_domain_LDADD = \ libsystemd-network.la \ libsystemd-label.la \ libsystemd-internal.la \ - libsystemd-shared.la + libsystemd-shared.la \ + $(LIBIDN_LIBS) libnss_resolve_la_SOURCES = \ src/nss-resolve/nss-resolve.sym \ @@ -4859,11 +4878,17 @@ systemd_resolve_host_SOURCES = \ src/resolve/resolved-dns-question.c \ src/resolve/resolved-dns-question.h \ src/resolve/resolved-dns-domain.c \ - src/resolve/resolved-dns-domain.h + src/resolve/resolved-dns-domain.h \ + src/resolve/dns-type.c \ + src/resolve/dns-type.h \ + src/resolve/dns_type-from-name.h \ + src/resolve/dns_type-to-name.h systemd_resolve_host_LDADD = \ libsystemd-internal.la \ - libsystemd-shared.la + libsystemd-shared.la \ + -lm \ + $(LIBIDN_LIBS) rootlibexec_PROGRAMS += \ systemd-resolve-host