RepositoryExternal.mk | 9 +++++++ config_host.mk.in | 1 configure.ac | 60 +++++++++++++++++++++++++++++++++++++------------- 3 files changed, 55 insertions(+), 15 deletions(-)
New commits: commit e3f607e766cea9a867c7ebff8bd568536ff67da1 Author: Andres Gomez <[email protected]> Date: Thu Apr 11 10:24:25 2013 +0300 build: new --disable-openssl flag Most of the components included in LibreOffice already support alternative TLS libraries (e.g. NSS, GnuTLS). Change-Id: If00c348046fdbc88156f3d89c25e874e7e9bd04c Reviewed-on: https://gerrit.libreoffice.org/3328 Reviewed-by: David Tardon <[email protected]> Tested-by: David Tardon <[email protected]> diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 1dcb377..d1fd649 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -1187,6 +1187,14 @@ endef endif # SYSTEM_ICU +ifeq ($(DISABLE_OPENSSL),YES) + +gb_ExternalProject__use_openssl:= +gb_LinkTarget__use_openssl_headers:= +gb_LinkTarget__use_openssl:= + +else # !DISABLE_OPENSSL + ifeq ($(SYSTEM_OPENSSL),YES) gb_LinkTarget__use_openssl_headers:= @@ -1251,6 +1259,7 @@ endif endef endif # SYSTEM_OPENSSL +endif # DISABLE_OPENSSL ifeq ($(SYSTEM_CDR),YES) diff --git a/config_host.mk.in b/config_host.mk.in index ec1542a..d794d16 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -98,6 +98,7 @@ export DISABLE_DYNLOADING=@DISABLE_DYNLOADING@ export DISABLE_EXPORT=@DISABLE_EXPORT@ export DISABLE_LINKOO=@DISABLE_LINKOO@ export DISABLE_NEON=@DISABLE_NEON@ +export DISABLE_OPENSSL=@DISABLE_OPENSSL@ export DISABLE_PYTHON=@DISABLE_PYTHON@ export DISABLE_SCRIPTING=@DISABLE_SCRIPTING@ export DLLTOOL=@DLLTOOL@ diff --git a/configure.ac b/configure.ac index 494de05..7c5169e 100644 --- a/configure.ac +++ b/configure.ac @@ -1170,6 +1170,13 @@ AC_ARG_ENABLE(bogus-pkg-config, [MACOSX only: on MacOSX pkg-config can cause trouble. by default if one is found in the PATH, an error is issued. This flag turn that error into a warning.]), ) +AC_ARG_ENABLE(openssl, + AS_HELP_STRING([--disable-openssl], + [Disable using libssl/libcrypto from OpenSSL. If disabled, + components will either use GNUTLS or NSS. Work in progress, + use only if you are hacking on it.]), +,enable_openssl=yes) + dnl =================================================================== dnl Optional Packages (--with/without-) dnl =================================================================== @@ -8110,6 +8117,10 @@ if test -n "$with_tls"; then AC_DEFINE(USE_TLS_OPENSSL) TLS=OPENSSL + if test "$enable_openssl" != "yes"; then + AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."]) + fi + # warn that OpenSSL has been selected but not all TLS code has this option AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still be depending on NSS or GNUTLS]) add_warning "TLS/SSL implementation to use is OpenSSL but some code may still be depending on NSS or GNUTLS" @@ -8126,8 +8137,13 @@ nss - Mozilla's Network Security Services (NSS) ;; esac else - AC_DEFINE(USE_TLS_OPENSSL) - TLS=OPENSSL + if test "$enable_openssl" = "yes"; then + AC_DEFINE(USE_TLS_OPENSSL) + TLS=OPENSSL + else + AC_DEFINE(USE_TLS_NSS) + TLS=NSS + fi fi AC_MSG_RESULT([$TLS]) AC_SUBST(TLS) @@ -8526,22 +8542,36 @@ fi dnl =================================================================== dnl Check for system openssl dnl =================================================================== -if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \ - "$_os" = "DragonFly" && test "$with_system_openssl" != "no"; then - # Mac OS builds should get out without extra stuff is the Mac porters' - # wish. And pkg-config is although Xcode ships a .pc for openssl - with_system_openssl=yes - SYSTEM_OPENSSL=YES - OPENSSL_CFLAGS= - OPENSSL_LIBS="-lssl -lcrypto" +DISABLE_OPENSSL="NO" +AC_MSG_CHECKING([whether to disable OpenSSL usage]) +if test "$enable_openssl" = "yes"; then + AC_MSG_RESULT([no]) + if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \ + "$_os" = "DragonFly" && test "$with_system_openssl" != "no"; then + # Mac OS builds should get out without extra stuff is the Mac porters' + # wish. And pkg-config is although Xcode ships a .pc for openssl + with_system_openssl=yes + SYSTEM_OPENSSL=YES + OPENSSL_CFLAGS= + OPENSSL_LIBS="-lssl -lcrypto" + else + libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl]) + fi + if test "$with_system_openssl" = "yes"; then + libo_MINGW_CHECK_DLL([SSL], [libssl]) + libo_MINGW_CHECK_DLL([CRYPTO], [libcrypto]) + fi else - libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl]) -fi -if test "$with_system_openssl" = "yes"; then - libo_MINGW_CHECK_DLL([libssl]) - libo_MINGW_CHECK_DLL([libcrypto]) + AC_MSG_RESULT([yes]) + DISABLE_OPENSSL=YES + + # warn that although OpenSSL is disabled, system libraries may be depending on it + AC_MSG_WARN([OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies]) + add_warning "OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies" fi +AC_SUBST([DISABLE_OPENSSL]) + dnl =================================================================== dnl Check for system redland dnl =================================================================== _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
