bundle inet_ntop in systems that don't have it
[gnutls:gnutls.git] / lib / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2 # Copyright (C) 2000-2012 Free Software Foundation, Inc.
3 #
4 # Author: Nikos Mavrogiannopoulos
5 #
6 # This file is part of GnuTLS.
7 #
8 # The GnuTLS is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public License
10 # as published by the Free Software Foundation; either version 3 of
11 # the License, or (at your option) any later version.
12 #
13 # The GnuTLS is distributed in the hope that it will be
14 # useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 # Lesser General Public License for more details.
17 #
18 # You should have received a copy of the GNU Lesser General Public License
19 # along with this program.  If not, see <http://www.gnu.org/licenses/>
20
21 ACLOCAL_AMFLAGS = -I ../m4 -I ../gl/m4
22
23 EXTRA_DIST = priority_options.gperf
24 BUILT_SOURCES = pkix_asn1_tab.c gnutls_asn1_tab.c priority_options.h
25
26 SUBDIRS = includes x509 auth ext algorithms extras accelerated
27
28 if ENABLE_MINITASN1
29 SUBDIRS += minitasn1
30 endif
31
32 localedir = $(datadir)/locale
33
34 AM_CFLAGS = $(WERROR_CFLAGS) $(WSTACK_CFLAGS) $(WARN_CFLAGS) $(NETTLE_CFLAGS)
35 AM_CPPFLAGS = \
36         -DLOCALEDIR=\"$(localedir)\"            \
37         -I$(srcdir)/../gl                       \
38         -I$(builddir)/../gl                     \
39         -I$(builddir)/includes                  \
40         -I$(builddir)/x509                      \
41         -I$(srcdir)/includes                    \
42         -I$(builddir)/includes                  \
43         -I$(srcdir)/x509                        \
44         $(LIBTASN1_CFLAGS)                      \
45         $(P11_KIT_CFLAGS)
46
47 if ENABLE_OPENPGP
48 SUBDIRS += opencdk
49 SUBDIRS += openpgp
50 AM_CPPFLAGS += -I$(srcdir)/opencdk
51 endif
52
53 if ENABLE_MINITASN1
54 AM_CPPFLAGS += -I$(srcdir)/minitasn1
55 endif
56
57 # Pkg-config script.
58 pkgconfigdir = $(libdir)/pkgconfig
59 pkgconfig_DATA = gnutls.pc
60 DISTCLEANFILES = $(pkgconfig_DATA)
61
62 lib_LTLIBRARIES = libgnutls.la
63
64 SRP_COBJECTS = gnutls_srp.c
65
66 PSK_COBJECTS = gnutls_psk.c
67
68 COBJECTS = gnutls_range.c gnutls_record.c \
69         gnutls_compress.c debug.c gnutls_cipher.c       \
70         gnutls_mbuffers.c gnutls_buffers.c gnutls_handshake.c           \
71         gnutls_num.c gnutls_errors.c gnutls_dh.c gnutls_kx.c            \
72         gnutls_priority.c gnutls_hash_int.c gnutls_cipher_int.c         \
73         gnutls_session.c gnutls_db.c x509_b64.c gnutls_extensions.c     \
74         gnutls_auth.c gnutls_v2_compat.c gnutls_datum.c                 \
75         gnutls_session_pack.c gnutls_mpi.c gnutls_pk.c gnutls_cert.c    \
76         gnutls_global.c gnutls_constate.c gnutls_anon_cred.c            \
77         pkix_asn1_tab.c gnutls_asn1_tab.c                               \
78         gnutls_mem.c gnutls_ui.c vasprintf.c vasprintf.h                \
79         gnutls_sig.c gnutls_ecc.c gnutls_alert.c gnutls_privkey_raw.c   \
80         system.c inet_ntop.c gnutls_str.c gnutls_state.c gnutls_x509.c \
81         gnutls_helper.c gnutls_supplemental.c   \
82         random.c crypto-api.c gnutls_privkey.c gnutls_pcert.c           \
83         gnutls_pubkey.c locks.c gnutls_dtls.c system_override.c \
84         crypto-backend.c verify-tofu.c pin.c tpm.c fips.c \
85         safe-memfuncs.c inet_pton.c atfork.c atfork.h \
86         system-keys.h urls.c urls.h
87
88 if WINDOWS
89 COBJECTS += system-keys-win.c
90 else
91 COBJECTS += system-keys-dummy.c
92 endif
93
94 if ENABLE_SELF_CHECKS
95 COBJECTS += crypto-selftests.c crypto-selftests-pk.c
96 endif
97
98 if ENABLE_PKCS11
99 COBJECTS += pkcs11.c pkcs11x.c pkcs11_privkey.c pkcs11_write.c pkcs11_secret.c \
100         pkcs11_int.c
101 endif
102
103 if ENABLE_NETTLE
104 SUBDIRS += nettle
105 endif
106
107 HFILES = abstract_int.h debug.h gnutls_compress.h gnutls_cipher.h       \
108         gnutls_buffers.h gnutls_errors.h gnutls_int.h gnutls_dtls.h     \
109         gnutls_handshake.h gnutls_num.h algorithms.h            \
110         gnutls_dh.h gnutls_kx.h gnutls_hash_int.h gnutls_cipher_int.h   \
111         gnutls_db.h gnutls_auth.h gnutls_extensions.h   \
112         x509_b64.h gnutls_v2_compat.h gnutls_datum.h \
113         gnutls_mpi.h gnutls_pk.h gnutls_record.h                \
114         gnutls_constate.h gnutls_global.h gnutls_sig.h gnutls_mem.h     \
115         gnutls_session_pack.h gnutls_str.h gnutls_str_array.h           \
116         gnutls_state.h gnutls_x509.h crypto-backend.h                   \
117         gnutls_srp.h auth/srp.h auth/srp_passwd.h       \
118         gnutls_helper.h gnutls_supplemental.h crypto.h random.h system.h\
119         locks.h gnutls_mbuffers.h gnutls_ecc.h pin.h fips.h \
120         priority_options.h
121
122 if ENABLE_PKCS11
123 HFILES += pkcs11_int.h pkcs11x.h
124 endif
125
126 # Separate so we can create the documentation
127
128 libgnutls_la_SOURCES = $(HFILES) $(COBJECTS) $(SRP_COBJECTS)    \
129         $(PSK_COBJECTS) \
130         gnutls.asn pkix.asn libgnutls.map
131
132 libgnutls_la_LDFLAGS = -no-undefined \
133         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
134
135 libgnutls_la_LIBADD = ../gl/libgnu.la x509/libgnutls_x509.la \
136         ext/libgnutls_ext.la \
137         auth/libgnutls_auth.la algorithms/libgnutls_alg.la \
138         extras/libgnutls_extras.la
139 thirdparty_libadd = $(LTLIBZ) $(LTLIBINTL) $(LIBSOCKET) $(LTLIBNSL) \
140         $(LTLIBICONV) $(P11_KIT_LIBS) $(LIB_SELECT) $(TSS_LIBS)
141
142 if HAVE_LIBIDN
143 thirdparty_libadd += $(LIBIDN_LIBS)
144 endif
145
146 if ENABLE_NETTLE
147 libgnutls_la_LIBADD += accelerated/libaccelerated.la
148 endif
149
150 if !WINDOWS
151 thirdparty_libadd += $(LTLIBPTHREAD)
152 endif
153
154 if NEEDS_LIBRT
155 thirdparty_libadd += $(LTLIBRT)
156 endif
157
158 if ENABLE_FIPS140
159 thirdparty_libadd += $(FIPS140_LIBS)
160 endif
161
162 if ENABLE_OPENPGP
163 libgnutls_la_LIBADD += openpgp/libgnutls_openpgp.la
164 libgnutls_la_LIBADD += opencdk/libminiopencdk.la
165 endif
166
167 if HAVE_LD_VERSION_SCRIPT
168 libgnutls_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libgnutls.map
169 else
170 libgnutls_la_LDFLAGS += -export-symbols-regex '^(gnutls|_gnutls).*'
171 endif
172
173 if ENABLE_MINITASN1
174 libgnutls_la_LIBADD += minitasn1/libminitasn1.la
175 else
176 thirdparty_libadd += $(LIBTASN1_LIBS)
177 endif
178
179 if ENABLE_NETTLE
180 thirdparty_libadd += $(NETTLE_LIBS) $(HOGWEED_LIBS) $(GMP_LIBS)
181 libgnutls_la_LIBADD += nettle/libcrypto.la
182 endif
183
184 if HAVE_LD_OUTPUT_DEF
185 libgnutls_la_LDFLAGS += -Wl,--output-def,libgnutls-$(DLL_VERSION).def
186 libgnutls-$(DLL_VERSION).def: libgnutls.la
187 defexecdir = $(bindir)
188 defexec_DATA = libgnutls-$(DLL_VERSION).def
189 DISTCLEANFILES += $(defexec_DATA)
190 endif
191
192 if WINDOWS
193 thirdparty_libadd += -lcrypt32
194 endif
195
196 libgnutls_la_LIBADD += $(thirdparty_libadd)
197
198 # C++ library
199
200 if ENABLE_CXX
201 libgnutlsxx_la_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_builddir)/includes -I$(srcdir)/includes
202
203 AM_CXXFLAGS = \
204         -I$(srcdir)/includes    \
205         -I$(builddir)/includes  
206
207 lib_LTLIBRARIES += libgnutlsxx.la
208
209 libgnutlsxx_la_SOURCES = gnutlsxx.cpp
210
211 libgnutlsxx_la_LDFLAGS = -no-undefined \
212         -version-info $(CXX_LT_CURRENT):$(CXX_LT_REVISION):$(CXX_LT_AGE)
213
214 libgnutlsxx_la_LIBADD = libgnutls.la
215
216 endif
217
218 pkix_asn1_tab.c: $(srcdir)/pkix.asn
219         -asn1Parser $(srcdir)/pkix.asn pkix_asn1_tab.c
220
221 gnutls_asn1_tab.c: $(srcdir)/gnutls.asn
222         -asn1Parser $(srcdir)/gnutls.asn gnutls_asn1_tab.c
223
224 priority_options.h: $(srcdir)/priority_options.gperf
225         -gperf --global-table -t $^ > $@-tmp && mv $@-tmp $@
226