w32: Improve locating gpgconf on 64 bit systems.
[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_SOURCES = gpgme-tool.c argparse.c argparse.h
132 gpgme_tool_LDADD = libgpgme.la @LIBASSUAN_LIBS@
133
134
135 if HAVE_W32_SYSTEM
136 # Windows provides us with an endless stream of Tough Love.  To spawn
137 # processes with a controlled set of inherited handles, we need a
138 # wrapper process.
139 # Except on Windows CE.  There nothing is inheritable anyway.
140 if HAVE_W32CE_SYSTEM
141 libexec_PROGRAMS =
142 else
143 libexec_PROGRAMS = gpgme-w32spawn
144 endif
145
146 RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
147 LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
148
149 SUFFIXES = .rc .lo
150
151 .rc.lo:
152         $(LTRCCOMPILE) -i "$<" -o "$@"
153
154 gpgme_res = versioninfo.lo
155 no_undefined = -no-undefined
156 export_symbols = -export-symbols $(srcdir)/gpgme.def
157 extra_ltoptions = -XCClinker -static-libgcc
158
159 install-def-file:
160         -$(INSTALL) -d $(DESTDIR)$(libdir)
161         $(INSTALL) $(srcdir)/gpgme.def $(DESTDIR)$(libdir)/gpgme.def
162
163 uninstall-def-file:
164         -rm $(DESTDIR)$(libdir)/gpgme.def
165
166 gpgme_deps = $(gpgme_res) gpgme.def
167
168 else
169 gpgme_res =
170 no_undefined =
171 export_symbols =
172 extra_ltoptions =
173 install-def-file:
174 uninstall-def-file:
175
176 gpgme_deps =
177 endif
178
179 libgpgme_la_LDFLAGS = $(no_undefined) $(export_symbols) $(extra_ltoptions) \
180         $(libgpgme_version_script_cmd) -version-info \
181         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
182 libgpgme_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
183 libgpgme_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
184                      @GPG_ERROR_LIBS@
185
186 libgpgme_pthread_la_LDFLAGS = \
187         $(no_undefined) $(export_symbols) $(extra_ltoptions) \
188         $(libgpgme_version_script_cmd) -version-info \
189         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
190 libgpgme_pthread_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers
191 libgpgme_pthread_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
192         -lpthread @GPG_ERROR_LIBS@
193
194 if BUILD_W32_GLIB
195 libgpgme_glib_la_LDFLAGS = \
196         $(no_undefined) $(export_symbols) $(extra_ltoptions) \
197         $(libgpgme_version_script_cmd) -version-info \
198         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
199 libgpgme_glib_la_DEPENDENCIES = @LTLIBOBJS@ \
200         $(srcdir)/libgpgme.vers $(gpgme_deps)
201 libgpgme_glib_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
202         @GPG_ERROR_LIBS@ @GLIB_LIBS@
203 endif
204
205 if BUILD_W32_QT
206 libgpgme_qt_la_LDFLAGS = $(no_undefined) \
207         $(export_symbols) $(libgpgme_version_script_cmd) -version-info \
208         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
209 libgpgme_qt_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
210 libgpgme_qt_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
211         @GPG_ERROR_LIBS@ @QT4_CORE_LIBS@
212 endif
213
214 install-data-local: install-def-file
215
216 uninstall-local: uninstall-def-file