config_host.mk.in       |    1 +
 configure.ac            |   27 +++++++++++++++++++++++++++
 solenv/gbuild/gbuild.mk |    1 +
 3 files changed, 29 insertions(+)

New commits:
commit 1781da99f62454df0fc04da1f4013528ea9fff96
Author: Tor Lillqvist <[email protected]>
Date:   Fri Nov 23 13:57:26 2012 +0200

    Add experimental --disable-export configure option
    
    Even for an Android (or iOS, presumably) app with just viewer
    functionality, some export code gets included in the single .so or
    executable.
    
    For now, when we know that we are producing only viewer apps for
    Android and iOS anyway, it might be a good idea to be able to
    carefully bypass some particularly pathological places in the code
    that generate large amounts of code and/or data that is useless in a
    viewer app.
    
    Change-Id: I59b97024ff2855e7bbe53d6ec8782797705f61d8

diff --git a/config_host.mk.in b/config_host.mk.in
index e53c4f8..52d9850 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -114,6 +114,7 @@ export DISABLE_ACTIVEX=@DISABLE_ACTIVEX@
 export DISABLE_ATL=@DISABLE_ATL@
 export DISABLE_DBCONNECTIVITY=@DISABLE_DBCONNECTIVITY@
 export DISABLE_DYNLOADING=@DISABLE_DYNLOADING@
+export DISABLE_EXPORT=@DISABLE_EXPORT@
 export DISABLE_EXTENSIONS=@DISABLE_EXTENSIONS@
 export DISABLE_SCRIPTING=@DISABLE_SCRIPTING@
 export DISABLE_LINKOO=@DISABLE_LINKOO@
diff --git a/configure.ac b/configure.ac
index 74d9ca1..b8bff37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -549,6 +549,12 @@ AC_ARG_ENABLE(ext-barcode,
         [Enable the Barcode extension.])
 )
 
+AC_ARG_ENABLE(export,
+    AS_HELP_STRING([--disable-export],
+        [Disable (some) code for document format export. Useful when building 
*viewer* apps to avoid
+         having export-related code and data linked in. Work in progress, use 
only if you are hacking on it.])
+)
+
 AC_ARG_ENABLE(database-connectivity,
     AS_HELP_STRING([--disable-database-connectivity],
         [Disable various database connectivity. Work in progress, use only if 
you are hacking on it.])
@@ -2300,6 +2306,27 @@ if test $_os != iOS -a $_os != Android; then
     BUILD_TYPE="$BUILD_TYPE DESKTOP"
 fi
 
+# Currently we build only viewer apps for Android (and for iOS not even that 
yet), so to avoid getting
+# some pathological export-related code and data linked in, we will add some 
judicious #ifndef
+# DISABLE_EXPORT in the code in places where the linker map shows it has a big 
impact. Places that
+# generate large amounts of code or data related to export only but still gets 
linked in. At least
+# that is the theory, let's see...
+
+if test -z "$enable_export"; then
+    if test $_os != Android -a $_os != iOS; then
+        enable_export=yes
+    fi
+fi
+
+DISABLE_EXPORT=''
+if test "$enable_export" = yes; then
+    BUILD_TYPE="$BUILD_TYPE EXPORT"
+else
+    DISABLE_EXPORT='TRUE'
+    SCPDEFS="$SCPDES -DDISABLE_EXPORT"
+fi
+AC_SUBST(DISABLE_EXPORT)
+
 dnl Decide whether to build database connectivity stuff (including
 dnl Base) or not. We probably don't want to on non-desktop OSes.
 
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index b9f8d75..5fd7b30 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -282,6 +282,7 @@ gb_GLOBALDEFS += \
        $(call gb_Helper_define_if_set,\
                DISABLE_DBCONNECTIVITY \
                DISABLE_DYNLOADING \
+               DISABLE_EXPORT \
                DISABLE_EXTENSIONS \
                DISABLE_SCRIPTING \
                ENABLE_GRAPHITE \
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to