build: Require latest released libraries
[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 <http://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_maint_tests)
32 TESTS = $(module_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 BUILT_SOURCES = no-libgcrypt.c
44
45 CLEANFILES = no-libgcrypt.c
46
47 if HAVE_W32_SYSTEM
48 ldap_url = ldap-url.h ldap-url.c
49 else
50 ldap_url =
51 endif
52
53 if USE_LDAPWRAPPER
54 extraldap_src = ldap-wrapper.c
55 else
56 extraldap_src = ldap-wrapper-ce.c  dirmngr_ldap.c
57 endif
58
59 noinst_HEADERS = dirmngr.h crlcache.h crlfetch.h misc.h
60
61 dirmngr_SOURCES = dirmngr.c dirmngr.h server.c crlcache.c crlfetch.c    \
62         certcache.c certcache.h \
63         cdb.h cdblib.c misc.c dirmngr-err.h  \
64         ocsp.c ocsp.h validate.c validate.h  \
65         dns-stuff.c dns-stuff.h \
66         http.c http.h \
67         ks-action.c ks-action.h ks-engine.h \
68         ks-engine-hkp.c ks-engine-http.c ks-engine-finger.c ks-engine-kdns.c
69
70 if USE_LDAP
71 dirmngr_SOURCES += ldapserver.h ldapserver.c ldap.c w32-ldap-help.h \
72                    ldap-wrapper.h ldap-parse-uri.c ldap-parse-uri.h \
73                    ks-engine-ldap.c $(ldap_url) $(extraldap_src)
74 ldaplibs = $(LDAPLIBS)
75 else
76 ldaplibs =
77 endif
78
79
80 dirmngr_LDADD = $(libcommonpth) \
81         $(DNSLIBS) $(LIBASSUAN_LIBS) \
82         $(LIBGCRYPT_LIBS) $(KSBA_LIBS) $(NPTH_LIBS) \
83         $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(LIBINTL) $(LIBICONV)
84 if USE_LDAP
85 dirmngr_LDADD += $(ldaplibs)
86 endif
87 if !USE_LDAPWRAPPER
88 dirmngr_LDADD += $(ldaplibs)
89 endif
90 dirmngr_LDFLAGS = $(extra_bin_ldflags)
91
92 if USE_LDAPWRAPPER
93 dirmngr_ldap_SOURCES = dirmngr_ldap.c $(ldap_url)
94 dirmngr_ldap_CFLAGS = $(GPG_ERROR_CFLAGS) $(LIBGCRYPT_CFLAGS)
95 dirmngr_ldap_LDFLAGS =
96 dirmngr_ldap_LDADD = $(libcommon) no-libgcrypt.o \
97                      $(GPG_ERROR_LIBS) $(LDAPLIBS) $(LBER_LIBS) $(LIBINTL) \
98                      $(LIBICONV)
99 endif
100
101 dirmngr_client_SOURCES = dirmngr-client.c
102 dirmngr_client_LDADD = $(libcommon) \
103                        $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
104                        $(LIBGCRYPT_LIBS) $(NETLIBS) $(LIBINTL) $(LIBICONV)
105 dirmngr_client_LDFLAGS = $(extra_bin_ldflags)
106
107 no-libgcrypt.c : $(top_srcdir)/tools/no-libgcrypt.c
108         cat $(top_srcdir)/tools/no-libgcrypt.c > no-libgcrypt.c
109
110
111 t_common_src = t-support.h
112 t_common_ldadd = $(libcommon) $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) \
113                  $(GPG_ERROR_LIBS) $(NETLIBS) \
114                  $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) \
115                  $(DNSLIBS) $(LIBINTL) $(LIBICONV)
116
117 module_tests = t-dns-stuff
118
119 if USE_LDAP
120 module_tests += t-ldap-parse-uri
121 endif
122
123 if MAINTAINER_MODE
124 module_maint_tests = t-http
125 else
126 module_maint_tests =
127 endif
128
129
130 # http tests
131 t_http_SOURCES = t-http.c http.c dns-stuff.c
132 t_http_CFLAGS  = -DWITHOUT_NPTH=1 \
133                  $(LIBGCRYPT_CFLAGS) $(NTBTLS_CFLAGS) $(LIBGNUTLS_CFLAGS) \
134                  $(GPG_ERROR_CFLAGS)
135 t_http_LDADD   = $(t_common_ldadd) \
136                  $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(DNSLIBS)
137
138 t_ldap_parse_uri_SOURCES = \
139         t-ldap-parse-uri.c ldap-parse-uri.c ldap-parse-uri.h \
140         http.c dns-stuff.c \
141         $(ldap_url) $(t_common_src)
142 t_ldap_parse_uri_CFLAGS = -DWITHOUT_NPTH=1 \
143                           $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS)
144 t_ldap_parse_uri_LDADD = $(ldaplibs) $(t_common_ldadd) $(DNSLIBS)
145
146 t_dns_stuff_CFLAGS = -DWITHOUT_NPTH=1 \
147                      $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS)
148 t_dns_stuff_SOURCES = t-dns-stuff.c dns-stuff.c
149 t_dns_stuff_LDADD   = $(t_common_ldadd) $(DNSLIBS)
150
151 $(PROGRAMS) : $(libcommon) $(libcommonpth)