Fix --disable-curl build

Change-Id: I3020d41eb6d0988cc886495a88a073a23bc8161c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156910
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski 2023-09-14 11:03:48 +03:00
parent 1d4cd39262
commit 5bf7c2fa57
8 changed files with 54 additions and 11 deletions

View file

@ -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.
*/

View file

@ -10802,6 +10802,13 @@ AC_SUBST(SYSTEM_GENCMN)
AC_SUBST(ICU_MAJOR)
AC_SUBST(ICU_MINOR)
dnl ==================================================================
dnl CURL
dnl ==================================================================
if test "$enable_curl" == "yes"; then
AC_DEFINE([HAVE_FEATURE_CURL])
fi
dnl ==================================================================
dnl Breakpad
dnl ==================================================================
@ -10810,6 +10817,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)
@ -10838,6 +10848,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 ===================================================================
@ -11000,7 +11019,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
;;

View file

@ -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 )\

View file

@ -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) \

View file

@ -912,7 +912,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
return SwTranslateLangSelectDlg::GetSelectedLanguage();
#else
return {};
@ -980,7 +980,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;

View file

@ -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;
@ -34,8 +40,10 @@ struct SW_DLLPUBLIC TranslateAPIConfig final
};
SW_DLLPUBLIC OString ExportPaMToHTML(SwPaM* pCursor);
SW_DLLPUBLIC void PasteHTMLToPaM(SwWrtShell& rWrtSh, SwPaM* pCursor, const OString& rData);
#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
}

View file

@ -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>
@ -107,12 +111,12 @@
#include <comphelper/scopeguard.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 <officecfg/Office/Linguistic.hxx>
#include <svl/visitem.hxx>
#include <translatelangselect.hxx>
#endif // ENABLE_WASM_STRIP_EXTRA
#endif // HAVE_FEATURE_CURL && ENABLE_WASM_STRIP_EXTRA
#include <translatehelper.hxx>
#include <IDocumentContentOperations.hxx>
#include <IDocumentUndoRedo.hxx>
@ -1977,7 +1981,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))
{
@ -2001,7 +2005,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:
@ -2521,7 +2525,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())
{

View file

@ -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>
@ -90,7 +94,7 @@ void PasteHTMLToPaM(SwWrtShell& rWrtSh, SwPaM* pCursor, const OString& rData)
}
}
#if !ENABLE_WASM_STRIP_EXTRA
#if HAVE_FEATURE_CURL && !ENABLE_WASM_STRIP_EXTRA
void TranslateDocument(SwWrtShell& rWrtSh, const TranslateAPIConfig& rConfig)
{
bool bCancel = false;
@ -208,5 +212,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
}