906fe37ebb9b0125816d29892db836c43f25c48f
[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
23
24 bin_PROGRAMS = dirmngr dirmngr-client
25
26 if USE_LDAPWRAPPER
27 libexec_PROGRAMS = dirmngr_ldap
28 endif
29
30 noinst_PROGRAMS = $(module_tests)
31 TESTS = $(module_tests)
32
33 AM_CPPFLAGS = -I$(top_srcdir)/common
34
35 include $(top_srcdir)/am/cmacros.am
36
37 AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(KSBA_CFLAGS) $(LIBASSUAN_CFLAGS)      \
38             $(GPG_ERROR_CFLAGS) $(NPTH_CFLAGS) $(NTBTLS_CFLAGS)         \
39             $(LIBGNUTLS_CFLAGS)
40
41
42 BUILT_SOURCES = no-libgcrypt.c
43
44 CLEANFILES = no-libgcrypt.c
45
46 if HAVE_W32_SYSTEM
47 ldap_url = ldap-url.h ldap-url.c
48 else
49 ldap_url =
50 endif
51
52 if USE_LDAPWRAPPER
53 extraldap_src = ldap-wrapper.c
54 else
55 extraldap_src = ldap-wrapper-ce.c  dirmngr_ldap.c
56 endif
57
58 noinst_HEADERS = dirmngr.h crlcache.h crlfetch.h misc.h
59
60 dirmngr_SOURCES = dirmngr.c dirmngr.h server.c crlcache.c crlfetch.c    \
61         certcache.c certcache.h \
62         cdb.h cdblib.c misc.c dirmngr-err.h  \
63         ocsp.c ocsp.h validate.c validate.h  \
64         ks-action.c ks-action.h ks-engine.h \
65         ks-engine-hkp.c ks-engine-http.c ks-engine-finger.c ks-engine-kdns.c
66
67 if USE_LDAP
68 dirmngr_SOURCES += ldapserver.h ldapserver.c ldap.c w32-ldap-help.h \
69                    ldap-wrapper.h ldap-parse-uri.c ldap-parse-uri.h \
70                    ks-engine-ldap.c $(ldap_url) $(extraldap_src)
71 ldaplibs = $(LDAPLIBS)
72 else
73 ldaplibs =
74 endif
75
76
77 dirmngr_LDADD = $(libcommontlsnpth) $(libcommonpth) \
78         $(DNSLIBS) $(LIBASSUAN_LIBS) \
79         $(LIBGCRYPT_LIBS) $(KSBA_LIBS) $(NPTH_LIBS) \
80         $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(LIBINTL) $(LIBICONV)
81 if USE_LDAP
82 dirmngr_LDADD += $(ldaplibs)
83 endif
84 if !USE_LDAPWRAPPER
85 dirmngr_LDADD += $(ldaplibs)
86 endif
87 dirmngr_LDFLAGS = $(extra_bin_ldflags)
88
89 if USE_LDAPWRAPPER
90 dirmngr_ldap_SOURCES = dirmngr_ldap.c $(ldap_url)
91 dirmngr_ldap_CFLAGS = $(GPG_ERROR_CFLAGS) $(LIBGCRYPT_CFLAGS)
92 dirmngr_ldap_LDFLAGS =
93 dirmngr_ldap_LDADD = $(libcommon) no-libgcrypt.o \
94                      $(GPG_ERROR_LIBS) $(LDAPLIBS) $(LBER_LIBS) $(LIBINTL) \
95                      $(LIBICONV)
96 endif
97
98 dirmngr_client_SOURCES = dirmngr-client.c
99 dirmngr_client_LDADD = $(libcommon) no-libgcrypt.o \
100                         $(LIBASSUAN_LIBS) \
101                        $(GPG_ERROR_LIBS) $(NETLIBS) $(LIBINTL) $(LIBICONV)
102 dirmngr_client_LDFLAGS = $(extra_bin_ldflags)
103
104
105 no-libgcrypt.c : $(top_srcdir)/tools/no-libgcrypt.c
106         cat $(top_srcdir)/tools/no-libgcrypt.c > no-libgcrypt.c
107
108
109 t_common_src = t-support.h
110 # We need libcommontls, because we use the http functions.
111 t_common_ldadd = $(libcommontls) $(libcommon) no-libgcrypt.o \
112                  $(GPG_ERROR_LIBS) $(NETLIBS) \
113                  $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) \
114                  $(DNSLIBS) $(LIBINTL) $(LIBICONV)
115
116 module_tests =
117
118 if USE_LDAP
119 module_tests += t-ldap-parse-uri
120 endif
121
122 t_ldap_parse_uri_SOURCES = \
123         t-ldap-parse-uri.c ldap-parse-uri.c ldap-parse-uri.h \
124         $(ldap_url) $(t_common_src)
125 t_ldap_parse_uri_LDADD = $(ldaplibs) $(t_common_ldadd)
126
127 $(PROGRAMS) : $(libcommon) $(libcommonpth) $(libcommontls) $(libcommontlsnpth)