Add offline mode support for CMS keylisting
[gpgme.git] / src / Makefile.am
1 # Copyright (C) 2000 Werner Koch (dd9jn)
2 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH
3 #
4 # This file is part of GPGME.
5 #
6 # GPGME is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU Lesser General Public License as
8 # published by the Free Software Foundation; either version 2.1 of the
9 # License, or (at your option) any later version.
10 #
11 # GPGME is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
14 # Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this program; if not, see <http://www.gnu.org/licenses/>.
18
19 ## Process this file with automake to produce Makefile.in
20
21 # Note: moc_kdpipeiodevice should actually be a dependecy below.
22 EXTRA_DIST = gpgme-config.in gpgme.m4 libgpgme.vers ChangeLog-2011 \
23              gpgme.h.in versioninfo.rc.in gpgme.def moc_kdpipeiodevice.cpp
24
25 bin_SCRIPTS = gpgme-config
26 m4datadir = $(datadir)/aclocal
27 m4data_DATA = gpgme.m4
28 nodist_include_HEADERS = gpgme.h
29
30 bin_PROGRAMS = gpgme-tool
31
32 if HAVE_PTHREAD
33 ltlib_gpgme_pthread = libgpgme-pthread.la
34 else
35 ltlib_gpgme_pthread =
36 endif
37
38 if BUILD_W32_GLIB
39 ltlib_gpgme_glib = libgpgme-glib.la
40 else
41 ltlib_gpgme_glib =
42 endif
43
44 if BUILD_W32_QT
45 ltlib_gpgme_qt = libgpgme-qt.la
46 else
47 ltlib_gpgme_qt =
48 endif
49
50 lib_LTLIBRARIES = libgpgme.la $(ltlib_gpgme_glib) $(ltlib_gpgme_qt) \
51         $(ltlib_gpgme_pthread)
52
53 if HAVE_LD_VERSION_SCRIPT
54 libgpgme_version_script_cmd = -Wl,--version-script=$(srcdir)/libgpgme.vers
55 else
56 libgpgme_version_script_cmd =
57 endif
58
59 if HAVE_DOSISH_SYSTEM
60 system_components = w32-util.c w32-sema.c
61 system_components_not_extra = w32-io.c
62 else
63 system_components = ath.h posix-util.c posix-sema.c posix-io.c
64 system_components_not_extra =
65 endif
66
67 if HAVE_W32CE_SYSTEM
68 system_components += w32-ce.h w32-ce.c
69 endif
70
71 if HAVE_UISERVER
72 uiserver_components = engine-uiserver.c
73 else
74 uiserver_components =
75 endif
76
77 # These are the source files common to all library versions.  We used
78 # to build a non-installed library for that, but that does not work
79 # correctly on all platforms (in particular, one can not specify the
80 # right linking order with libtool, as the non-installed version has
81 # unresolved symbols to the thread module.
82 main_sources =                                                          \
83         util.h conversion.c get-env.c context.h ops.h                   \
84         parsetlv.c parsetlv.h                                           \
85         data.h data.c data-fd.c data-stream.c data-mem.c data-user.c    \
86         data-compat.c data-identify.c                                   \
87         signers.c sig-notation.c                                        \
88         wait.c wait-global.c wait-private.c wait-user.c wait.h          \
89         op-support.c                                                    \
90         encrypt.c encrypt-sign.c decrypt.c decrypt-verify.c verify.c    \
91         sign.c passphrase.c progress.c                                  \
92         key.c keylist.c trust-item.c trustlist.c                        \
93         import.c export.c genkey.c delete.c edit.c getauditlog.c        \
94         opassuan.c passwd.c spawn.c assuan-support.c                    \
95         engine.h engine-backend.h engine.c engine-gpg.c status-table.c  \
96         engine-gpgsm.c engine-assuan.c engine-gpgconf.c                 \
97         $(uiserver_components)                                          \
98         engine-g13.c vfs-mount.c vfs-create.c                           \
99         engine-spawn.c                                                  \
100         gpgconf.c                                                       \
101         sema.h priv-io.h $(system_components) sys-util.h dirinfo.c      \
102         debug.c debug.h gpgme.c version.c error.c
103
104 libgpgme_la_SOURCES = $(main_sources)                                   \
105         ath.h ath.c $(system_components_not_extra)
106 libgpgme_pthread_la_SOURCES = $(main_sources)                           \
107         ath.h ath-pthread.c $(system_components_not_extra)
108
109 if BUILD_W32_GLIB
110 libgpgme_glib_la_SOURCES = $(main_sources) ath.h ath.c w32-glib-io.c
111 endif
112
113 if BUILD_W32_QT
114 libgpgme_qt_la_SOURCES = $(main_sources) ath.h ath.c w32-qt-io.cpp \
115         kdpipeiodevice.h kdpipeiodevice.cpp kdpipeiodevice.moc
116 # FIXME: Add extra depedency: moc_kdpipeiodevice.cpp
117
118 # These are built sources (normally).
119 # moc_kdpipeiodevice.cpp: kdpipeiodevice.h
120 #       $(MOC4) -o $@ $<
121 #
122 # kdpipeiodevice.moc: kdpipeiodevice.cpp
123 #       $(MOC4) -o $@ $<
124 endif
125
126 # We use a global CFLAGS and CPPFLAGS setting for all library
127 # versions, because then every object file is only compiled once.
128 AM_CPPFLAGS = @GPG_ERROR_CFLAGS@ @QT4_CORE_CFLAGS@
129 AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GLIB_CFLAGS@ @QT4_CORE_CFLAGS@
130
131 gpgme_tool_LDADD = libgpgme.la @LIBASSUAN_LIBS@
132
133
134 if HAVE_W32_SYSTEM
135 # Windows provides us with an endless stream of Tough Love.  To spawn
136 # processes with a controlled set of inherited handles, we need a
137 # wrapper process.
138 # Except on Windows CE.  There nothing is inheritable anyway.
139 if HAVE_W32CE_SYSTEM
140 libexec_PROGRAMS =
141 else
142 libexec_PROGRAMS = gpgme-w32spawn
143 endif
144
145 RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
146 LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
147
148 SUFFIXES = .rc .lo
149
150 .rc.lo:
151         $(LTRCCOMPILE) -i "$<" -o "$@"
152
153 gpgme_res = versioninfo.lo
154 no_undefined = -no-undefined
155 export_symbols = -export-symbols $(srcdir)/gpgme.def
156 extra_ltoptions = -XCClinker -static-libgcc
157
158 install-def-file:
159         -$(INSTALL) -d $(DESTDIR)$(libdir)
160         $(INSTALL) $(srcdir)/gpgme.def $(DESTDIR)$(libdir)/gpgme.def
161
162 uninstall-def-file:
163         -rm $(DESTDIR)$(libdir)/gpgme.def
164
165 gpgme_deps = $(gpgme_res) gpgme.def
166
167 else
168 gpgme_res =
169 no_undefined =
170 export_symbols =
171 extra_ltoptions =
172 install-def-file:
173 uninstall-def-file:
174
175 gpgme_deps =
176 endif
177
178 libgpgme_la_LDFLAGS = $(no_undefined) $(export_symbols) $(extra_ltoptions) \
179         $(libgpgme_version_script_cmd) -version-info \
180         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
181 libgpgme_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
182 libgpgme_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
183                      @GPG_ERROR_LIBS@
184
185 libgpgme_pthread_la_LDFLAGS = \
186         $(no_undefined) $(export_symbols) $(extra_ltoptions) \
187         $(libgpgme_version_script_cmd) -version-info \
188         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
189 libgpgme_pthread_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers
190 libgpgme_pthread_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
191         -lpthread @GPG_ERROR_LIBS@
192
193 if BUILD_W32_GLIB
194 libgpgme_glib_la_LDFLAGS = \
195         $(no_undefined) $(export_symbols) $(extra_ltoptions) \
196         $(libgpgme_version_script_cmd) -version-info \
197         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
198 libgpgme_glib_la_DEPENDENCIES = @LTLIBOBJS@ \
199         $(srcdir)/libgpgme.vers $(gpgme_deps)
200 libgpgme_glib_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
201         @GPG_ERROR_LIBS@ @GLIB_LIBS@
202 endif
203
204 if BUILD_W32_QT
205 libgpgme_qt_la_LDFLAGS = $(no_undefined) \
206         $(export_symbols) $(libgpgme_version_script_cmd) -version-info \
207         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
208 libgpgme_qt_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
209 libgpgme_qt_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
210         @GPG_ERROR_LIBS@ @QT4_CORE_LIBS@
211 endif
212
213 install-data-local: install-def-file
214
215 uninstall-local: uninstall-def-file