[PATCH] build: new --disable-openssl flag

Andres Gomez (via Code Review) gerrit at gerrit.libreoffice.org
Thu Apr 11 05:15:40 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3328

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/28/3328/1

build: new --disable-openssl flag

Most of the components included in LibreOffice
already support alternative TLS libraries (e.g.
NSS, GnuTLS).

Change-Id: If00c348046fdbc88156f3d89c25e874e7e9bd04c
---
M config_host.mk.in
M configure.ac
2 files changed, 46 insertions(+), 15 deletions(-)



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_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 470ec8d..9c1f2e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1169,6 +1169,13 @@
         [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 ===================================================================
@@ -8099,6 +8106,10 @@
         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"
@@ -8115,8 +8126,13 @@
         ;;
     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)
@@ -8515,21 +8531,35 @@
 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])
+    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
-if test "$with_system_openssl" = "yes"; then
-    libo_MINGW_CHECK_DLL([libssl])
-    libo_MINGW_CHECK_DLL([libcrypto])
-fi
+
+AC_SUBST([DISABLE_OPENSSL])
 
 dnl ===================================================================
 dnl Check for system redland

-- 
To view, visit https://gerrit.libreoffice.org/3328
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If00c348046fdbc88156f3d89c25e874e7e9bd04c
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Andres Gomez <agomez at igalia.com>



More information about the LibreOffice mailing list