summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-11-23 13:57:26 +0200
committerTor Lillqvist <tlillqvist@suse.com>2012-11-23 14:03:23 +0200
commit1781da99f62454df0fc04da1f4013528ea9fff96 (patch)
tree921c2262912fa63af0bc3a1bd216c8e590b308eb
parentb3edb2410387e0ad63ee663cd3b706076bea3edb (diff)
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
-rw-r--r--config_host.mk.in1
-rw-r--r--configure.ac27
-rw-r--r--solenv/gbuild/gbuild.mk1
3 files changed, 29 insertions, 0 deletions
diff --git a/config_host.mk.in b/config_host.mk.in
index e53c4f8967ba..52d98506a27b 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 74d9ca101f26..b8bff37e3ff2 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 b9f8d750b626..5fd7b308ce04 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 \