config_host/config_features.h.in | 5 +++++ configure.ac | 21 ++++++++++++++++++++- desktop/Library_sofficeapp.mk | 3 ++- lingucomponent/Module_lingucomponent.mk | 2 ++ sw/source/ui/dialog/swdlgfact.cxx | 4 ++-- sw/source/uibase/inc/translatehelper.hxx | 8 ++++++++ sw/source/uibase/shells/textsh1.cxx | 14 +++++++++----- sw/source/uibase/shells/translatehelper.cxx | 8 ++++++-- 8 files changed, 54 insertions(+), 11 deletions(-)
New commits: commit be0a7d03f40fdcb48c2cd2f4b3141a3bdfab2de4 Author: Mike Kaganski <[email protected]> AuthorDate: Thu Sep 14 11:03:48 2023 +0300 Commit: Mike Kaganski <[email protected]> CommitDate: Thu Sep 14 14:09:07 2023 +0300 Fix --disable-curl build Change-Id: I3020d41eb6d0988cc886495a88a073a23bc8161c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156910 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in index 867258e262db..0faa67c64dbd 100644 --- a/config_host/config_features.h.in +++ b/config_host/config_features.h.in @@ -76,6 +76,11 @@ #define HAVE_FEATURE_READONLY_INSTALLSET 0 +/* + * Whether curl is available + */ +#define HAVE_FEATURE_CURL 0 + /* * Whether we support breakpad as crash reporting lib. */ diff --git a/configure.ac b/configure.ac index b7341117657a..34e1b7b01ae4 100644 --- a/configure.ac +++ b/configure.ac @@ -10791,6 +10791,13 @@ AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER) AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER) AC_SUBST(ICU_UCHAR_TYPE) +dnl ================================================================== +dnl CURL +dnl ================================================================== +if test "$enable_curl" == "yes"; then + AC_DEFINE([HAVE_FEATURE_CURL]) +fi + dnl ================================================================== dnl Breakpad dnl ================================================================== @@ -10799,6 +10806,9 @@ AC_MSG_CHECKING([whether to enable breakpad]) if test "$enable_breakpad" != yes; then AC_MSG_RESULT([no]) else + if test "$enable_curl" != "yes"; then + AC_MSG_ERROR([--disable-breakpad must be used when --disable-curl is used]) + fi AC_MSG_RESULT([yes]) ENABLE_BREAKPAD="TRUE" AC_DEFINE(ENABLE_BREAKPAD) @@ -10827,6 +10837,15 @@ fi AC_SUBST(ENABLE_BREAKPAD) AC_SUBST(DEFAULT_CRASHDUMP_VALUE) +dnl ================================================================== +dnl libcmis +dnl ================================================================== +if test "$enable_libcmis" == "yes"; then + if test "$enable_curl" != "yes"; then + AC_MSG_ERROR([--disable-libcmis must be used when --disable-curl is used]) + fi +fi + dnl =================================================================== dnl Orcus dnl =================================================================== @@ -10981,7 +11000,7 @@ no) AC_MSG_RESULT([yes]) # curl is already mandatory (almost) and checked elsewhere if test "$enable_curl" = "no"; then - AC_MSG_ERROR(["--with-webdav conflicts with --disable-curl"]) + AC_MSG_ERROR(["--without-webdav must be used when --disable-curl is used"]) fi WITH_WEBDAV=TRUE ;; diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk index c315a113ca89..09dacb397c93 100644 --- a/desktop/Library_sofficeapp.mk +++ b/desktop/Library_sofficeapp.mk @@ -24,9 +24,10 @@ $(eval $(call gb_Library_use_externals,sofficeapp, \ icu_headers \ icui18n \ icuuc \ + $(if $(ENABLE_CURL), \ $(if $(filter-out EMSCRIPTEN iOS,$(OS)), \ curl \ - )\ + ))\ $(if $(ENABLE_ONLINE_UPDATE_MAR),\ orcus-parser \ orcus )\ diff --git a/lingucomponent/Module_lingucomponent.mk b/lingucomponent/Module_lingucomponent.mk index 87e1b1f4d585..ea31defcf5f6 100644 --- a/lingucomponent/Module_lingucomponent.mk +++ b/lingucomponent/Module_lingucomponent.mk @@ -25,11 +25,13 @@ $(eval $(call gb_Module_add_targets,lingucomponent,\ )) endif +ifeq ($(ENABLE_CURL),TRUE) ifneq ($(ENABLE_WASM_STRIP_LANGUAGETOOL),TRUE) $(eval $(call gb_Module_add_targets,lingucomponent,\ Library_LanguageTool \ )) endif +endif $(eval $(call gb_Module_add_targets,lingucomponent,\ $(if $(filter iOS MACOSX,$(OS)),Library_MacOSXSpell) \ diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 671f0c1c753a..40fd1d8f0f79 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -830,7 +830,7 @@ sal_uInt16 AbstractMailMergeWizard_Impl::GetRestartPage() const std::optional<SwLanguageListItem> AbstractSwTranslateLangSelectDlg_Impl::GetSelectedLanguage() { -#if !ENABLE_WASM_STRIP_EXTRA +#if HAVE_FEATURE_CURL && !ENABLE_WASM_STRIP_EXTRA SwTranslateLangSelectDlg* pDlg = dynamic_cast<SwTranslateLangSelectDlg*>(m_xDlg.get()); return pDlg->GetSelectedLanguage(); #else @@ -899,7 +899,7 @@ std::shared_ptr<AbstractSwBreakDlg> SwAbstractDialogFactory_Impl::CreateSwBreakD std::shared_ptr<AbstractSwTranslateLangSelectDlg> SwAbstractDialogFactory_Impl::CreateSwTranslateLangSelectDlg(weld::Window* pParent, SwWrtShell &rSh) { -#if !ENABLE_WASM_STRIP_EXTRA +#if HAVE_FEATURE_CURL && !ENABLE_WASM_STRIP_EXTRA return std::make_shared<AbstractSwTranslateLangSelectDlg_Impl>(std::make_unique<SwTranslateLangSelectDlg>(pParent, rSh)); #else (void) pParent; diff --git a/sw/source/uibase/inc/translatehelper.hxx b/sw/source/uibase/inc/translatehelper.hxx index 906b527647b6..69476ed75d80 100644 --- a/sw/source/uibase/inc/translatehelper.hxx +++ b/sw/source/uibase/inc/translatehelper.hxx @@ -17,6 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #pragma once + +#include <sal/config.h> + +#include <config_features.h> +#include <config_wasm_strip.h> + #include <swtypes.hxx> class SwWrtShell; @@ -35,8 +41,10 @@ struct SW_DLLPUBLIC TranslateAPIConfig final SW_DLLPUBLIC OString ExportPaMToHTML(SwPaM* pCursor, bool bReplacePTag); SW_DLLPUBLIC void PasteHTMLToPaM(SwWrtShell& rWrtSh, SwPaM* pCursor, const OString& rData, bool bSetSelection); +#if HAVE_FEATURE_CURL && !ENABLE_WASM_STRIP_EXTRA SW_DLLPUBLIC void TranslateDocument(SwWrtShell& rWrtSh, const TranslateAPIConfig& rConfig); SW_DLLPUBLIC void TranslateDocumentCancellable(SwWrtShell& rWrtSh, const TranslateAPIConfig& rConfig, bool& rCancelTranslation); +#endif } diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 832f6d7820c1..59ae1947198e 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <config_features.h> + #include <com/sun/star/i18n/WordType.hpp> #include <com/sun/star/linguistic2/XThesaurus.hpp> @@ -104,12 +108,12 @@ #include <linguistic/misc.hxx> #include <authfld.hxx> #include <config_wasm_strip.h> -#if !ENABLE_WASM_STRIP_EXTRA +#if HAVE_FEATURE_CURL && !ENABLE_WASM_STRIP_EXTRA #include <officecfg/Office/Common.hxx> #include <svl/visitem.hxx> #include <translatelangselect.hxx> #include <svtools/deeplcfg.hxx> -#endif // ENABLE_WASM_STRIP_EXTRA +#endif // HAVE_FEATURE_CURL && ENABLE_WASM_STRIP_EXTRA #include <translatehelper.hxx> #include <IDocumentContentOperations.hxx> @@ -1539,7 +1543,7 @@ void SwTextShell::Execute(SfxRequest &rReq) break; case SID_FM_TRANSLATE: { -#if !ENABLE_WASM_STRIP_EXTRA +#if HAVE_FEATURE_CURL && !ENABLE_WASM_STRIP_EXTRA const SfxPoolItem* pTargetLangStringItem = nullptr; if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_TARGETLANG_STR, false, &pTargetLangStringItem)) { @@ -1562,7 +1566,7 @@ void SwTextShell::Execute(SfxRequest &rReq) std::shared_ptr<weld::DialogController> pDialogController(pAbstractDialog->getDialogController()); weld::DialogController::runAsync(pDialogController, [] (sal_Int32 /*nResult*/) { }); } -#endif // ENABLE_WASM_STRIP_EXTRA +#endif // HAVE_FEATURE_CURL && ENABLE_WASM_STRIP_EXTRA } break; case SID_SPELLCHECK_IGNORE: @@ -2066,7 +2070,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) case SID_FM_TRANSLATE: { -#if !ENABLE_WASM_STRIP_EXTRA +#if HAVE_FEATURE_CURL && !ENABLE_WASM_STRIP_EXTRA if (!officecfg::Office::Common::Misc::ExperimentalMode::get() && !comphelper::LibreOfficeKit::isActive()) { diff --git a/sw/source/uibase/shells/translatehelper.cxx b/sw/source/uibase/shells/translatehelper.cxx index 8933d22db27f..d2a01043b813 100644 --- a/sw/source/uibase/shells/translatehelper.cxx +++ b/sw/source/uibase/shells/translatehelper.cxx @@ -16,6 +16,10 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + +#include <sal/config.h> + +#include <config_features.h> #include <config_wasm_strip.h> #include <wrtsh.hxx> #include <pam.hxx> @@ -89,7 +93,7 @@ void PasteHTMLToPaM(SwWrtShell& rWrtSh, SwPaM* pCursor, const OString& rData, bo } } -#if !ENABLE_WASM_STRIP_EXTRA +#if HAVE_FEATURE_CURL && !ENABLE_WASM_STRIP_EXTRA void TranslateDocument(SwWrtShell& rWrtSh, const TranslateAPIConfig& rConfig) { bool bCancel = false; @@ -207,5 +211,5 @@ void TranslateDocumentCancellable(SwWrtShell& rWrtSh, const TranslateAPIConfig& if (xStatusIndicator.is()) xStatusIndicator->end(); } -#endif // !ENABLE_WASM_STRIP_EXTRA +#endif // HAVE_FEATURE_CURL && !ENABLE_WASM_STRIP_EXTRA }
