gpg,gpgsm: Fix compliance check for DSA and avoid an assert.
[gnupg.git] / g10 / Makefile.am
1 # Copyright (C) 1998, 1999, 2000, 2001, 2002,
2 #               2003, 2006, 2010  Free Software Foundation, Inc.
3 #
4 # This file is part of GnuPG.
5 #
6 # GnuPG is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # GnuPG is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
18
19 ## Process this file with automake to produce Makefile.in
20
21 EXTRA_DIST = distsigkey.gpg \
22              ChangeLog-2011 gpg-w32info.rc \
23              gpg.w32-manifest.in test.c t-keydb-keyring.kbx \
24              t-keydb-get-keyblock.gpg t-stutter-data.asc \
25              all-tests.scm
26
27 AM_CPPFLAGS =
28
29 include $(top_srcdir)/am/cmacros.am
30
31 AM_CFLAGS = $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS) \
32             $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS)
33
34 needed_libs = ../kbx/libkeybox.a $(libcommon)
35
36 # Because there are no program specific transform macros we need to
37 # work around that to allow installing gpg as gpg2.
38 gpg2_hack_list = gpg gpgv
39 if USE_GPG2_HACK
40 gpg2_hack_uninst = gpg2 gpgv2
41 use_gpg2_hack = yes
42 else
43 gpg2_hack_uninst = $(gpg2_hack_list)
44 use_gpg2_hack = no
45 endif
46
47 # NB: We use noinst_ for gpg and gpgv so that we can install them with
48 # the install-hook target under the name gpg2/gpgv2.
49 noinst_PROGRAMS = gpg
50 if !HAVE_W32CE_SYSTEM
51 noinst_PROGRAMS += gpgv
52 endif
53 if MAINTAINER_MODE
54 noinst_PROGRAMS += gpgcompose
55 endif
56 noinst_PROGRAMS += $(module_tests)
57 TESTS = $(module_tests)
58 TESTS_ENVIRONMENT = \
59         abs_top_srcdir=$(abs_top_srcdir)
60
61 if ENABLE_BZIP2_SUPPORT
62 bzip2_source = compress-bz2.c
63 else
64 bzip2_source =
65 endif
66
67 if ENABLE_CARD_SUPPORT
68 card_source = card-util.c
69 else
70 card_source =
71 endif
72
73 if NO_TRUST_MODELS
74 trust_source =
75 else
76 trust_source = trustdb.c trustdb.h tdbdump.c tdbio.c tdbio.h
77 endif
78
79 if USE_TOFU
80 tofu_source = tofu.h tofu.c gpgsql.c gpgsql.h sqrtu32.c sqrtu32.h
81 else
82 tofu_source =
83 endif
84
85
86 if HAVE_W32_SYSTEM
87 resource_objs += gpg-w32info.o
88
89 gpg-w32info.o : gpg.w32-manifest
90
91 endif
92
93 common_source =  \
94               gpg.h             \
95               dek.h             \
96               build-packet.c    \
97               compress.c        \
98               $(bzip2_source)   \
99               filter.h          \
100               free-packet.c     \
101               getkey.c          \
102               keydb.c keydb.h    \
103               keyring.c keyring.h \
104               seskey.c          \
105               kbnode.c          \
106               main.h            \
107               mainproc.c        \
108               armor.c           \
109               mdfilter.c        \
110               textfilter.c      \
111               progress.c        \
112               misc.c            \
113               rmd160.c rmd160.h \
114               options.h         \
115               openfile.c        \
116               keyid.c           \
117               packet.h          \
118               parse-packet.c    \
119               cpr.c             \
120               plaintext.c       \
121               sig-check.c       \
122               keylist.c         \
123               pkglue.c pkglue.h \
124               ecdh.c
125
126 gpg_sources = server.c          \
127               $(common_source)  \
128               pkclist.c         \
129               skclist.c         \
130               pubkey-enc.c      \
131               passphrase.c      \
132               decrypt.c         \
133               decrypt-data.c    \
134               cipher.c          \
135               encrypt.c         \
136               sign.c            \
137               verify.c          \
138               revoke.c          \
139               dearmor.c         \
140               import.c          \
141               export.c          \
142               migrate.c         \
143               delkey.c          \
144               keygen.c          \
145               helptext.c        \
146               keyserver.c       \
147               keyserver-internal.h \
148               call-dirmngr.c call-dirmngr.h \
149               photoid.c photoid.h \
150               call-agent.c call-agent.h \
151               trust.c $(trust_source) $(tofu_source) \
152               $(card_source) \
153               exec.c exec.h \
154               key-check.c key-check.h
155
156 gpg_SOURCES  = gpg.c \
157         keyedit.c keyedit.h     \
158         $(gpg_sources)
159
160 gpgcompose_SOURCES  = gpgcompose.c  $(gpg_sources)
161 gpgv_SOURCES = gpgv.c           \
162               $(common_source)  \
163               verify.c
164
165 #gpgd_SOURCES = gpgd.c \
166 #              ks-proto.h \
167 #              ks-proto.c \
168 #              ks-db.c \
169 #              ks-db.h \
170 #              $(common_source)
171
172 LDADD =  $(needed_libs) ../common/libgpgrl.a \
173          $(ZLIBS) $(LIBINTL) $(CAPLIBS) $(NETLIBS)
174 gpg_LDADD = $(LDADD) $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) $(LIBREADLINE) \
175              $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
176              $(LIBICONV) $(resource_objs) $(extra_sys_libs)
177 gpg_LDFLAGS = $(extra_bin_ldflags)
178 gpgv_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) \
179               $(GPG_ERROR_LIBS) \
180               $(LIBICONV) $(resource_objs) $(extra_sys_libs)
181 gpgv_LDFLAGS = $(extra_bin_ldflags)
182
183 gpgcompose_LDADD = $(LDADD) $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) $(LIBREADLINE) \
184              $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
185              $(LIBICONV) $(resource_objs) $(extra_sys_libs)
186 gpgcompose_LDFLAGS = $(extra_bin_ldflags)
187
188 t_common_ldadd =
189 module_tests = t-rmd160 t-keydb t-keydb-get-keyblock t-stutter
190 t_rmd160_SOURCES = t-rmd160.c rmd160.c
191 t_rmd160_LDADD = $(t_common_ldadd)
192 t_keydb_SOURCES = t-keydb.c test-stubs.c $(common_source)
193 t_keydb_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
194               $(LIBICONV) $(t_common_ldadd)
195 t_keydb_get_keyblock_SOURCES = t-keydb-get-keyblock.c test-stubs.c \
196               $(common_source)
197 t_keydb_get_keyblock_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
198               $(LIBICONV) $(t_common_ldadd)
199 t_stutter_SOURCES = t-stutter.c test-stubs.c \
200               $(common_source)
201 t_stutter_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
202               $(LIBICONV) $(t_common_ldadd)
203
204
205 $(PROGRAMS): $(needed_libs) ../common/libgpgrl.a
206
207 # NB: To install gpg and gpgv we use this -hook.  This code has to
208 # duplicate most of the automake generated install-binPROGRAMS target
209 # so that directories are created and the transform feature works.
210 install-exec-hook:
211         @echo "running install-exec-hook"; \
212         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
213         $(MKDIR_P) "$(DESTDIR)$(bindir)"; \
214         for p in $(gpg2_hack_list); do \
215           echo "$$p$(EXEEXT) $$p$(EXEEXT)"; done | \
216         sed 's/$(EXEEXT)$$//' | \
217         while read p p1; do if test -f $$p \
218           ; then echo "$$p"; echo "$$p"; else :; fi; \
219         done | \
220         sed -e 'p;s,.*/,,;n;h' \
221             -e 's|.*|.|' \
222             -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
223         sed 'N;N;N;s,\n, ,g' | \
224         $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
225           { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
226             if ($$2 == $$4) files[d] = files[d] " " $$1; \
227             else { print "f", $$3 "/" $$4, $$1; } } \
228           END { for (d in files) print "f", d, files[d] }' | \
229         while read type dir files; do \
230             for f in $$files; do \
231                if test $(use_gpg2_hack) = yes ; \
232                  then f2=`echo "$${f}" | sed 's/$(EXEEXT)$$//'`2$(EXEEXT); \
233                  else f2="$${f}" ;\
234                fi ; \
235                echo "$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \
236                      $${f} '$(DESTDIR)$(bindir)/$${f2}'"; \
237                $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \
238                      $${f} "$(DESTDIR)$(bindir)/$${f2}"; \
239             done; \
240         done
241
242
243 install-data-local:
244         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
245         $(INSTALL_DATA) $(srcdir)/distsigkey.gpg \
246                                 $(DESTDIR)$(pkgdatadir)/distsigkey.gpg
247
248 # NB: For uninstalling gpg and gpgv we use -local because there is
249 # no need for a specific order the targets need to be run.
250 uninstall-local:
251         -@rm $(DESTDIR)$(pkgdatadir)/distsigkey.gpg
252         -@files=`for p in $(gpg2_hack_uninst); do echo "$$p"; done | \
253           sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
254               -e 's/$$/$(EXEEXT)/' \
255         `; \
256         echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
257         cd "$(DESTDIR)$(bindir)" && rm -f $$files