Makefile.am 6.65 KB
Newer Older
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
Simon Josefsson's avatar
Simon Josefsson committed
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
Simon Josefsson's avatar
Simon Josefsson committed
11
# the License, or (at your option) any later version.
12
#
13
# The GnuTLS is distributed in the hope that it will be
Simon Josefsson's avatar
Simon Josefsson committed
14 15 16
# 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.
17
#
18 19
# 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/>
20

21
ACLOCAL_AMFLAGS = -I ../m4 -I ../gl/m4
Simon Josefsson's avatar
Simon Josefsson committed
22

23
EXTRA_DIST = priority_options.gperf common.mk
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 29 30
if ENABLE_MINITASN1
SUBDIRS += minitasn1
endif
31

Simon Josefsson's avatar
Simon Josefsson committed
32 33
localedir = $(datadir)/locale

34 35
include $(top_srcdir)/lib/common.mk

36 37
AM_CPPFLAGS = \
	-DLOCALEDIR=\"$(localedir)\"		\
38 39
	-I$(srcdir)/../gl			\
	-I$(builddir)/../gl			\
40 41
	-I$(builddir)/includes			\
	-I$(builddir)/x509			\
42
	-I$(srcdir)/includes			\
43
	-I$(builddir)/includes			\
44
	-I$(srcdir)/x509			\
45
	$(LIBTASN1_CFLAGS)			\
46
	$(P11_KIT_CFLAGS)
47

48 49 50 51 52
if !HAVE_LIBUNISTRING
SUBDIRS += unistring
AM_CPPFLAGS += -I$(srcdir)/unistring/ -I$(builddir)/unistring/
endif

53 54 55 56
if ENABLE_MINITASN1
AM_CPPFLAGS += -I$(srcdir)/minitasn1
endif

57 58 59 60 61
# Pkg-config script.
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gnutls.pc
DISTCLEANFILES = $(pkgconfig_DATA)

Simon Josefsson's avatar
Simon Josefsson committed
62
lib_LTLIBRARIES = libgnutls.la
63

64 65 66 67
SRP_COBJECTS = srp.c

PSK_COBJECTS = psk.c

68
COBJECTS = range.c record.c compress.c debug.c cipher.c	handshake-tls13.c	\
69
	mbuffers.c buffers.c handshake.c num.c errors.c dh.c kx.c	\
70
	priority.c hash_int.c cipher_int.c session.c db.c x509_b64.c	\
71
	hello_ext.c auth.c sslv2_compat.c datum.c session_pack.c mpi.c \
72
	pk.c cert-cred.c global.c constate.c anon_cred.c pkix_asn1_tab.c gnutls_asn1_tab.c	\
73
	mem.c fingerprint.c tls-sig.c ecc.c alert.c privkey_raw.c atomic.h	\
74
	system/certs.c system/threads.c system/fastopen.c system/sockets.c	\
75
	system/inet_ntop.c str-iconv.c system/vasprintf.c vasprintf.h system.c \
76
	str.c str-unicode.c str-idna.c state.c cert-cred-x509.c file.c supplemental.c	\
77
	random.c crypto-api.c crypto-api.h privkey.c pcert.c pubkey.c locks.c dtls.c \
78
	system_override.c crypto-backend.c verify-tofu.c pin.c tpm.c fips.c	\
79
	safe-memfuncs.c system/inet_pton.c atfork.c atfork.h randomart.c \
80
	system-keys.h urls.c urls.h prf.c auto-verify.c dh-session.c \
81
	cert-session.c handshake-checks.c dtls-sw.c dh-primes.c openpgp_compat.c \
82
	crypto-selftests.c crypto-selftests-pk.c secrets.c extv.c extv.h \
83
	hello_ext_lib.c hello_ext_lib.h ocsp-api.c
84

85
if WINDOWS
86
COBJECTS += system/keys-win.c
87
else
88
COBJECTS += system/keys-dummy.c
89 90
endif

91 92 93 94 95
COBJECTS += tls13/encrypted_extensions.c tls13/encrypted_extensions.h \
	tls13/certificate_request.c tls13/certificate_request.h \
	tls13/certificate_verify.c tls13/certificate_verify.h \
	tls13-sig.c tls13-sig.h \
	tls13/finished.c tls13/finished.h \
96
	tls13/hello_retry.c tls13/hello_retry.h \
97
	tls13/session_ticket.c tls13/session_ticket.h \
98
	tls13/certificate.c tls13/certificate.h
99

100
if ENABLE_PKCS11
101
COBJECTS += pkcs11.c pkcs11x.c pkcs11_privkey.c pkcs11_write.c pkcs11_secret.c \
102
	pkcs11_int.c
103
endif
Simon Josefsson's avatar
Simon Josefsson committed
104

105 106 107 108
if ENABLE_NETTLE
SUBDIRS += nettle
endif

109
HFILES = abstract_int.h debug.h cipher.h	\
110 111 112
	buffers.h errors.h gnutls_int.h dtls.h	\
	handshake.h num.h algorithms.h		\
	dh.h kx.h hash_int.h cipher_int.h	\
113
	db.h auth.h hello_ext.h	\
114 115 116 117 118
	x509_b64.h sslv2_compat.h datum.h \
	mpi.h pk.h record.h		\
	constate.h global.h tls-sig.h mem.h	\
	session_pack.h str.h str_array.h		\
	state.h x509.h crypto-backend.h			\
119
	srp.h auth/srp_kx.h auth/srp_passwd.h	\
120
	file.h supplemental.h crypto.h random.h system.h\
121
	locks.h mbuffers.h ecc.h pin.h fips.h \
122
	priority_options.h secrets.h
123

124
if ENABLE_PKCS11
125
HFILES += pkcs11_int.h pkcs11x.h
126
endif
127

128
libgnutls_la_SOURCES = $(HFILES) $(COBJECTS) $(SRP_COBJECTS)	\
129
	$(PSK_COBJECTS) \
Daiki Ueno's avatar
Daiki Ueno committed
130
	gnutls.asn pkix.asn libgnutls.map
131

132
libgnutls_la_LDFLAGS = -no-undefined \
133
	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) $(COMMON_LINK_FLAGS)
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
	$(P11_KIT_LIBS) $(LIB_SELECT)
141

142
if HAVE_LIBIDN2
143
thirdparty_libadd += $(LIBIDN2_LIBS)
144 145
endif

146 147
if HAVE_LIBUNISTRING
thirdparty_libadd += $(LTLIBUNISTRING)
148 149
else
libgnutls_la_LIBADD += unistring/libunistring.la
150 151
endif

152 153 154 155
if ENABLE_NETTLE
libgnutls_la_LIBADD += accelerated/libaccelerated.la
endif

156 157 158 159
if !WINDOWS
thirdparty_libadd += $(LTLIBPTHREAD)
endif

160 161 162 163
if NEEDS_LIBRT
thirdparty_libadd += $(LTLIBRT)
endif

164
if ENABLE_FIPS140
165
thirdparty_libadd += $(FIPS140_LIBS) $(LTLIBDL)
166 167
endif

168
if ENABLE_TROUSERS
169
thirdparty_libadd += $(LTLIBDL)
170 171
endif

Simon Josefsson's avatar
Simon Josefsson committed
172
if HAVE_LD_VERSION_SCRIPT
Simon Josefsson's avatar
Simon Josefsson committed
173
libgnutls_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libgnutls.map
174 175
else
libgnutls_la_LDFLAGS += -export-symbols-regex '^(gnutls|_gnutls).*'
Simon Josefsson's avatar
Simon Josefsson committed
176 177
endif

178 179 180
if ENABLE_MINITASN1
libgnutls_la_LIBADD += minitasn1/libminitasn1.la
else
181
thirdparty_libadd += $(LIBTASN1_LIBS)
182
endif
183

184
if ENABLE_NETTLE
185
thirdparty_libadd += $(NETTLE_LIBS) $(HOGWEED_LIBS) $(GMP_LIBS)
186 187 188
libgnutls_la_LIBADD += nettle/libcrypto.la
endif

189
if HAVE_LD_OUTPUT_DEF
190
libgnutls_la_LDFLAGS += -Wl,--output-def,libgnutls-$(DLL_VERSION).def
191
libgnutls-$(DLL_VERSION).def: libgnutls.la
192
defexecdir = $(libdir)
193
defexec_DATA = libgnutls-$(DLL_VERSION).def
194 195 196
DISTCLEANFILES += $(defexec_DATA)
endif

197 198 199 200
if WINDOWS
thirdparty_libadd += -lcrypt32
endif

201 202 203 204
if MACOSX
libgnutls_la_LDFLAGS += -framework Security -framework CoreFoundation
endif

205 206
libgnutls_la_LIBADD += $(thirdparty_libadd)

207 208 209
# C++ library

if ENABLE_CXX
210
libgnutlsxx_la_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_builddir)/includes -I$(srcdir)/includes
211

212 213 214
AM_CXXFLAGS = \
	-I$(srcdir)/includes	\
	-I$(builddir)/includes	
Simon Josefsson's avatar
Simon Josefsson committed
215 216 217

lib_LTLIBRARIES += libgnutlsxx.la

218
libgnutlsxx_la_SOURCES = gnutlsxx.cpp
219 220

libgnutlsxx_la_LDFLAGS = -no-undefined \
221
	-version-info $(CXX_LT_CURRENT):$(CXX_LT_REVISION):$(CXX_LT_AGE)
222 223

libgnutlsxx_la_LIBADD = libgnutls.la
224

225
endif
226

227 228
pkix_asn1_tab.c: $(srcdir)/pkix.asn
	-asn1Parser $(srcdir)/pkix.asn pkix_asn1_tab.c
229

230
gnutls_asn1_tab.c: $(srcdir)/gnutls.asn
231
	-asn1Parser $(srcdir)/gnutls.asn gnutls_asn1_tab.c
232

233
priority_options.h: $(srcdir)/priority_options.gperf
234 235 236
	-gperf --global-table -t $^ > $@-tmp \
	&& sed 's/^const struct priority_options_st \*/static const struct priority_options_st \*/' <$@-tmp >$@ \
	&& rm -f $@-tmp