summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: ea8e70ebc0cc358412374bb11c70f25810f36e9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# Copyright (C) 2000 Werner Koch (dd9jn)
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH
#
# This file is part of GPGME.
#
# GPGME is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of the
# License, or (at your option) any later version.
#
# GPGME is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
# Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.

## Process this file with automake to produce Makefile.in

# Note: moc_kdpipeiodevice should actually be a dependcy below.
EXTRA_DIST = gpgme-config.in gpgme.m4 libgpgme.vers ChangeLog-2011 \
	     gpgme.h.in versioninfo.rc.in gpgme.def moc_kdpipeiodevice.cpp

bin_SCRIPTS = gpgme-config
m4datadir = $(datadir)/aclocal
m4data_DATA = gpgme.m4
nodist_include_HEADERS = gpgme.h

if HAVE_PTHREAD
ltlib_gpgme_pthread = libgpgme-pthread.la
else
ltlib_gpgme_pthread =
endif

if BUILD_W32_GLIB
ltlib_gpgme_glib = libgpgme-glib.la
else
ltlib_gpgme_glib =
endif

if BUILD_W32_QT
ltlib_gpgme_qt = libgpgme-qt.la
else
ltlib_gpgme_qt =
endif

lib_LTLIBRARIES = libgpgme.la $(ltlib_gpgme_glib) $(ltlib_gpgme_qt) \
	$(ltlib_gpgme_pthread)

if HAVE_LD_VERSION_SCRIPT
libgpgme_version_script_cmd = -Wl,--version-script=$(srcdir)/libgpgme.vers
else
libgpgme_version_script_cmd =
endif

if HAVE_DOSISH_SYSTEM
system_components = w32-util.c w32-sema.c
system_components_not_extra = w32-io.c
else
system_components = ath.h posix-util.c posix-sema.c posix-io.c
system_components_not_extra =
endif

if HAVE_W32CE_SYSTEM
system_components += w32-ce.h w32-ce.c
endif

if HAVE_GPGSM
gpgsm_components = engine-gpgsm.c
else
gpgsm_components =
endif

if HAVE_ASSUAN
assuan_components = assuan-support.c engine-assuan.c
else
assuan_components =
endif

if HAVE_GPGCONF
gpgconf_components = engine-gpgconf.c
else
gpgconf_components =
endif

if HAVE_G13
g13_components = engine-g13.c
else
g13_components =
endif

if HAVE_UISERVER
uiserver_components = engine-uiserver.c
else
uiserver_components =
endif

# These are the source files common to all library versions.  We used
# to build a non-installed library for that, but that does not work
# correctly on all platforms (in particular, one can not specify the
# right linking order with libtool, as the non-installed version has
# unresolved symbols to the thread module.
main_sources =								\
	util.h conversion.c get-env.c context.h ops.h		        \
	data.h data.c data-fd.c data-stream.c data-mem.c data-user.c	\
	data-compat.c							\
	signers.c sig-notation.c					\
	wait.c wait-global.c wait-private.c wait-user.c wait.h		\
	op-support.c							\
	encrypt.c encrypt-sign.c decrypt.c decrypt-verify.c verify.c	\
	sign.c passphrase.c progress.c					\
	key.c keylist.c trust-item.c trustlist.c			\
	import.c export.c genkey.c delete.c edit.c getauditlog.c        \
	opassuan.c passwd.c                                             \
	engine.h engine-backend.h engine.c engine-gpg.c status-table.c	\
	$(gpgsm_components) $(assuan_components) $(gpgconf_components)  \
	$(uiserver_components)						\
	$(g13_components) vfs-mount.c vfs-create.c			\
	gpgconf.c							\
	sema.h priv-io.h $(system_components) dirinfo.c			\
	debug.c debug.h gpgme.c version.c error.c

libgpgme_la_SOURCES = $(main_sources)					\
	ath.h ath.c $(system_components_not_extra)
libgpgme_pthread_la_SOURCES = $(main_sources)				\
	ath.h ath-pthread.c $(system_components_not_extra)

if BUILD_W32_GLIB
libgpgme_glib_la_SOURCES = $(main_sources) ath.h ath.c w32-glib-io.c
endif

if BUILD_W32_QT
libgpgme_qt_la_SOURCES = $(main_sources) ath.h ath.c w32-qt-io.cpp \
	kdpipeiodevice.h kdpipeiodevice.cpp kdpipeiodevice.moc
# FIXME: Add extra depedency: moc_kdpipeiodevice.cpp

# These are built sources (normally).
# moc_kdpipeiodevice.cpp: kdpipeiodevice.h
#	$(MOC4) -o $@ $<
#
# kdpipeiodevice.moc: kdpipeiodevice.cpp
#	$(MOC4) -o $@ $<
endif

# We use a global CFLAGS and CPPFLAGS setting for all library
# versions, because then every object file is only compiled once.
AM_CPPFLAGS = @GPG_ERROR_CFLAGS@ @QT4_CORE_CFLAGS@
AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GLIB_CFLAGS@ @QT4_CORE_CFLAGS@

if HAVE_W32_SYSTEM
# Windows provides us with an endless stream of Tough Love.  To spawn
# processes with a controlled set of inherited handles, we need a
# wrapper process.
# Except on Windows CE.  There nothing is inheritable anyway.
if HAVE_W32CE_SYSTEM
libexec_PROGRAMS =
else
libexec_PROGRAMS = gpgme-w32spawn
endif

RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)

SUFFIXES = .rc .lo

.rc.lo:
	$(LTRCCOMPILE) -i "$<" -o "$@"

gpgme_res = versioninfo.lo
no_undefined = -no-undefined
export_symbols = -export-symbols $(srcdir)/gpgme.def

install-def-file:
	$(INSTALL) $(srcdir)/gpgme.def $(DESTDIR)$(libdir)/gpgme.def

uninstall-def-file:
	-rm $(DESTDIR)$(libdir)/gpgme.def

gpgme_deps = $(gpgme_res) gpgme.def

else
gpgme_res =
no_undefined =
export_symbols =
install-def-file:
uninstall-def-file:

gpgme_deps =
endif

libgpgme_la_LDFLAGS = $(no_undefined) $(export_symbols) \
	$(libgpgme_version_script_cmd) -version-info \
	@LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
libgpgme_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
libgpgme_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
	             @GPG_ERROR_LIBS@

libgpgme_pthread_la_LDFLAGS = $(no_undefined) $(export_symbols) \
	$(libgpgme_version_script_cmd) -version-info \
	@LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
libgpgme_pthread_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers
libgpgme_pthread_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
	-lpthread @GPG_ERROR_LIBS@

if BUILD_W32_GLIB
libgpgme_glib_la_LDFLAGS = $(no_undefined) \
	$(export_symbols) $(libgpgme_version_script_cmd) -version-info \
	@LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
libgpgme_glib_la_DEPENDENCIES =	@LTLIBOBJS@ \
	$(srcdir)/libgpgme.vers $(gpgme_deps)
libgpgme_glib_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
	@GPG_ERROR_LIBS@ @GLIB_LIBS@
endif

if BUILD_W32_QT
libgpgme_qt_la_LDFLAGS = $(no_undefined) \
	$(export_symbols) $(libgpgme_version_script_cmd) -version-info \
	@LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
libgpgme_qt_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
libgpgme_qt_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
	@GPG_ERROR_LIBS@ @QT4_CORE_LIBS@
endif

noinst_PROGRAMS = gpgme-tool
gpgme_tool_LDADD = libgpgme.la @LIBASSUAN_LIBS@

install-data-local: install-def-file

uninstall-local: uninstall-def-file