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
This commit is contained in:
Tor Lillqvist
2012-11-23 13:57:26 +02:00
committed by Tor Lillqvist
parent b3edb24103
commit 1781da99f6
3 changed files with 29 additions and 0 deletions

View File

@@ -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@

View File

@@ -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.

View File

@@ -282,6 +282,7 @@ gb_GLOBALDEFS += \
$(call gb_Helper_define_if_set,\
DISABLE_DBCONNECTIVITY \
DISABLE_DYNLOADING \
DISABLE_EXPORT \
DISABLE_EXTENSIONS \
DISABLE_SCRIPTING \
ENABLE_GRAPHITE \