Tizen 2.0 Release
[external/libgnutls26.git] / lib / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
3 # 2009, 2010 Free Software Foundation, Inc.
4 #
5 # Author: Nikos Mavrogiannopoulos
6 #
7 # This file is part of GnuTLS.
8 #
9 # The GnuTLS is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public License
11 # as published by the Free Software Foundation; either version 2.1 of
12 # the License, or (at your option) any later version.
13 #
14 # The GnuTLS is distributed in the hope that it will be
15 # useful, but WITHOUT ANY WARRANTY; without even the implied warranty
16 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 # Lesser General Public License for more details.
18 #
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with GnuTLS; if not, write to the Free
21 # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 # MA 02110-1301, USA
23
24 ACLOCAL_AMFLAGS = -I m4 -I gl/m4
25
26 SUBDIRS = gl po includes x509
27 if ENABLE_MINITASN1
28 SUBDIRS += minitasn1
29 endif
30
31 localedir = $(datadir)/locale
32
33 AM_CFLAGS = $(WERROR_CFLAGS) $(WSTACK_CFLAGS) $(WARN_CFLAGS)
34 AM_CPPFLAGS = \
35         -DLOCALEDIR=\"$(localedir)\"            \
36         -I$(srcdir)/gl                          \
37         -I$(builddir)/gl                        \
38         -I$(srcdir)/includes                    \
39         -I$(builddir)/includes                  \
40         -I$(srcdir)/x509
41
42 if ENABLE_OPENPGP
43 SUBDIRS += opencdk
44 SUBDIRS += openpgp
45 AM_CPPFLAGS += -I$(srcdir)/opencdk
46 endif
47
48 if ENABLE_MINITASN1
49 AM_CPPFLAGS += -I$(srcdir)/minitasn1
50 endif
51
52 # Pkg-config script.
53 pkgconfigdir = $(libdir)/pkgconfig
54 pkgconfig_DATA = gnutls.pc
55 DISTCLEANFILES = $(pkgconfig_DATA)
56
57 lib_LTLIBRARIES = libgnutls.la
58
59 SRP_COBJECTS = ext_srp.c gnutls_srp.c auth_srp.c auth_srp_passwd.c      \
60         auth_srp_sb64.c auth_srp_rsa.c
61
62 PSK_COBJECTS = auth_psk.c auth_psk_passwd.c gnutls_psk.c        \
63         auth_dhe_psk.c gnutls_psk_netconf.c
64
65 SESSION_TICKET_COBJECTS = ext_session_ticket.c
66
67 COBJECTS = gnutls_record.c gnutls_compress.c debug.c gnutls_cipher.c    \
68         gnutls_mbuffers.c gnutls_buffers.c gnutls_handshake.c gnutls_num.c \
69         gnutls_errors.c gnutls_algorithms.c gnutls_dh.c gnutls_kx.c     \
70         gnutls_priority.c gnutls_hash_int.c gnutls_cipher_int.c         \
71         gnutls_session.c gnutls_db.c x509_b64.c auth_anon.c             \
72         gnutls_extensions.c gnutls_auth.c gnutls_v2_compat.c            \
73         gnutls_datum.c auth_rsa.c gnutls_session_pack.c gnutls_mpi.c    \
74         gnutls_pk.c gnutls_cert.c gnutls_global.c gnutls_constate.c     \
75         gnutls_anon_cred.c pkix_asn1_tab.c gnutls_asn1_tab.c            \
76         gnutls_mem.c auth_cert.c gnutls_ui.c gnutls_sig.c auth_dhe.c    \
77         gnutls_dh_primes.c ext_max_record.c gnutls_alert.c              \
78         gnutls_str.c gnutls_state.c gnutls_x509.c ext_cert_type.c       \
79         gnutls_rsa_export.c auth_rsa_export.c ext_server_name.c         \
80         auth_dh_common.c gnutls_helper.c gnutls_supplemental.c          \
81         crypto.c random.c  ext_signature.c cryptodev.c system.c \
82         crypto-api.c ext_safe_renegotiation.c gnutls_privkey.c \
83         gnutls_pubkey.c locks.c
84
85 if ENABLE_PKCS11
86 COBJECTS += pkcs11.c pkcs11_privkey.c pkcs11_write.c pkcs11_secret.c
87 endif
88
89 if ENABLE_NETTLE
90 SUBDIRS += nettle
91 else
92 SUBDIRS += gcrypt
93 endif
94
95 HFILES = abstract_int.h debug.h gnutls_compress.h gnutls_cipher.h       \
96         gnutls_buffers.h gnutls_errors.h gnutls_int.h                   \
97         gnutls_handshake.h gnutls_num.h gnutls_algorithms.h             \
98         gnutls_dh.h gnutls_kx.h gnutls_hash_int.h gnutls_cipher_int.h   \
99         gnutls_db.h gnutls_auth.h auth_anon.h gnutls_extensions.h       \
100         x509_b64.h gnutls_v2_compat.h gnutls_datum.h auth_cert.h        \
101         gnutls_mpi.h gnutls_pk.h gnutls_record.h gnutls_cert.h          \
102         gnutls_constate.h gnutls_global.h gnutls_sig.h gnutls_mem.h     \
103         ext_max_record.h gnutls_session_pack.h gnutls_str.h             \
104         gnutls_state.h gnutls_x509.h ext_cert_type.h                    \
105         gnutls_rsa_export.h ext_server_name.h auth_dh_common.h          \
106         ext_srp.h gnutls_srp.h auth_srp.h auth_srp_passwd.h             \
107         gnutls_helper.h auth_psk.h auth_psk_passwd.h                    \
108         gnutls_supplemental.h crypto.h random.h system.h                \
109         ext_session_ticket.h ext_signature.h gnutls_cryptodev.h         \
110         ext_safe_renegotiation.h locks.h gnutls_mbuffers.h
111
112 if ENABLE_PKCS11
113 HFILES += pkcs11_int.h
114 endif
115
116 # Separate so we can create the documentation
117
118 libgnutls_la_SOURCES = $(HFILES) $(COBJECTS) $(SRP_COBJECTS)    \
119         $(PSK_COBJECTS) $(SESSION_TICKET_COBJECTS) \
120         gnutls.asn pkix.asn libgnutls.map
121
122 libgnutls_la_LDFLAGS = -no-undefined \
123         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
124
125 libgnutls_la_LIBADD = gl/liblgnu.la x509/libgnutls_x509.la \
126         $(LTLIBZ)  $(LTLIBINTL) $(LIBSOCKET) $(LTLIBDL) \
127         $(LTLIBPTHREAD)
128
129 if ENABLE_OPENPGP
130 libgnutls_la_LIBADD += openpgp/libgnutls_openpgp.la
131 libgnutls_la_LIBADD += opencdk/libminiopencdk.la
132 endif
133
134 if HAVE_LD_VERSION_SCRIPT
135 libgnutls_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libgnutls.map
136 else
137 libgnutls_la_LDFLAGS += -export-symbols-regex '^(gnutls|_gnutls).*'
138 endif
139
140 if ENABLE_MINITASN1
141 libgnutls_la_LIBADD += minitasn1/libminitasn1.la
142 else
143 libgnutls_la_LDFLAGS += $(LTLIBTASN1)
144 endif
145
146 libgnutls_la_LDFLAGS += $(LTLIBPAKCHOIS)
147
148 if ENABLE_NETTLE
149 libgnutls_la_LDFLAGS += $(LTLIBNETTLE) $(NETTLE_LIBS)
150 libgnutls_la_LIBADD += nettle/libcrypto.la
151 else
152 libgnutls_la_LDFLAGS += $(LTLIBGCRYPT)
153 libgnutls_la_LIBADD += gcrypt/libcrypto.la
154 endif
155
156 if HAVE_LD_OUTPUT_DEF
157 libgnutls_la_LDFLAGS += -Wl,--output-def,libgnutls-$(DLL_VERSION).def
158 defexecdir = $(bindir)
159 defexec_DATA = libgnutls-$(DLL_VERSION).def
160 DISTCLEANFILES += $(defexec_DATA)
161 endif
162
163 # C++ library
164
165 if ENABLE_CXX
166 libgnutlsxx_la_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_builddir)/includes
167
168 AM_CXXFLAGS = -I$(top_srcdir)/includes/
169
170 lib_LTLIBRARIES += libgnutlsxx.la
171
172 libgnutlsxx_la_SOURCES = gnutlsxx.cpp libgnutlsxx.map
173
174 libgnutlsxx_la_LDFLAGS = -no-undefined \
175         -version-info $(CXX_LT_CURRENT):$(CXX_LT_REVISION):$(CXX_LT_AGE)
176
177 libgnutlsxx_la_LIBADD = libgnutls.la
178
179 if HAVE_LD_VERSION_SCRIPT
180 libgnutlsxx_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libgnutlsxx.map
181 endif
182 endif
183
184 pkix_asn1_tab.c: pkix.asn
185         -asn1Parser pkix.asn pkix_asn1_tab.c
186
187 gnutls_asn1_tab.c: gnutls.asn
188         -asn1Parser gnutls.asn gnutls_asn1_tab.c