5c294688df867c8675738235a8974a3c087392db
[gnupg.git] / dirmngr / Makefile.am
1 # Makefile.am - dirmngr
2 # Copyright (C) 2002 Klarälvdalens Datakonsult AB
3 # Copyright (C) 2004, 2007, 2010 g10 Code GmbH
4 #
5 # This file is part of GnuPG.
6 #
7 # GnuPG is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # GnuPG is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, see <https://www.gnu.org/licenses/>.
19
20 ## Process this file with automake to produce Makefile.in
21
22 EXTRA_DIST = OAUTHORS ONEWS ChangeLog-2011 tls-ca.pem
23 dist_pkgdata_DATA = sks-keyservers.netCA.pem
24
25 bin_PROGRAMS = dirmngr dirmngr-client
26
27 if USE_LDAPWRAPPER
28 libexec_PROGRAMS = dirmngr_ldap
29 endif
30
31 noinst_PROGRAMS = $(module_tests) $(module_net_tests) $(module_maint_tests)
32 TESTS = $(module_tests) $(module_net_tests)
33
34 AM_CPPFLAGS = -I$(top_srcdir)/common
35
36 include $(top_srcdir)/am/cmacros.am
37
38 AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(KSBA_CFLAGS) $(LIBASSUAN_CFLAGS)      \
39             $(GPG_ERROR_CFLAGS) $(NPTH_CFLAGS) $(NTBTLS_CFLAGS)         \
40             $(LIBGNUTLS_CFLAGS)
41
42
43 if HAVE_W32_SYSTEM
44 ldap_url = ldap-url.h ldap-url.c
45 else
46 ldap_url =
47 endif
48
49 if USE_LDAPWRAPPER
50 extraldap_src = ldap-wrapper.c
51 else
52 extraldap_src = ldap-wrapper-ce.c  dirmngr_ldap.c
53 endif
54
55 noinst_HEADERS = dirmngr.h crlcache.h crlfetch.h misc.h
56
57 dirmngr_SOURCES = dirmngr.c dirmngr.h server.c crlcache.c crlfetch.c    \
58         certcache.c certcache.h \
59         loadswdb.c \
60         cdb.h cdblib.c misc.c dirmngr-err.h  \
61         ocsp.c ocsp.h validate.c validate.h  \
62         dns.c dns.h \
63         dns-stuff.c dns-stuff.h \
64         http.c http.h \
65         ks-action.c ks-action.h ks-engine.h \
66         ks-engine-hkp.c ks-engine-http.c ks-engine-finger.c ks-engine-kdns.c
67
68 if USE_LDAP
69 dirmngr_SOURCES += ldapserver.h ldapserver.c ldap.c w32-ldap-help.h \
70                    ldap-wrapper.h ldap-parse-uri.c ldap-parse-uri.h \
71                    ks-engine-ldap.c $(ldap_url) $(extraldap_src)
72 ldaplibs = $(LDAPLIBS)
73 else
74 ldaplibs =
75 endif
76
77
78 dirmngr_LDADD = $(libcommonpth) \
79         $(DNSLIBS) $(LIBASSUAN_LIBS) \
80         $(LIBGCRYPT_LIBS) $(KSBA_LIBS) $(NPTH_LIBS) \
81         $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(LIBINTL) $(LIBICONV)
82 if USE_LDAP
83 dirmngr_LDADD += $(ldaplibs)
84 endif
85 if !USE_LDAPWRAPPER
86 dirmngr_LDADD += $(ldaplibs)
87 endif
88 dirmngr_LDFLAGS = $(extra_bin_ldflags)
89
90 if USE_LDAPWRAPPER
91 dirmngr_ldap_SOURCES = dirmngr_ldap.c $(ldap_url)
92 dirmngr_ldap_CFLAGS = $(GPG_ERROR_CFLAGS) $(LIBGCRYPT_CFLAGS)
93 dirmngr_ldap_LDFLAGS =
94 dirmngr_ldap_LDADD = $(libcommon) \
95                      $(GPG_ERROR_LIBS) $(LIBGCRYPT_LIBS) $(LDAPLIBS) \
96                      $(LBER_LIBS) $(LIBINTL) $(LIBICONV) $(NETLIBS)
97 endif
98
99 dirmngr_client_SOURCES = dirmngr-client.c
100 dirmngr_client_LDADD = $(libcommon) \
101                        $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
102                        $(LIBGCRYPT_LIBS) $(NETLIBS) $(LIBINTL) $(LIBICONV)
103 dirmngr_client_LDFLAGS = $(extra_bin_ldflags)
104
105
106 t_common_src = t-support.h dns.c dns.h
107 t_common_ldadd = $(libcommon) $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) \
108                  $(GPG_ERROR_LIBS) $(NETLIBS) \
109                  $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) \
110                  $(DNSLIBS) $(LIBINTL) $(LIBICONV)
111
112 module_tests =
113
114 if USE_LDAP
115 module_tests += t-ldap-parse-uri
116 endif
117
118 # Test which need a network connections are only used in maintainer mode.
119 if MAINTAINER_MODE
120 module_net_tests = t-dns-stuff
121 else
122 module_net_tests =
123 endif
124
125 # Tests which are only for manually testing are only build in maintainer-mode.
126 if MAINTAINER_MODE
127 module_maint_tests = t-http
128 else
129 module_maint_tests =
130 endif
131
132
133 # http tests
134 t_http_SOURCES = $(t_common_src) t-http.c http.c dns-stuff.c
135 t_http_CFLAGS  = -DWITHOUT_NPTH=1 \
136                  $(LIBGCRYPT_CFLAGS) $(NTBTLS_CFLAGS) $(LIBGNUTLS_CFLAGS) \
137                  $(GPG_ERROR_CFLAGS)
138 t_http_LDADD   = $(t_common_ldadd) \
139                  $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(DNSLIBS)
140
141 t_ldap_parse_uri_SOURCES = \
142         t-ldap-parse-uri.c ldap-parse-uri.c ldap-parse-uri.h \
143         http.c dns-stuff.c \
144         $(ldap_url) $(t_common_src)
145 t_ldap_parse_uri_CFLAGS = -DWITHOUT_NPTH=1 \
146                           $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS)
147 t_ldap_parse_uri_LDADD = $(ldaplibs) $(t_common_ldadd) $(DNSLIBS)
148
149 t_dns_stuff_CFLAGS = -DWITHOUT_NPTH=1 \
150                      $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS)
151 t_dns_stuff_SOURCES = $(t_common_src) t-dns-stuff.c dns-stuff.c
152 t_dns_stuff_LDADD   = $(t_common_ldadd) $(DNSLIBS)
153
154 $(PROGRAMS) : $(libcommon) $(libcommonpth)