summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-04-23 13:45:05 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-05-05 21:14:54 +0200
commit8a4173987edfeeb7e49c70617d43e3adc911d333 (patch)
tree24360e0c3fe2b2138f9a291f143f9a6667c53510 /configure.ac
parentSwitch OPENSSL config var from negative to positive (diff)
downloadcore-8a4173987edfeeb7e49c70617d43e3adc911d333.tar.gz
core-8a4173987edfeeb7e49c70617d43e3adc911d333.zip
WASM: add initial support for Emscripten cross build
- configure with: - --host=wasm64-local-emscripten - had to make a few externals optional, so adding: - --disable-nss - --disable-cmis - --disable-curl Change-Id: I48d1c73d2675ad2e2beaf2c341578199efbd24ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111130 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac140
1 files changed, 122 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac
index 1b0521624ac2..e5ce5560c661 100644
--- a/configure.ac
+++ b/configure.ac
@@ -804,6 +804,8 @@ dnl Sequential to keep the logic very simple
dnl These values may be checked and reset later.
dnl ===================================================================
#defaults unless the os test overrides this:
+test_cmis=yes
+test_curl=yes
test_randr=yes
test_xrender=yes
test_cups=yes
@@ -957,6 +959,7 @@ darwin*|macos*) # macOS
;;
ios*) # iOS
+ test_cmis=no
test_randr=no
test_xrender=no
test_freetype=no
@@ -1104,6 +1107,29 @@ haiku*)
_os=Haiku
;;
+emscripten)
+ build_gstreamer_1_0=no
+ enable_lpsolve=no
+ enable_report_builder=no
+ with_theme="breeze"
+ test_cmis=no
+ test_cups=no
+ test_curl=no
+ test_dbus=no
+ test_fontconfig=no
+ test_freetype=no
+ test_gtk=no
+ test_randr=no
+ test_xrender=no
+ enable_postgresql_sdbc=no
+ enable_firebird_sdbc=no
+ enable_mariadb_sdbc=no
+ with_system_zlib=no
+ _os=Emscripten
+
+ BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
+ ;;
+
*)
AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
;;
@@ -1254,10 +1280,24 @@ if test $_os != "WINNT"; then
fi
AC_SUBST(DLOPEN_LIBS)
-AC_ARG_ENABLE(ios-simulator,
- AS_HELP_STRING([--enable-ios-simulator],
- [build for iOS simulator])
-)
+dnl ===================================================================
+dnl Sanity checks for Emscripten SDK setup
+dnl ===================================================================
+
+if test "$_os" = "Emscripten"; then
+ EMSCRIPTEN_ERROR=0
+ if ! which emconfigure >/dev/null 2>&1; then
+ AC_MSG_WARN([emconfigure must be in your \$PATH])
+ EMSCRIPTEN_ERROR=1
+ fi
+ if test -z "$EMMAKEN_JUST_CONFIGURE"; then
+ AC_MSG_WARN(["\$EMMAKEN_JUST_CONFIGURE wasn't set by emconfigure. Prefix configure or use autogen.sh])
+ EMSCRIPTEN_ERROR=1
+ fi
+ if test $EMSCRIPTEN_ERROR -ne 0; then
+ AC_MSG_ERROR(["Please fix your EMSDK setup to build with Emscripten!"])
+ fi
+fi
###############################################################################
# Extensions switches --enable/--disable
@@ -1272,6 +1312,11 @@ AC_ARG_ENABLE(ios-simulator,
# if you use --disable-extension-integration. Is that really the
# case?
+AC_ARG_ENABLE(ios-simulator,
+ AS_HELP_STRING([--enable-ios-simulator],
+ [build for iOS simulator])
+)
+
libo_FUZZ_ARG_ENABLE(extension-integration,
AS_HELP_STRING([--disable-extension-integration],
[Disable integration of the built extensions in the installer of the
@@ -1462,7 +1507,8 @@ libo_FUZZ_ARG_ENABLE(optimized,
[Whether to compile with optimization flags.
By default, disabled for --enable-debug and --enable-dbgutil, enabled
otherwise. Using 'debug' will try to use only optimizations that should
- not interfere with debugging.]))
+ not interfere with debugging. For Emscripten we default to optimized (-O1)
+ debug build, as otherwise biaries become too large.]))
libo_FUZZ_ARG_ENABLE(runtime-optimizations,
AS_HELP_STRING([--disable-runtime-optimizations],
@@ -1789,6 +1835,13 @@ libo_FUZZ_ARG_ENABLE(cipher-openssl-backend,
[Enable using OpenSSL as the actual implementation of the rtl/cipher.h functionality.
Requires --enable-openssl.]))
+AC_ARG_ENABLE(nss,
+ AS_HELP_STRING([--disable-nss],
+ [Disable using NSS. If disabled,
+ components will either use GNUTLS or openssl. Work in progress,
+ use only if you are hacking on it.]),
+,enable_nss=yes)
+
AC_ARG_ENABLE(library-bin-tar,
AS_HELP_STRING([--enable-library-bin-tar],
[Enable the building and reused of tarball of binary build for some 'external' libraries.
@@ -1832,6 +1885,16 @@ libo_FUZZ_ARG_ENABLE(librelogo,
[Do not build LibreLogo.]),
,enable_librelogo=yes)
+AC_ARG_ENABLE(cmis,
+ AS_HELP_STRING([--disable-cmis],
+ [Disable CMIS support.]),
+,enable_cmis=yes)
+
+AC_ARG_ENABLE(curl,
+ AS_HELP_STRING([--disable-curl],
+ [Disable CURL support.]),
+,enable_curl=yes)
+
dnl ===================================================================
dnl Optional Packages (--with/without-)
dnl ===================================================================
@@ -2817,7 +2880,7 @@ dnl "desktop" one but a "mobile" one, we are always cross-compiling.
dnl Note the direction of the implication; there is no assumption that
dnl cross-compiling would imply a non-desktop OS.
-if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
+if test $_os != iOS -a $_os != Android -a $_os != Emscripten -a "$enable_fuzzers" != "yes"; then
BUILD_TYPE="$BUILD_TYPE DESKTOP"
AC_DEFINE(HAVE_FEATURE_DESKTOP)
AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
@@ -2868,7 +2931,7 @@ fi
if test -z "$enable_scripting"; then
# Disable scripting for iOS unless specifically overridden
# with --enable-scripting.
- if test $_os != iOS; then
+ if test $_os != iOS -o $_os = Emscripten; then
enable_scripting=yes
fi
fi
@@ -2882,7 +2945,7 @@ else
SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
fi
-if test $_os = iOS -o $_os = Android; then
+if test $_os = iOS -o $_os = Android -o $_os = Emscripten; then
# Disable dynamic_loading always for iOS and Android
enable_dynamic_loading=no
elif test -z "$enable_dynamic_loading"; then
@@ -4105,6 +4168,8 @@ if test "$COM_IS_CLANG" = TRUE; then
[my_apple_clang=yes],[my_apple_clang=])
if test "$my_apple_clang" = yes; then
AC_MSG_RESULT([assumed yes (Apple Clang)])
+ elif test "$_os" = Emscripten; then
+ AC_MSG_RESULT([assumed yes (Emscripten Clang)])
else
if test "$_os" = WINNT; then
dnl In which case, assume clang-cl:
@@ -4186,7 +4251,7 @@ fi
# ===================================================================
HAVE_GCC_GGDB2=
-if test "$GCC" = "yes"; then
+if test "$GCC" = "yes" -a "$_os" != "Emscripten"; then
AC_MSG_CHECKING([whether $CC_BASE supports -ggdb2])
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Werror -ggdb2"
@@ -4414,7 +4479,7 @@ fi
AC_SUBST(USE_LD)
HAVE_LD_BSYMBOLIC_FUNCTIONS=
-if test "$GCC" = "yes"; then
+if test "$GCC" = "yes" -a "$_os" != Emscripten ; then
AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
bsymbolic_functions_ldflags_save=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
@@ -4600,7 +4665,7 @@ elif test "$enable_optimized" = debug; then
ENABLE_OPTIMIZED_DEBUG=TRUE
AC_MSG_RESULT([yes (debug)])
HAVE_GCC_OG=
- if test "$GCC" = "yes"; then
+ if test "$GCC" = "yes" -a "$_os" != "Emscripten"; then
AC_MSG_CHECKING([whether $CC_BASE supports -Og])
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Werror -Og"
@@ -4612,7 +4677,7 @@ elif test "$enable_optimized" = debug; then
AC_MSG_RESULT([no])
fi
fi
- if test -z "$HAVE_GCC_OG"; then
+ if test -z "$HAVE_GCC_OG" -a "$_os" != "Emscripten"; then
AC_MSG_ERROR([The compiler does not support optimizations suitable for debugging.])
fi
else
@@ -5055,6 +5120,25 @@ solaris*)
SOLARINC="$SOLARINC -I/usr/local/include"
;;
+emscripten*)
+ COM=GCC
+ USING_X11=
+ OS=EMSCRIPTEN
+ RTL_OS=Emscripten
+ P_SEP=:
+
+ case "$host_cpu" in
+ wasm32|wasm64)
+ ;;
+ *)
+ AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
+ ;;
+ esac
+ CPUNAME=INTEL
+ RTL_ARCH=x86
+ PLATFORMID=linux_x86
+ ;;
+
*)
AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
;;
@@ -5179,9 +5263,10 @@ if test "$cross_compiling" = "yes"; then
(
unset COM USING_X11 OS CPUNAME
unset CC CXX SYSBASE CFLAGS
- unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
+ unset AR LD NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
unset CPPUNIT_CFLAGS CPPUNIT_LIBS
- unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
+ unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC
+ unset PKG_CONFIG_LIBDIR PKG_CONFIG_PATH
if test -n "$CC_FOR_BUILD"; then
export CC="$CC_FOR_BUILD"
CC_BASE=`first_arg_basename "$CC"`
@@ -5193,6 +5278,7 @@ if test "$cross_compiling" = "yes"; then
test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
cd CONF-FOR-BUILD
+ # Handle host configuration, which affects the cross-toolset too
sub_conf_opts=""
test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
@@ -5227,6 +5313,7 @@ if test "$cross_compiling" = "yes"; then
--disable-gstreamer-1-0 \
--disable-gtk3 \
--disable-mariadb-sdbc \
+ --disable-nss \
--disable-online-update \
--disable-opencl \
--disable-pdfimport \
@@ -5249,7 +5336,9 @@ if test "$cross_compiling" = "yes"; then
PERMITTED_BUILD_TARGETS="
AVMEDIA
BOOST
+ CAIRO
CLUCENE
+ CURL
DBCONNECTIVITY
DESKTOP
DYNLOADING
@@ -6062,9 +6151,12 @@ if test "$_os" != "WINNT"; then
fi
AC_SUBST(AR)
AC_SUBST(DLLTOOL)
+AC_SUBST(LD)
AC_SUBST(NM)
AC_SUBST(OBJDUMP)
AC_SUBST(PKG_CONFIG)
+AC_SUBST(PKG_CONFIG_PATH)
+AC_SUBST(PKG_CONFIG_LIBDIR)
AC_SUBST(RANLIB)
AC_SUBST(READELF)
AC_SUBST(STRIP)
@@ -7054,7 +7146,7 @@ dnl ===================================================================
dnl Check for system libcmis
dnl ===================================================================
# libcmis requires curl and we can't build curl for iOS
-if test $_os != iOS; then
+if test "$test_cmis" = "yes" -a "$enable_cmis" = "yes"; then
libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.2])
ENABLE_LIBCMIS=TRUE
else
@@ -9207,6 +9299,9 @@ if test "$with_system_libxml" = "auto"; then
WINNT|iOS|Android)
with_system_libxml="$with_system_libs"
;;
+ Emscripten)
+ with_system_libxml=no
+ ;;
*)
if test "$enable_fuzzers" != "yes"; then
with_system_libxml=yes
@@ -9349,7 +9444,11 @@ no|disable)
# Python is required to build LibreOffice. In theory we could separate the build-time Python
# requirement from the choice whether to include Python stuff in the installer, but why
# bother?
- AC_MSG_ERROR([Python is required at build time.])
+ if test "$cross_compiling" = yes; then
+ enable_python=system
+ else
+ AC_MSG_ERROR([Python is required at build time.])
+ fi
fi
enable_python=no
AC_MSG_RESULT([none])
@@ -10037,7 +10136,7 @@ if test "$with_system_curl" = "auto"; then
with_system_curl="$with_system_libs"
fi
-if test "$with_system_curl" = "yes"; then
+if test "$test_curl" = "yes" -a "$enable_curl" = "yes" -a "$with_system_curl" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_CURL=TRUE
@@ -10069,6 +10168,8 @@ if test "$with_system_curl" = "yes"; then
fi
ENABLE_CURL=TRUE
+elif test "$test_curl" = "no"; then
+ AC_MSG_RESULT([none])
else
AC_MSG_RESULT([internal])
SYSTEM_CURL=
@@ -10211,7 +10312,7 @@ AC_SUBST(SYSTEM_OPENLDAP)
dnl ===================================================================
dnl Check for system NSS
dnl ===================================================================
-if test "$enable_fuzzers" != "yes"; then
+if test "$enable_fuzzers" != "yes" -a "$enable_nss" = "yes"; then
libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
AC_DEFINE(HAVE_FEATURE_NSS)
ENABLE_NSS="TRUE"
@@ -11372,6 +11473,8 @@ if test -z "$build_vcl_plugins"; then
build_vcl_plugins="none"
fi
AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
+VCL_PLUGIN_INFO=$R
+AC_SUBST([VCL_PLUGIN_INFO])
dnl ===================================================================
dnl check for dbus support
@@ -12412,6 +12515,7 @@ MOC5="moc"
QT5_GOBJECT_CFLAGS=""
QT5_GOBJECT_LIBS=""
QT5_HAVE_GOBJECT=""
+QT5_PLATFORMS_SRCDIR=""
if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
\( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
\( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)