Kaydet (Commit) 338f19a8 authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

Emscripten: First steps of porting to Emscripten

See https://wiki.documentfoundation.org/Development/Emscripten for details

Change-Id: I977a8b9e98b9be13c263fef48f567b92347d0492
Reviewed-on: https://gerrit.libreoffice.org/18643Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst e62c2b03
......@@ -24,6 +24,7 @@ $(eval $(call gb_Module_add_targets,bridges,\
) \
))
ifneq ($(OS), EMSCRIPTEN)
ifeq (,$(filter build,$(gb_Module_SKIPTARGETS)))
ifeq ($(strip $(bridges_SELECTED_BRIDGE)),)
$(call gb_Output_error,no bridge selected for build: bailing out)
......@@ -31,5 +32,6 @@ else ifneq ($(words $(bridges_SELECTED_BRIDGE)),1)
$(call gb_Output_error,multiple bridges selected for build: $(bridges_SELECTED_BRIDGE))
endif
endif
endif
# vim: set noet sw=4 ts=4:
......@@ -814,6 +814,27 @@ linux-android*)
BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
;;
emscripten*)
build_gstreamer_1_0=no
build_gstreamer_0_10=no
enable_lotuswordpro=no
enable_mpl_subset=yes
enable_coinmp=yes
enable_lpsolve=no
enable_report_builder=no
with_theme="tango"
test_cups=no
test_dbus=no
test_fontconfig=no
test_freetype=no
test_gtk=no
test_tde=no
test_kde4=no
test_randr=no
test_xrender=no
_os=Emscripten
;;
*)
AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
;;
......@@ -4313,6 +4334,17 @@ linux-android*)
esac
;;
emscripten*)
COM=emcc
USING_X11=
OS=EMSCRIPTEN
RTL_OS=Emscripten
P_SEP=:
CPUNAME=INTEL
RTL_ARCH=x86
PLATFORMID=linux_x86
;;
mingw*)
COM=GCC
USING_X11=
......@@ -5376,7 +5408,7 @@ else
fi
dnl check for GNU C++ compiler version
if test "$GXX" = "yes"; then
if test "$GXX" = "yes" -a $CXX != "emcc"; then
AC_MSG_CHECKING([the GNU C++ compiler version])
_gpp_version=`$CXX -dumpversion`
......@@ -10067,7 +10099,7 @@ fi
AC_SUBST(ENABLE_KDE4)
ENABLE_HEADLESS=""
if test "x$with_x" = "xno"; then
if test "x$with_x" = "xno" -o $CXX = "emcc"; then
ENABLE_HEADLESS="TRUE"
SCPDEFS="$SCPDEFS -DLIBO_HEADLESS"
R="headless"
......
# Need to specify --host and --build to enable cross-compilation mode
# See https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Hosts-and-Cross_002dCompilation.html
--host=asmjs-local-emscripten
--build=x86_64-unknown-linux-gnu
# Disable unnecessary stuff
--disable-cairo-canvas
--disable-cups
--disable-gconf
--disable-dconf
--disable-gio
--disable-dbus
--disable-sdremote-bluetooth
--disable-gstreamer-0-10
--disable-gstreamer-1-0
--disable-liblangtag
--disable-lockdown
--disable-odk
--disable-postgresql-sdbc
--disable-firebird-sdbc
--disable-python
--disable-randr
--disable-randr-link
--disable-pdfimport
--disable-systray
--disable-gltf
--disable-collada
--disable-export
--disable-report-builder
--disable-lpsolve
--disable-coinmp
--disable-scripting
--disable-graphite
--disable-orcus
--without-fonts
--without-java
--without-junit
--without-helppack-integration
--without-system-dicts
--with-theme=no
--with-system-zlib=no
# This helps spotting build errors
--with-parallelism=no
# Emscripten doesn't support dynamic loading
--disable-dynamic-loading
# Not sure whether we need this
#--disable-ccache
# Specify Emscripten compiler
CC=emcc
CXX=emcc
......@@ -80,7 +80,7 @@ $(call gb_ExternalProject_get_state_target,icu,build) :
--disable-layout --disable-samples \
$(if $(CROSS_COMPILING),--disable-tools --disable-extras) \
$(if $(filter IOS ANDROID,$(OS)),--disable-dyload) \
$(if $(filter ANDROID,$(OS)),--disable-strict ac_cv_c_bigendian=no) \
$(if $(filter ANDROID EMSCRIPTEN,$(OS)),--disable-strict ac_cv_c_bigendian=no) \
$(if $(filter SOLARIS AIX,$(OS)),--disable-64bit-libs) \
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),\
--enable-static --disable-shared,\
......
......@@ -68,6 +68,13 @@ extern "C" {
# endif
#endif
#ifdef EMSCRIPTEN
# include <endian.h>
# ifndef _LITTLE_ENDIAN
# define _LITTLE_ENDIAN
# endif
#endif
#ifdef NETBSD
# include <machine/endian.h>
# if BYTE_ORDER == LITTLE_ENDIAN
......@@ -132,7 +139,8 @@ extern "C" {
!defined(AIX) && !defined(OPENBSD) && \
!defined(SOLARIS) && !defined(MACOSX) && !defined(FREEBSD) && \
!defined(DRAGONFLY) && \
!defined(IOS) && !defined(ANDROID)
!defined(IOS) && !defined(ANDROID) && \
!defined(EMSCRIPTEN)
# error "Target platform not specified !"
#endif
......
......@@ -20,7 +20,7 @@
#ifndef INCLUDED_SAL_ALLOCA_H
#define INCLUDED_SAL_ALLOCA_H
#if defined (SOLARIS) || defined (LINUX) || defined(AIX) || defined(ANDROID)
#if defined (SOLARIS) || defined (LINUX) || defined(AIX) || defined(ANDROID) || defined(EMSCRIPTEN)
#ifndef INCLUDED_ALLOCA_H
#include <alloca.h>
......
......@@ -63,6 +63,16 @@
#define SAL_CONFIGFILE( name ) name "rc"
#endif
#ifdef EMSCRIPTEN
#define SAL_UNX
#define SAL_DLLEXTENSION ".bc"
#define SAL_DLLPREFIX "lib"
#define SAL_PATHSEPARATOR ':'
#define SAL_PATHDELIMITER '/'
#define SAL_NEWLINE_STRING "\n"
#define SAL_CONFIGFILE( name ) name "rc"
#endif
#ifdef MACOSX
#define SAL_UNX
#define SAL_DLLEXTENSION ".dylib"
......
......@@ -728,7 +728,7 @@ static struct hostent* _osl_gethostbyname_r (
const char *name, struct hostent *result,
char *buffer, int buflen, int *h_errnop)
{
#if defined(LINUX) || defined(ANDROID) || defined(FREEBSD) || defined(DRAGONFLY)
#if defined(LINUX) || defined(ANDROID) || defined(FREEBSD) || defined(DRAGONFLY) || defined(EMSCRIPTEN)
struct hostent *__result; /* will be the same as result */
int __error;
__error = gethostbyname_r (name, result, buffer, buflen,
......
......@@ -85,7 +85,7 @@
#endif
#ifdef ANDROID
#if defined(ANDROID) || defined(EMSCRIPTEN)
# include <pthread.h>
# include <sys/file.h>
# include <sys/ioctl.h>
......@@ -243,7 +243,8 @@ int macxp_resolveAlias(char *path, int buflen);
!defined(AIX) && \
!defined(SOLARIS) && !defined(MACOSX) && \
!defined(OPENBSD) && !defined(DRAGONFLY) && \
!defined(IOS) && !defined(ANDROID)
!defined(IOS) && !defined(ANDROID) && \
!defined(EMSCRIPTEN)
# error "Target platform not specified!"
#endif
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
ifeq ($(DISABLE_DYNLOADING),TRUE)
gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
else
gb_UnoApiHeadersTarget_select_variant = $(2)
endif
include $(GBUILDDIR)/platform/unxgcc.mk
# vim: set noet sw=4 ts=4:
......@@ -613,9 +613,13 @@ $(eval $(call gb_Library_use_libraries,vcl,\
))
$(eval $(call gb_Library_use_externals,vcl,\
fontconfig \
freetype \
))
ifneq ($(OS),EMSCRIPTEN)
$(eval $(call gb_Library_use_externals,vcl,\
fontconfig \
))
endif
endif
ifeq ($(OS),ANDROID)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment