[Libreoffice-commits] core.git: config_host.mk.in configure.ac external/neon external/postgresql external/python3 external/xmlsec RepositoryExternal.mk Repository.mk xmlsecurity/Module_xmlsecurity.mk xmlsecurity/source

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Wed May 5 19:15:25 UTC 2021


 Repository.mk                                     |    4 +--
 RepositoryExternal.mk                             |   12 +++++-----
 config_host.mk.in                                 |    2 -
 configure.ac                                      |    8 +++----
 external/neon/Library_neon.mk                     |    4 +--
 external/postgresql/ExternalProject_postgresql.mk |    4 +--
 external/python3/ExternalPackage_python3.mk       |    4 +--
 external/python3/ExternalProject_python3.mk       |    4 +--
 external/xmlsec/ExternalProject_xmlsec.mk         |   25 +++++++++++++++-------
 xmlsecurity/Module_xmlsecurity.mk                 |    8 -------
 xmlsecurity/source/xmlsec/xmlsec_init.cxx         |   12 +++++++---
 11 files changed, 48 insertions(+), 39 deletions(-)

New commits:
commit 013ddc4f5307df512767ca23b3922540b2b36d52
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Fri Apr 23 10:04:29 2021 +0200
Commit:     Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Wed May 5 21:14:30 2021 +0200

    Switch OPENSSL config var from negative to positive
    
    - align with most of the rest of config_host
    - rename DISABLE_OPENSSL to ENABLE_OPENSSL
    - make this configurable
    
    Change-Id: Ic3b41fcdda38db66134939f12265e0da24833d60
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114564
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/Repository.mk b/Repository.mk
index cafa89924a86..6af72d71058e 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -1127,7 +1127,7 @@ $(eval $(call gb_Helper_register_mos,\
 	vcl \
 	wiz \
 	wpt \
-	$(if $(ENABLE_NSS),xsc) \
+	$(if $(ENABLE_NSS)$(ENABLE_OPENSSL),xsc) \
 ))
 
 # UI configuration
@@ -1174,7 +1174,7 @@ $(eval $(call gb_Helper_register_uiconfigs,\
 	uui \
 	vcl \
 	writerperfect \
-	$(if $(ENABLE_NSS),xmlsec) \
+	$(if $(ENABLE_NSS)$(ENABLE_OPENSSL),xmlsec) \
 ))
 
 ifeq ($(gb_GBUILDSELFTEST),t)
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 12124f1fbbf7..224fd7526bec 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -1566,13 +1566,13 @@ endef
 
 endif # SYSTEM_HARFBUZZ
 
-ifeq ($(DISABLE_OPENSSL),TRUE)
+ifneq ($(ENABLE_OPENSSL),TRUE)
 
 gb_ExternalProject__use_openssl:=
 gb_LinkTarget__use_openssl_headers:=
 gb_LinkTarget__use_openssl:=
 
-else # !DISABLE_OPENSSL
+else # ENABLE_OPENSSL
 
 ifneq ($(SYSTEM_OPENSSL),)
 
@@ -1633,10 +1633,10 @@ endif
 endef
 
 endif # SYSTEM_OPENSSL
-endif # DISABLE_OPENSSL
+endif # ENABLE_OPENSSL
 
 
-ifeq ($(DISABLE_OPENSSL),TRUE)
+ifneq ($(ENABLE_OPENSSL),TRUE)
 
 define gb_LinkTarget__use_gnutls
 $(call gb_LinkTarget_set_include,$(1),\
@@ -1662,12 +1662,12 @@ $(call gb_LinkTarget_add_libs,$(1),$(LIBGCRYPT_LIBS))
 
 endef
 
-else # !DISABLE_OPENSSL
+else # ENABLE_OPENSSL
 
 gb_LinkTarget__use_gnutls:=
 gb_LinkTarget__use_libgcrypt:=
 
-endif # DISABLE_OPENSSL
+endif # ENABLE_OPENSSL
 
 
 ifneq ($(SYSTEM_CDR),)
diff --git a/config_host.mk.in b/config_host.mk.in
index f4be997dbfe0..b6012d793893 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -121,7 +121,6 @@ export DEFAULT_BRAND_IMAGES=@DEFAULT_BRAND_IMAGES@
 export DICT_SYSTEM_DIR=@DICT_SYSTEM_DIR@
 export DISABLE_CVE_TESTS=@DISABLE_CVE_TESTS@
 export DISABLE_DYNLOADING=@DISABLE_DYNLOADING@
-export DISABLE_OPENSSL=@DISABLE_OPENSSL@
 export DISABLE_PYTHON=@DISABLE_PYTHON@
 export DLOPEN_LIBS=@DLOPEN_LIBS@
 export DLLTOOL=@DLLTOOL@
@@ -177,6 +176,7 @@ export ENABLE_EXTENSION_UPDATE=@ENABLE_EXTENSION_UPDATE@
 export ENABLE_OOENV=@ENABLE_OOENV@
 export ENABLE_OPENGL_TRANSITIONS=@ENABLE_OPENGL_TRANSITIONS@
 export ENABLE_OPENGL_CANVAS=@ENABLE_OPENGL_CANVAS@
+export ENABLE_OPENSSL=@ENABLE_OPENSSL@
 export ENABLE_OPTIMIZED=@ENABLE_OPTIMIZED@
 export ENABLE_OPTIMIZED_DEBUG=@ENABLE_OPTIMIZED_DEBUG@
 export ENABLE_PCH=@ENABLE_PCH@
diff --git a/configure.ac b/configure.ac
index ae6fc04fb5d2..1b0521624ac2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10688,10 +10688,11 @@ fi
 dnl ===================================================================
 dnl Check for system openssl
 dnl ===================================================================
-DISABLE_OPENSSL=
+ENABLE_OPENSSL=
 AC_MSG_CHECKING([whether to disable OpenSSL usage])
 if test "$enable_openssl" = "yes"; then
     AC_MSG_RESULT([no])
+    ENABLE_OPENSSL=TRUE
     if test "$_os" = Darwin ; then
         # OpenSSL is deprecated when building for 10.7 or later.
         #
@@ -10719,16 +10720,15 @@ if test "$enable_openssl" = "yes"; then
     fi
 else
     AC_MSG_RESULT([yes])
-    DISABLE_OPENSSL=TRUE
 
     # warn that although OpenSSL is disabled, system libraries may depend on it
     AC_MSG_WARN([OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies])
     add_warning "OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies"
 fi
 
-AC_SUBST([DISABLE_OPENSSL])
+AC_SUBST([ENABLE_OPENSSL])
 
-if test "$enable_cipher_openssl_backend" = yes && test "$DISABLE_OPENSSL" = TRUE; then
+if test "$enable_cipher_openssl_backend" = yes && test "$ENABLE_OPENSSL" != TRUE; then
     if test "$libo_fuzzed_enable_cipher_openssl_backend" = yes; then
         AC_MSG_NOTICE([Resetting --enable-cipher-openssl-backend=no])
         enable_cipher_openssl_backend=no
diff --git a/external/neon/Library_neon.mk b/external/neon/Library_neon.mk
index 4c034a3178fb..4a0e069b39fa 100644
--- a/external/neon/Library_neon.mk
+++ b/external/neon/Library_neon.mk
@@ -49,7 +49,7 @@ $(eval $(call gb_Library_add_generated_cobjects,neon,\
 ))
 
 
-ifneq ($(DISABLE_OPENSSL),TRUE)
+ifeq ($(ENABLE_OPENSSL),TRUE)
 $(eval $(call gb_Library_add_generated_cobjects,neon,\
 	UnpackedTarball/neon/src/ne_openssl \
 ))
@@ -77,7 +77,7 @@ $(eval $(call gb_Library_add_generated_cobjects,neon,\
 ))
 
 else
-ifneq ($(DISABLE_OPENSSL),TRUE)
+ifeq ($(ENABLE_OPENSSL),TRUE)
 $(eval $(call gb_Library_add_generated_cobjects,neon,\
 	UnpackedTarball/neon/src/ne_ntlm \
 ))
diff --git a/external/postgresql/ExternalProject_postgresql.mk b/external/postgresql/ExternalProject_postgresql.mk
index c0713161878f..ea822ebe3208 100644
--- a/external/postgresql/ExternalProject_postgresql.mk
+++ b/external/postgresql/ExternalProject_postgresql.mk
@@ -41,7 +41,7 @@ ifeq ($(SYSTEM_ZLIB),)
 postgresql_LDFLAGS += $(ZLIB_LIBS)
 endif
 
-ifeq ($(DISABLE_OPENSSL),)
+ifeq ($(ENABLE_OPENSSL),TRUE)
 ifeq ($(SYSTEM_OPENSSL),)
 postgresql_CPPFLAGS += -I$(call gb_UnpackedTarball_get_dir,openssl)/include
 postgresql_LDFLAGS  += -L$(call gb_UnpackedTarball_get_dir,openssl)/ $(if $(filter $(OS),LINUX),-pthread)
@@ -70,7 +70,7 @@ $(call gb_ExternalProject_get_state_target,postgresql,build) :
 			--without-zlib \
 			--with-ldap \
 			$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
-			$(if $(DISABLE_OPENSSL),,--with-openssl \
+			$(if $(ENABLE_OPENSSL),--with-openssl \
 				$(if $(WITH_GSSAPI),--with-gssapi)) \
 				$(if $(ENABLE_LDAP),,--with-ldap=no) \
 			CFLAGS="-fPIC" \
diff --git a/external/python3/ExternalPackage_python3.mk b/external/python3/ExternalPackage_python3.mk
index a06d919e01ce..faddf06fc36a 100644
--- a/external/python3/ExternalPackage_python3.mk
+++ b/external/python3/ExternalPackage_python3.mk
@@ -79,7 +79,7 @@ $(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-cor
 	LO_lib/_elementtree.$(python3_EXTENSION_MODULE_SUFFIX).so \
 	LO_lib/fcntl.$(python3_EXTENSION_MODULE_SUFFIX).so \
 	LO_lib/grp.$(python3_EXTENSION_MODULE_SUFFIX).so \
-	$(if $(DISABLE_OPENSSL),, \
+	$(if $(ENABLE_OPENSSL), \
 		LO_lib/_hashlib.$(python3_EXTENSION_MODULE_SUFFIX).so \
 	) \
 	LO_lib/_heapq.$(python3_EXTENSION_MODULE_SUFFIX).so \
@@ -107,7 +107,7 @@ $(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-cor
 	LO_lib/_sha512.$(python3_EXTENSION_MODULE_SUFFIX).so \
 	LO_lib/_socket.$(python3_EXTENSION_MODULE_SUFFIX).so \
 	LO_lib/spwd.$(python3_EXTENSION_MODULE_SUFFIX).so \
-	$(if $(DISABLE_OPENSSL),, \
+	$(if $(ENABLE_OPENSSL), \
 		LO_lib/_ssl.$(python3_EXTENSION_MODULE_SUFFIX).so \
 	) \
 	LO_lib/_statistics.$(python3_EXTENSION_MODULE_SUFFIX).so \
diff --git a/external/python3/ExternalProject_python3.mk b/external/python3/ExternalProject_python3.mk
index 680da9352638..7ff7040e03bd 100644
--- a/external/python3/ExternalProject_python3.mk
+++ b/external/python3/ExternalProject_python3.mk
@@ -100,9 +100,9 @@ $(call gb_ExternalProject_get_state_target,python3,build) :
 			--enable-shared \
 			$(if $(filter 1090 101000 101100 101200,$(MAC_OS_X_VERSION_MIN_REQUIRED)),ac_cv_func_utimensat=no) \
 		) \
-		$(if $(SYSTEM_OPENSSL)$(DISABLE_OPENSSL),,\
+		$(if $(ENABLE_OPENSSL),$(if $(SYSTEM_OPENSSL),,\
 			--with-openssl=$(call gb_UnpackedTarball_get_dir,openssl) \
-		) \
+		) ) \
 		$(if $(filter LINUX,$(OS)), \
 			PKG_CONFIG_LIBDIR="$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)$${PKG_CONFIG_LIBDIR:+:$$PKG_CONFIG_LIBDIR}" \
 		) \
diff --git a/external/xmlsec/ExternalProject_xmlsec.mk b/external/xmlsec/ExternalProject_xmlsec.mk
index 8fb0ef56fa09..3db17c769c8c 100644
--- a/external/xmlsec/ExternalProject_xmlsec.mk
+++ b/external/xmlsec/ExternalProject_xmlsec.mk
@@ -9,9 +9,10 @@
 
 $(eval $(call gb_ExternalProject_ExternalProject,xmlsec))
 
-$(eval $(call gb_ExternalProject_use_external,xmlsec,libxml2))
-
-$(eval $(call gb_ExternalProject_use_external,xmlsec,nss3))
+$(eval $(call gb_ExternalProject_use_externals,xmlsec,\
+    libxml2 \
+    $(if $(ENABLE_NSS),nss3,$(if $(ENABLE_OPENSSL),openssl)) \
+))
 
 $(eval $(call gb_ExternalProject_register_targets,xmlsec,\
 	build \
@@ -44,11 +45,21 @@ $(call gb_ExternalProject_get_state_target,xmlsec,build) :
 			--with-pic --disable-shared --disable-crypto-dl --without-libxslt --without-gnutls --without-gcrypt --disable-apps --disable-docs \
 			$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
 			CFLAGS="$(CFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS)) $(gb_VISIBILITY_FLAGS)" \
-			--without-openssl \
 			$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
-			$(if $(SYSTEM_NSS),,$(if $(filter MACOSX,$(OS_FOR_BUILD)),--disable-pkgconfig)) \
-			$(if $(SYSTEM_NSS),,NSPR_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include" NSPR_LIBS="-L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib -lnspr4") \
-			$(if $(SYSTEM_NSS),,NSS_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss" NSS_LIBS="-L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib -lsmime3 -lnss3 -lnssutil3") \
+			$(if $(ENABLE_NSS), \
+				--without-openssl \
+				$(if $(SYSTEM_NSS),, \
+					$(if $(filter MACOSX,$(OS_FOR_BUILD)),--disable-pkgconfig) \
+					NSPR_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include" NSPR_LIBS="-L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib -lnspr4" \
+					NSS_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss" NSS_LIBS="-L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib -lsmime3 -lnss3 -lnssutil3" \
+			), \
+				$(if $(ENABLE_OPENSSL), \
+					$(if $(SYSTEM_OPENSSL),, \
+						OPENSSL_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,openssl)/include" \
+						OPENSSL_LIBS="-L$(call gb_UnpackedTarball_get_dir,openssl) -lcrypto -lssl" \
+					), \
+					--without-openssl) \
+			) \
 			$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
 			$(if $(SYSBASE),CFLAGS="-I$(SYSBASE)/usr/include" \
 			LDFLAGS="-L$(SYSBASE)/usr/lib $(if $(filter-out LINUX FREEBSD,$(OS)),",-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN)) \
diff --git a/xmlsecurity/Module_xmlsecurity.mk b/xmlsecurity/Module_xmlsecurity.mk
index 81e74ecf21d3..2a6db1c4f74e 100644
--- a/xmlsecurity/Module_xmlsecurity.mk
+++ b/xmlsecurity/Module_xmlsecurity.mk
@@ -9,11 +9,9 @@
 
 $(eval $(call gb_Module_Module,xmlsecurity))
 
-ifeq ($(ENABLE_NSS),TRUE)
-
 $(eval $(call gb_Module_add_targets,xmlsecurity,\
 	Library_xmlsecurity \
-	Library_xsec_xmlsec \
+	$(if $(ENABLE_NSS)$(ENABLE_OPENSSL),Library_xsec_xmlsec) \
 	UIConfig_xmlsec \
 ))
 
@@ -40,13 +38,9 @@ $(eval $(call gb_Module_add_screenshot_targets,xmlsecurity,\
 ))
 
 ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
-
 $(eval $(call gb_Module_add_targets,xmlsecurity,\
     Executable_pdfverify \
 ))
-
-endif
-
 endif
 
 # vim: set noet sw=4 ts=4:
diff --git a/xmlsecurity/source/xmlsec/xmlsec_init.cxx b/xmlsecurity/source/xmlsec/xmlsec_init.cxx
index 7e8c58ddeec3..410408ed2ebe 100644
--- a/xmlsecurity/source/xmlsec/xmlsec_init.cxx
+++ b/xmlsecurity/source/xmlsec/xmlsec_init.cxx
@@ -17,7 +17,8 @@
 #include <xmlsec/xmlstreamio.hxx>
 #ifdef XMLSEC_CRYPTO_MSCRYPTO
 #include <xmlsec/mscng/crypto.h>
-#else
+#endif
+#ifdef XMLSEC_CRYPTO_NSS
 #include <xmlsec/nss/crypto.h>
 #endif
 
@@ -36,7 +37,8 @@ XSECXMLSEC_DLLPUBLIC void initXmlSec()
         xmlSecShutdown();
         throw RuntimeException();
     }
-#else
+#endif
+#ifdef XMLSEC_CRYPTO_NSS
     if( xmlSecNssInit() < 0 ) {
         xmlSecShutdown();
         throw RuntimeException();
@@ -47,7 +49,8 @@ XSECXMLSEC_DLLPUBLIC void initXmlSec()
     if( xmlEnableStreamInputCallbacks() < 0 ) {
 #ifdef XMLSEC_CRYPTO_MSCRYPTO
         xmlSecMSCngShutdown();
-#else
+#endif
+#ifdef XMLSEC_CRYPTO_NSS
         xmlSecNssShutdown();
 #endif
         xmlSecShutdown() ;
@@ -60,7 +63,8 @@ XSECXMLSEC_DLLPUBLIC void deInitXmlSec()
     xmlDisableStreamInputCallbacks();
 #ifdef XMLSEC_CRYPTO_MSCRYPTO
     xmlSecMSCngShutdown();
-#else
+#endif
+#ifdef XMLSEC_CRYPTO_NSS
     xmlSecNssShutdown();
 #endif
     xmlSecShutdown();


More information about the Libreoffice-commits mailing list