Updated FIPS140 initialization and added a self test for 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 SUBDIRS = includes x509 accelerated auth ext algorithms extras
24 if ENABLE_MINITASN1
25 SUBDIRS += minitasn1
26 endif
27
28 localedir = $(datadir)/locale
29
30 AM_CFLAGS = $(WERROR_CFLAGS) $(WSTACK_CFLAGS) $(WARN_CFLAGS) $(NETTLE_CFLAGS)
31 AM_CPPFLAGS = \
32         -DLOCALEDIR=\"$(localedir)\"            \
33         -I$(srcdir)/../gl                       \
34         -I$(builddir)/../gl                     \
35         -I$(builddir)/includes                  \
36         -I$(builddir)/x509                      \
37         -I$(srcdir)/includes                    \
38         -I$(builddir)/includes                  \
39         -I$(srcdir)/x509                        \
40         $(LIBTASN1_CFLAGS)                      \
41         $(P11_KIT_CFLAGS)
42
43 if ENABLE_OPENPGP
44 SUBDIRS += opencdk
45 SUBDIRS += openpgp
46 AM_CPPFLAGS += -I$(srcdir)/opencdk
47 endif
48
49 if ENABLE_MINITASN1
50 AM_CPPFLAGS += -I$(srcdir)/minitasn1
51 endif
52
53 # Pkg-config script.
54 pkgconfigdir = $(libdir)/pkgconfig
55 pkgconfig_DATA = gnutls.pc
56 DISTCLEANFILES = $(pkgconfig_DATA)
57
58 lib_LTLIBRARIES = libgnutls.la
59
60 SRP_COBJECTS = gnutls_srp.c
61
62 PSK_COBJECTS = gnutls_psk.c
63
64 COBJECTS = gnutls_range.c gnutls_record.c \
65         gnutls_compress.c debug.c gnutls_cipher.c       \
66         gnutls_mbuffers.c gnutls_buffers.c gnutls_handshake.c           \
67         gnutls_num.c gnutls_errors.c gnutls_dh.c gnutls_kx.c            \
68         gnutls_priority.c gnutls_hash_int.c gnutls_cipher_int.c         \
69         gnutls_session.c gnutls_db.c x509_b64.c gnutls_extensions.c     \
70         gnutls_auth.c gnutls_v2_compat.c gnutls_datum.c                 \
71         gnutls_session_pack.c gnutls_mpi.c gnutls_pk.c gnutls_cert.c    \
72         gnutls_global.c gnutls_constate.c gnutls_anon_cred.c            \
73         $(srcdir)/pkix_asn1_tab.c                               \
74         $(srcdir)/gnutls_asn1_tab.c                             \
75         gnutls_mem.c gnutls_ui.c vasprintf.c vasprintf.h                \
76         gnutls_sig.c gnutls_ecc.c gnutls_dh_primes.c gnutls_alert.c     \
77         system.c gnutls_str.c gnutls_state.c gnutls_x509.c              \
78         gnutls_rsa_export.c gnutls_helper.c gnutls_supplemental.c       \
79         random.c crypto-api.c gnutls_privkey.c gnutls_pcert.c           \
80         gnutls_pubkey.c locks.c gnutls_dtls.c system_override.c \
81         crypto-backend.c verify-tofu.c pin.c tpm.c fips.c
82
83 if ENABLE_SELF_CHECKS
84 COBJECTS += crypto-selftests.c crypto-selftests-pk.c
85 endif
86
87 if ENABLE_PKCS11
88 COBJECTS += pkcs11.c pkcs11_privkey.c pkcs11_write.c pkcs11_secret.c \
89         pkcs11_int.c
90 endif
91
92 if ENABLE_NETTLE
93 SUBDIRS += nettle
94 endif
95
96 HFILES = abstract_int.h debug.h gnutls_compress.h gnutls_cipher.h       \
97         gnutls_buffers.h gnutls_errors.h gnutls_int.h gnutls_dtls.h     \
98         gnutls_handshake.h gnutls_num.h algorithms.h            \
99         gnutls_dh.h gnutls_kx.h gnutls_hash_int.h gnutls_cipher_int.h   \
100         gnutls_db.h gnutls_auth.h gnutls_extensions.h   \
101         x509_b64.h gnutls_v2_compat.h gnutls_datum.h \
102         gnutls_mpi.h gnutls_pk.h gnutls_record.h                \
103         gnutls_constate.h gnutls_global.h gnutls_sig.h gnutls_mem.h     \
104         gnutls_session_pack.h gnutls_str.h gnutls_str_array.h           \
105         gnutls_state.h gnutls_x509.h crypto-backend.h                   \
106         gnutls_srp.h auth/srp.h auth/srp_passwd.h       \
107         gnutls_helper.h gnutls_supplemental.h crypto.h random.h system.h\
108         locks.h gnutls_mbuffers.h gnutls_ecc.h pin.h fips.h
109
110 if ENABLE_PKCS11
111 HFILES += pkcs11_int.h
112 endif
113
114 # Separate so we can create the documentation
115
116 libgnutls_la_SOURCES = $(HFILES) $(COBJECTS) $(SRP_COBJECTS)    \
117         $(PSK_COBJECTS) \
118         gnutls.asn pkix.asn libgnutls.map
119
120 libgnutls_la_LDFLAGS = -no-undefined \
121         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
122
123 libgnutls_la_LIBADD = ../gl/libgnu.la x509/libgnutls_x509.la \
124         accelerated/libaccelerated.la ext/libgnutls_ext.la \
125         auth/libgnutls_auth.la algorithms/libgnutls_alg.la \
126         extras/libgnutls_extras.la
127 thirdparty_libadd = $(LTLIBZ) $(LTLIBINTL) $(LIBSOCKET) \
128         $(LTLIBPTHREAD) $(LTLIBICONV) $(P11_KIT_LIBS) $(LIB_SELECT) $(TSS_LIBS) \
129         $(LTLIBICONV)
130
131 if NEEDS_LIBRT
132 thirdparty_libadd += $(LTLIBRT)
133 endif
134
135 if ENABLE_FIPS140
136 thirdparty_libadd += $(FIPS140_LIBS)
137 endif
138
139 if ENABLE_OPENPGP
140 libgnutls_la_LIBADD += openpgp/libgnutls_openpgp.la
141 libgnutls_la_LIBADD += opencdk/libminiopencdk.la
142 endif
143
144 if HAVE_LD_VERSION_SCRIPT
145 libgnutls_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libgnutls.map
146 else
147 libgnutls_la_LDFLAGS += -export-symbols-regex '^(gnutls|_gnutls).*'
148 endif
149
150 if ENABLE_MINITASN1
151 libgnutls_la_LIBADD += minitasn1/libminitasn1.la
152 else
153 thirdparty_libadd += $(LIBTASN1_LIBS)
154 endif
155
156 if ENABLE_NETTLE
157 thirdparty_libadd += $(NETTLE_LIBS) $(HOGWEED_LIBS) $(GMP_LIBS)
158 libgnutls_la_LIBADD += nettle/libcrypto.la
159 endif
160
161 if HAVE_LD_OUTPUT_DEF
162 libgnutls_la_LDFLAGS += -Wl,--output-def,libgnutls-$(DLL_VERSION).def
163 libgnutls-$(DLL_VERSION).def: libgnutls.la
164 defexecdir = $(bindir)
165 defexec_DATA = libgnutls-$(DLL_VERSION).def
166 DISTCLEANFILES += $(defexec_DATA)
167 endif
168
169 if WINDOWS
170 thirdparty_libadd += -lcrypt32
171 endif
172
173 libgnutls_la_LIBADD += $(thirdparty_libadd)
174
175 # C++ library
176
177 if ENABLE_CXX
178 libgnutlsxx_la_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_builddir)/includes -I$(srcdir)/includes
179
180 AM_CXXFLAGS = \
181         -I$(srcdir)/includes    \
182         -I$(builddir)/includes  
183
184 lib_LTLIBRARIES += libgnutlsxx.la
185
186 libgnutlsxx_la_SOURCES = gnutlsxx.cpp
187
188 libgnutlsxx_la_LDFLAGS = -no-undefined \
189         -version-info $(CXX_LT_CURRENT):$(CXX_LT_REVISION):$(CXX_LT_AGE)
190
191 libgnutlsxx_la_LIBADD = libgnutls.la
192
193 endif
194
195 pkix_asn1_tab.c: $(srcdir)/pkix.asn
196         -asn1Parser $(srcdir)/pkix.asn pkix_asn1_tab.c
197
198 gnutls_asn1_tab.c: $(srcdir)/gnutls.asn
199         -asn1Parser $(srcdir)/gnutls.asn gnutls_asn1_tab.c
200
201
202 libgnutls_xssl_la_LDFLAGS = -no-undefined
203
204 lib_LTLIBRARIES += libgnutls-xssl.la
205
206 libgnutls_xssl_la_SOURCES = xssl.c xssl_getline.c xssl.h
207
208 libgnutls_xssl_la_LIBADD = ../gl/libgnu.la libgnutls.la
209
210 libgnutls_xssl_la_LDFLAGS += -version-info $(LT_XSSL_CURRENT):$(LT_XSSL_REVISION):$(LT_XSSL_AGE)
211
212 if HAVE_LD_OUTPUT_DEF
213 libgnutls_xssl_la_LDFLAGS += \
214         -Wl,--output-def,libgnutls-xssl-$(DLL_VERSION).def
215 libgnutls-xssl-$(DLL_VERSION).def: libgnutls-xssl.la
216 defexec_DATA += libgnutls-xssl-$(DLL_VERSION).def
217 endif