Avoid potential negative array index access to cached text.
[LibreOffice.git] / xmlsecurity / Library_xsec_xmlsec.mk
blob615c3eba0032145e9bfb769b3a251a733b7a1207
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(eval $(call gb_Library_Library,xsec_xmlsec))
12 $(eval $(call gb_Library_set_componentfile,xsec_xmlsec,xmlsecurity/util/xsec_xmlsec,services))
14 $(eval $(call gb_Library_add_componentimpls,xsec_xmlsec, \
15 $(if $(ENABLE_GPGMEPP),gpg) \
16 $(if $(or $(ENABLE_NSS),$(filter WNT,$(OS))),nss_mscrypt) \
17 $(if $(ENABLE_NSS),nss) \
20 $(eval $(call gb_Library_set_include,xsec_xmlsec,\
21 $$(INCLUDE) \
22 -I$(SRCDIR)/xmlsecurity/inc \
23 -I$(SRCDIR)/xmlsecurity/source/gpg \
24 -I$(SRCDIR)/xmlsecurity/source/xmlsec \
25 -I$(call gb_UnpackedTarball_get_dir,xmlsec/include) \
28 $(eval $(call gb_Library_use_custom_headers,xsec_xmlsec,\
29 officecfg/registry \
32 $(eval $(call gb_Library_use_sdk_api,xsec_xmlsec))
34 $(eval $(call gb_Library_add_defs,xsec_xmlsec,\
35 -DXMLSEC_NO_XSLT \
36 -DXSECXMLSEC_DLLIMPLEMENTATION \
39 $(eval $(call gb_Library_set_precompiled_header,xsec_xmlsec,xmlsecurity/inc/pch/precompiled_xsec_xmlsec))
41 $(eval $(call gb_Library_use_libraries,xsec_xmlsec,\
42 comphelper \
43 cppu \
44 cppuhelper \
45 sal \
46 svl \
47 tl \
48 xo \
49 utl \
52 ifeq ($(SYSTEM_XMLSEC),)
53 $(eval $(call gb_Library_use_packages,xsec_xmlsec,\
54 xmlsec \
56 endif
58 $(eval $(call gb_Library_use_externals,xsec_xmlsec,\
59 boost_headers \
60 $(if $(ENABLE_GPGMEPP),gpgmepp) \
61 libxml2 \
62 xmlsec \
65 $(eval $(call gb_Library_add_exception_objects,xsec_xmlsec,\
66 xmlsecurity/source/xmlsec/biginteger \
67 xmlsecurity/source/xmlsec/certificateextension_certextn \
68 xmlsecurity/source/xmlsec/errorcallback \
69 xmlsecurity/source/xmlsec/saxhelper \
70 xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl \
71 xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl \
72 xmlsecurity/source/xmlsec/xmlsec_init \
73 xmlsecurity/source/xmlsec/xmlstreamio \
76 ifeq ($(ENABLE_GPGMEPP),TRUE)
77 $(eval $(call gb_Library_add_exception_objects,xsec_xmlsec,\
78 xmlsecurity/source/gpg/CertificateImpl \
79 xmlsecurity/source/gpg/CipherContext \
80 xmlsecurity/source/gpg/DigestContext \
81 xmlsecurity/source/gpg/SecurityEnvironment \
82 xmlsecurity/source/gpg/SEInitializer \
83 xmlsecurity/source/gpg/XMLEncryption \
84 xmlsecurity/source/gpg/XMLSecurityContext \
85 xmlsecurity/source/gpg/xmlsignature_gpgimpl \
87 endif
89 ifeq ($(OS),WNT)
91 $(eval $(call gb_Library_add_defs,xsec_xmlsec,\
92 -DXMLSEC_CRYPTO_MSCRYPTO \
95 $(eval $(call gb_Library_add_libs,xsec_xmlsec,\
96 $(call gb_UnpackedTarball_get_dir,xmlsec)/win32/binaries/libxmlsec-mscng.lib \
97 $(call gb_UnpackedTarball_get_dir,xmlsec)/win32/binaries/libxmlsec.lib \
100 $(eval $(call gb_Library_use_system_win32_libs,xsec_xmlsec,\
101 crypt32 \
102 advapi32 \
103 ncrypt \
106 $(eval $(call gb_Library_add_exception_objects,xsec_xmlsec,\
107 xmlsecurity/source/xmlsec/mscrypt/akmngr \
108 xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl \
109 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl \
110 xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl \
111 xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl \
112 xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl \
113 xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl \
116 ifeq ($(ENABLE_NSS),TRUE)
118 $(eval $(call gb_Library_add_exception_objects,xsec_xmlsec,\
119 xmlsecurity/source/xmlsec/nss/ciphercontext \
120 xmlsecurity/source/xmlsec/nss/digestcontext \
121 xmlsecurity/source/xmlsec/nss/nssinitializer \
124 # nss3 after static libs to appease --as-needed linkers
125 $(eval $(call gb_Library_use_externals,xsec_xmlsec,\
126 nss3 \
129 endif
131 else # !$(OS),WNT
133 ifeq ($(SYSTEM_XMLSEC),)
134 $(eval $(call gb_Library_add_libs,xsec_xmlsec,\
135 $(call gb_UnpackedTarball_get_dir,xmlsec)/src/.libs/libxmlsec1.a \
137 endif
139 ifeq ($(ENABLE_NSS),TRUE)
141 ifeq ($(SYSTEM_XMLSEC),)
142 $(eval $(call gb_Library_add_libs,xsec_xmlsec,\
143 $(call gb_UnpackedTarball_get_dir,xmlsec)/src/nss/.libs/libxmlsec1-nss.a \
145 endif
147 $(eval $(call gb_Library_add_exception_objects,xsec_xmlsec,\
148 xmlsecurity/source/xmlsec/nss/ciphercontext \
149 xmlsecurity/source/xmlsec/nss/digestcontext \
150 xmlsecurity/source/xmlsec/nss/nssinitializer \
151 xmlsecurity/source/xmlsec/nss/sanextension_nssimpl \
152 xmlsecurity/source/xmlsec/nss/secerror \
153 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl \
154 xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl \
155 xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl \
156 xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl \
157 xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl \
160 $(eval $(call gb_Library_add_defs,xsec_xmlsec,\
161 -DXMLSEC_CRYPTO_NSS \
164 $(eval $(call gb_Library_use_externals,xsec_xmlsec,\
165 plc4 \
167 # nss3 after static libs to appease --as-needed linkers
168 $(eval $(call gb_Library_use_externals,xsec_xmlsec,\
169 nss3 \
172 else # ! $(ENABLE_NSS)
174 ifeq ($(ENABLE_OPENSSL),TRUE)
175 $(eval $(call gb_Library_use_external,xsec_xmlsec,openssl))
176 endif
178 endif # !$(ENABLE_NSS)
180 ifeq ($(OS),SOLARIS)
181 $(eval $(call gb_Library_add_libs,xsec_xmlsec,\
182 -ldl \
184 endif
186 endif # !$(OS),WNT
188 # vim: set noet sw=4 ts=4: