core: Fail loudly in case w32 spawner not found
[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 lib_LTLIBRARIES = libgpgme.la $(ltlib_gpgme_glib) $(ltlib_gpgme_qt) \
45         $(ltlib_gpgme_pthread)
46
47 if HAVE_LD_VERSION_SCRIPT
48 libgpgme_version_script_cmd = -Wl,--version-script=$(srcdir)/libgpgme.vers
49 else
50 libgpgme_version_script_cmd =
51 endif
52
53 if HAVE_DOSISH_SYSTEM
54 system_components = w32-util.c w32-sema.c
55 system_components_not_extra = w32-io.c
56 else
57 system_components = ath.h posix-util.c posix-sema.c posix-io.c
58 system_components_not_extra =
59 endif
60
61 if HAVE_W32CE_SYSTEM
62 system_components += w32-ce.h w32-ce.c
63 endif
64
65 if HAVE_UISERVER
66 uiserver_components = engine-uiserver.c
67 else
68 uiserver_components =
69 endif
70
71 # These are the source files common to all library versions.  We used
72 # to build a non-installed library for that, but that does not work
73 # correctly on all platforms (in particular, one can not specify the
74 # right linking order with libtool, as the non-installed version has
75 # unresolved symbols to the thread module.
76 main_sources =                                                          \
77         util.h conversion.c b64dec.c get-env.c context.h ops.h          \
78         parsetlv.c parsetlv.h                                           \
79         data.h data.c data-fd.c data-stream.c data-mem.c data-user.c    \
80         data-compat.c data-identify.c                                   \
81         signers.c sig-notation.c                                        \
82         wait.c wait-global.c wait-private.c wait-user.c wait.h          \
83         op-support.c                                                    \
84         encrypt.c encrypt-sign.c decrypt.c decrypt-verify.c verify.c    \
85         sign.c passphrase.c progress.c                                  \
86         key.c keylist.c trust-item.c trustlist.c                        \
87         import.c export.c genkey.c delete.c edit.c getauditlog.c        \
88         opassuan.c passwd.c spawn.c assuan-support.c                    \
89         engine.h engine-backend.h engine.c engine-gpg.c status-table.c  \
90         engine-gpgsm.c engine-assuan.c engine-gpgconf.c                 \
91         $(uiserver_components)                                          \
92         engine-g13.c vfs-mount.c vfs-create.c                           \
93         engine-spawn.c                                                  \
94         gpgconf.c                                                       \
95         sema.h priv-io.h $(system_components) sys-util.h dirinfo.c      \
96         debug.c debug.h gpgme.c version.c error.c
97
98 libgpgme_la_SOURCES = $(main_sources)                                   \
99         ath.h ath.c $(system_components_not_extra)
100 libgpgme_pthread_la_SOURCES = $(main_sources)                           \
101         ath.h ath-pthread.c $(system_components_not_extra)
102
103 if BUILD_W32_GLIB
104 libgpgme_glib_la_SOURCES = $(main_sources) ath.h ath.c w32-glib-io.c
105 endif
106
107 # We use a global CFLAGS setting for all library
108 # versions, because then every object file is only compiled once.
109 AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GLIB_CFLAGS@
110
111 gpgme_tool_SOURCES = gpgme-tool.c argparse.c argparse.h
112 gpgme_tool_LDADD = libgpgme.la @LIBASSUAN_LIBS@
113
114
115 if HAVE_W32_SYSTEM
116 # Windows provides us with an endless stream of Tough Love.  To spawn
117 # processes with a controlled set of inherited handles, we need a
118 # wrapper process.
119 # Except on Windows CE.  There nothing is inheritable anyway.
120 if HAVE_W32CE_SYSTEM
121 libexec_PROGRAMS =
122 else
123 libexec_PROGRAMS = gpgme-w32spawn
124 endif
125
126 RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
127 LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
128
129 SUFFIXES = .rc .lo
130
131 .rc.lo:
132         $(LTRCCOMPILE) -i "$<" -o "$@"
133
134 gpgme_res = versioninfo.lo
135 no_undefined = -no-undefined
136 export_symbols = -export-symbols $(srcdir)/gpgme.def
137 extra_ltoptions = -XCClinker -static-libgcc
138
139 install-def-file:
140         -$(INSTALL) -d $(DESTDIR)$(libdir)
141         $(INSTALL) $(srcdir)/gpgme.def $(DESTDIR)$(libdir)/gpgme.def
142
143 uninstall-def-file:
144         -rm $(DESTDIR)$(libdir)/gpgme.def
145
146 gpgme_deps = $(gpgme_res) gpgme.def
147
148 else
149 gpgme_res =
150 no_undefined =
151 export_symbols =
152 extra_ltoptions =
153 install-def-file:
154 uninstall-def-file:
155
156 gpgme_deps =
157 endif
158
159 libgpgme_la_LDFLAGS = $(no_undefined) $(export_symbols) $(extra_ltoptions) \
160         $(libgpgme_version_script_cmd) -version-info \
161         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
162 libgpgme_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
163 libgpgme_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
164                      @GPG_ERROR_LIBS@
165
166 libgpgme_pthread_la_LDFLAGS = \
167         $(no_undefined) $(export_symbols) $(extra_ltoptions) \
168         $(libgpgme_version_script_cmd) -version-info \
169         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
170 libgpgme_pthread_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers
171 libgpgme_pthread_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
172         -lpthread @GPG_ERROR_LIBS@
173
174 if BUILD_W32_GLIB
175 libgpgme_glib_la_LDFLAGS = \
176         $(no_undefined) $(export_symbols) $(extra_ltoptions) \
177         $(libgpgme_version_script_cmd) -version-info \
178         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
179 libgpgme_glib_la_DEPENDENCIES = @LTLIBOBJS@ \
180         $(srcdir)/libgpgme.vers $(gpgme_deps)
181 libgpgme_glib_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
182         @GPG_ERROR_LIBS@ @GLIB_LIBS@
183 endif
184
185 install-data-local: install-def-file
186
187 uninstall-local: uninstall-def-file