WASM more initial bits and pieces

All the small stuff, which is needed for the WASM build, but is
not really worth an extra patch.

* No soffice.sh script needed for WASM
* WASM soffice.bin executable extension is html
* Some small additional SAL_LOG output
* Default to colibre icon theme
* Test for qt5 even without X11
* Remove emconfigure artefacts at the end of the configure run
* No oosplash for WASM
* Disable the Office IPC thread
* Suppress -Wno-enum-conversion for Cairo builds
* Fix libnumbertext by using gb_EMSCRIPTEN_CPPFLAGS
* Map EMSCRIPTEN to LINUX nls
* No extra newlines for missing icon theme images
* Print the missing dependency in some gbuild error messages
* Copy Qt WASM loader, HTML template and SVG logo for binaries
* Especially build the vcldemo for Emscripten

Change-Id: I356370c72cc09357411e14d0c00762152877a800
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128584
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
This commit is contained in:
Jan-Marek Glogowski 2021-05-21 15:41:15 +02:00
parent 9ae9b3b47c
commit 599cbdb9c2
14 changed files with 36 additions and 13 deletions

View file

@ -1054,7 +1054,7 @@ $(eval $(call gb_Helper_register_packages_for_install,brand,\
desktop_branding \
$(if $(CUSTOM_BRAND_DIR),desktop_branding_custom) \
$(if $(filter DESKTOP,$(BUILD_TYPE)),desktop_scripts_install) \
$(if $(and $(filter-out MACOSX HAIKU WNT,$(OS)),$(filter DESKTOP,$(BUILD_TYPE))),\
$(if $(and $(filter-out EMSCRIPTEN HAIKU MACOSX WNT,$(OS)),$(filter DESKTOP,$(BUILD_TYPE))),\
$(if $(DISABLE_GUI),, \
desktop_soffice_sh \
) \

View file

@ -34,8 +34,12 @@ endif
ifeq ($(OS),MACOSX)
gb_Executable_FILENAMES := $(patsubst soffice_bin:soffice_bin,soffice_bin:soffice,$(gb_Executable_FILENAMES))
else
ifeq ($(OS),EMSCRIPTEN)
gb_Executable_FILENAMES := $(patsubst soffice_bin:soffice_bin%,soffice_bin:soffice.html,$(gb_Executable_FILENAMES))
else
gb_Executable_FILENAMES := $(patsubst soffice_bin:soffice_bin%,soffice_bin:soffice.bin,$(gb_Executable_FILENAMES))
endif
endif
gb_Executable_FILENAMES := $(patsubst soffice_exe:soffice_exe%,soffice_exe:soffice.exe,$(gb_Executable_FILENAMES))
gb_Executable_FILENAMES := $(patsubst soffice_com:soffice_com%,soffice_com:soffice.com,$(gb_Executable_FILENAMES))

View file

@ -65,7 +65,9 @@ uno::Reference< lang::XComponent > SynchronousDispatch::dispatch(
}
catch ( uno::Exception& )
{
SAL_WARN("comphelper","SynchronousDispatch::dispatch() Error while dispatching!");
// can't use TOOLS_WARN_EXCEPTION, as comphelper is used by libtk!
SAL_WARN("comphelper", "SynchronousDispatch::dispatch(): error while dispatching '"
<< sURL << "' for '" << sTarget << "'!");
}
}

View file

@ -1121,7 +1121,7 @@ emscripten)
enable_scripting=no
enable_xmlhelp=no
with_system_zlib=no
with_theme="breeze"
with_theme="colibre"
_os=Emscripten
;;
@ -5234,6 +5234,9 @@ if test "$using_x11" = yes; then
AC_DEFINE(USING_X11)
else
disable_x11_tests
if test "$DISABLE_DYNLOADING" = TRUE; then
test_qt5=yes
fi
fi
else
if test "$USING_X11" = TRUE; then
@ -14645,4 +14648,7 @@ if test -s "$WARNINGS_FILE"; then
cat "$WARNINGS_FILE"
fi
# Remove unneeded emconfigure artifacts
rm -f a.out a.wasm a.out.js a.out.wasm
dnl vim:set shiftwidth=4 softtabstop=4 expandtab:

View file

@ -95,7 +95,7 @@ $(eval $(call gb_Module_add_targets,desktop,\
WinResTarget_swriter \
))
else ifeq (,$(filter MACOSX ANDROID iOS HAIKU,$(OS)))
else ifeq (,$(filter MACOSX ANDROID iOS HAIKU EMSCRIPTEN,$(OS)))
ifeq (,$(filter FUZZERS,$(BUILD_TYPE)))
$(eval $(call gb_Module_add_targets,desktop,\

View file

@ -697,7 +697,7 @@ RequestHandler::Status RequestHandler::Enable(bool ipc)
if( pGlobal.is() )
return IPC_STATUS_OK;
#if !HAVE_FEATURE_DESKTOP || HAVE_FEATURE_MACOSX_SANDBOX
#if !HAVE_FEATURE_DESKTOP || HAVE_FEATURE_MACOSX_SANDBOX || defined(EMSCRIPTEN)
ipc = false;
#endif

View file

@ -48,7 +48,7 @@ $(call gb_ExternalProject_get_state_target,cairo,build) :
$(gb_RUN_CONFIGURE) ./configure \
$(if $(debug),STRIP=" ") \
$(if $(filter ANDROID iOS,$(OS)),CFLAGS="$(if $(debug),-g) $(ZLIB_CFLAGS) $(gb_VISIBILITY_FLAGS)") \
$(if $(filter EMSCRIPTEN,$(OS)),CFLAGS=" $(ZLIB_CFLAGS)" --enable-pthread=yes PTHREAD_LIBS="") \
$(if $(filter EMSCRIPTEN,$(OS)),CFLAGS=" $(ZLIB_CFLAGS) -Wno-enum-conversion" --enable-pthread=yes PTHREAD_LIBS="") \
$(if $(filter-out EMSCRIPTEN ANDROID iOS,$(OS)),CFLAGS="$(CFLAGS) $(if $(debug),-g) $(ZLIB_CFLAGS)" ) \
$(if $(filter ANDROID iOS,$(OS)),PKG_CONFIG=./dummy_pkg_config) \
LIBS="$(ZLIB_LIBS)" \

View file

@ -16,7 +16,7 @@ $(eval $(call gb_ExternalProject_register_targets,libnumbertext,\
build \
))
libnumbertext_CXXFLAGS=$(CXXFLAGS) $(CXXFLAGS_CXX11)
libnumbertext_CXXFLAGS=$(CXXFLAGS) $(CXXFLAGS_CXX11) $(gb_EMSCRIPTEN_CPPFLAGS)
libnumbertext_CPPFLAGS+=$(gb_COMPILERDEFS_STDLIB_DEBUG)

View file

@ -32,7 +32,7 @@
#include "nlsupport.hxx"
// these share a lot, so use one define
#if defined(LINUX) || defined(__sun) || \
#if defined(LINUX) || defined(EMSCRIPTEN) || defined(__sun) || \
defined(FREEBSD) || defined(OPENBSD) || defined(DRAGONFLY) || defined(NETBSD)
#define LO_COMMON_NLS_ARCHS 1
#else
@ -284,7 +284,7 @@ static const Pair nl_language_list[] = {
/* XXX MS-874 is an extension to tis620, so this is not
* really equivalent */
#elif defined(LINUX)
#elif defined(LINUX) || defined(EMSCRIPTEN)
#if !defined(CODESET)
#define CODESET _NL_CTYPE_CODESET_NAME

View file

@ -30,7 +30,7 @@ def read_icons(fname):
full_path = os.path.join(args.base_path, fname)
if not os.path.exists(full_path):
if not args.quiet:
print("Skipping non-existent {}\n".format(full_path), file=sys.stderr)
print("Skipping non-existent {}".format(full_path), file=sys.stderr)
return images
with open(full_path) as fp:
for line in fp:

View file

@ -56,11 +56,16 @@ gb_LinkTarget__get_debugflags= \
$(if $(ENABLE_OPTIMIZED_DEBUG),$(gb_COMPILERDEBUGOPTFLAGS),$(gb_COMPILERNOOPTFLAGS))) \
$(if $(call gb_LinkTarget__symbols_enabled,$(1)),$(gb_DEBUGINFO_FLAGS))
# T_LDFLAGS is just expanded once. Override the flags here, so that the linker and compiler use the same.
ifeq (EMSCRIPTEN,$(OS))
gb_LinkTarget__get_debugldflags=$(call gb_LinkTarget__get_debugflags,$1)
else
# similar for LDFLAGS, use linker optimization flags in non-debug case,
# but moreover strip debug from libraries for which debuginfo is not wanted
# (some libraries reuse .o files from other libraries, notably unittests)
gb_LinkTarget__get_stripldflags=$(if $(strip $(CFLAGS)$(CXXFLAGS)$(OBJCFLAGS)$(OBJCXXFLAGS)$(LDFLAGS)),,$(gb_LINKERSTRIPDEBUGFLAGS))
gb_LinkTarget__get_debugldflags=$(if $(call gb_LinkTarget__symbols_enabled,$(1)),$(gb_LINKER_DEBUGINFO_FLAGS),$(gb_LINKEROPTFLAGS) $(call gb_LinkTarget__get_stripldflags,$(1)))
endif
# generic cflags/cxxflags to use (optimization flags, debug flags)
# user supplied CFLAGS/CXXFLAGS override default debug/optimization flags
@ -1925,7 +1930,7 @@ $(2) : $(call gb_LinkTarget_get_target,$(1))
touch -r $$< $$@; \
else \
rm -f $$<; \
echo "ERROR: aux-target missing, library deleted, please try running make again"; \
echo "ERROR: aux-target $$@ missing, library deleted, please try running make again"; \
false; \
fi
@ -2096,6 +2101,7 @@ endef
define gb_LinkTarget_use_package
$(call gb_LinkTarget_get_headers_target,$(1)) :| \
$(call gb_Package_get_target,$(strip $(2)))
$(call gb_Package_get_target,$(strip $(2))): RDEPENDS += $(call gb_LinkTarget__get_workdir_linktargetname,$(1))
endef

View file

@ -80,7 +80,7 @@ $(call gb_Package_get_preparation_target,%) :
$(call gb_Package_get_target,%) :
$(call gb_Output_announce,$*,$(true),PKG,2)
$(call gb_Trace_StartRange,$*,PKG)
$(if $(PACKAGE_DEFINED),,$(call gb_Output_error,Something depends on package $* which does not exist.))
$(if $(PACKAGE_DEFINED),,$(call gb_Output_error,$(RDEPENDS) depend(s) on package $* which does not exist.))
rm -f $@ && \
mv $(call gb_var2file,$@.tmp,100,$(sort $(FILES))) $@
$(call gb_Trace_EndRange,$*,PKG)

View file

@ -172,6 +172,9 @@ $(if $(filter Library,$(TARGETTYPE)), $(call gb_Helper_abbreviate_dirs,\
| cut -d' ' -f1-2 >> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
$(call gb_Helper_replace_if_different_and_touch,$(WORKDIR)/LinkTarget/$(2).exports.tmp, \
$(WORKDIR)/LinkTarget/$(2).exports,$(1))))
$(if $(and $(filter CppunitTest Executable,$(TARGETTYPE)),$(filter EMSCRIPTEN,$(OS)),$(filter TRUE,$(ENABLE_QT5))), \
cp $(QT5_PLATFORMS_SRCDIR)/qtlogo.svg $(QT5_PLATFORMS_SRCDIR)/qtloader.js $(dir $(1)) ; \
sed -e 's/@APPNAME@/$(subst $(gb_Executable_EXT),,$(notdir $(1)))/' $(QT5_PLATFORMS_SRCDIR)/wasm_shell.html > $(dir $(1))qt_$(notdir $(1)))
endef
define gb_LinkTarget__command_staticlink

View file

@ -31,7 +31,9 @@ $(eval $(call gb_Module_add_targets,vcl,\
Package_skia_denylist ) \
$(if $(filter DESKTOP FUZZERS,$(BUILD_TYPE)), \
StaticLibrary_vclmain \
$(if $(or $(DISABLE_GUI),$(DISABLE_DYNLOADING)),, \
$(if $(or $(DISABLE_GUI),$(DISABLE_DYNLOADING)), \
$(if $(filter EMSCRIPTEN,$(OS)),Executable_vcldemo) \
, \
$(if $(filter LINUX MACOSX SOLARIS WNT %BSD,$(OS)), \
Executable_vcldemo \
Executable_icontest \