diff -urN libreoffice-4.0.2.2-orig/Module_tail_build.mk libreoffice-4.0.2.2/Module_tail_build.mk
--- libreoffice-4.0.2.2-orig/Module_tail_build.mk	2013-04-09 14:22:16 +0900
+++ libreoffice-4.0.2.2/Module_tail_build.mk	2013-04-10 00:33:23 +0900
@@ -96,17 +96,17 @@
 	jvmfwk \
 	$(call gb_Helper_optional,LANGUAGETOOL,languagetool) \
 	$(call gb_Helper_optional,LCMS2,lcms2) \
-	libcdr \
+	$(call gb_Helper_optional,CDR,libcdr) \
 	libcmis \
 	$(call gb_Helper_optional,LIBEXTTEXTCAT,libexttextcat) \
 	$(call gb_Helper_optional,LIBLANGTAG,liblangtag) \
-	libmspub \
+	$(call gb_Helper_optional,MSPUB,libmspub) \
 	liborcus \
 	librelogo \
-	libvisio \
-	libwpd \
-	libwpg \
-	libwps \
+	$(call gb_Helper_optional,VISIO,libvisio) \
+	$(call gb_Helper_optional,WPD,libwpd) \
+	$(call gb_Helper_optional,WPG,libwpg) \
+	$(call gb_Helper_optional,WPS,libwps) \
 	libxmlsec \
 	lingucomponent \
 	linguistic \
diff -urN libreoffice-4.0.2.2-orig/config_host.mk.in libreoffice-4.0.2.2/config_host.mk.in
--- libreoffice-4.0.2.2-orig/config_host.mk.in	2013-03-26 20:02:28 +0900
+++ libreoffice-4.0.2.2/config_host.mk.in	2013-04-09 12:12:20 +0900
@@ -44,6 +44,7 @@
 export BUILD_TYPE=@BUILD_TYPE@
 export BUILD_UNOWINREG=@BUILD_UNOWINREG@
 export BUILD_VER_STRING=@BUILD_VER_STRING@
+export BUILD_OLD_DOC_FILTERS=@BUILD_OLD_DOC_FILTERS@
 export BUILD_X64=@BUILD_X64@
 export CAIRO_CFLAGS=$(gb_SPACE)@CAIRO_CFLAGS@
 export CAIRO_LIBS=$(gb_SPACE)@CAIRO_LIBS@
diff -urN libreoffice-4.0.2.2-orig/configure.ac libreoffice-4.0.2.2/configure.ac
--- libreoffice-4.0.2.2-orig/configure.ac	2013-03-26 20:02:28 +0900
+++ libreoffice-4.0.2.2/configure.ac	2013-04-09 13:29:20 +0900
@@ -1292,6 +1292,11 @@
         [Specify external thesaurus dir.]),
 ,)
 
+AC_ARG_ENABLE(old-doc-filters,
+    AS_HELP_STRING([--disable-old-doc-filters],
+        [Don't include import/export filters for old document formats.]),,
+    [enable_old_doc_filters=yes])
+
 AC_ARG_WITH(system-zlib,
     AS_HELP_STRING([--with-system-zlib],
         [Use zlib already on system.]),,
@@ -6890,17 +6895,28 @@
 AC_SUBST(SYSTEM_EXPAT)
 AC_SUBST([MINGW_EXPAT_DLL])
 
+if test "$enable_old_doc_filters" = "no"; then
+    BUILD_OLD_DOC_FILTERS=NO
+elif test $_os = iOS; then
+    # libwpd and libwpg are LGPL
+    BUILD_OLD_DOC_FILTERS=NO
+else
+    BUILD_OLD_DOC_FILTERS=YES
+fi
+AC_SUBST(BUILD_OLD_DOC_FILTERS)
+
 dnl ===================================================================
 dnl Check for system libcdr
 dnl ===================================================================
 AC_MSG_CHECKING([which libcdr to use])
-if test "$with_system_libcdr" = "yes"; then
+
+if test "$BUILD_OLD_DOC_FILTERS" = "NO"; then
+    AC_MSG_RESULT([none])
+    SYSTEM_LIBCDR=NO
+elif test "$with_system_libcdr" = "yes"; then
     AC_MSG_RESULT([external])
     SYSTEM_LIBCDR=YES
     PKG_CHECK_MODULES( CDR, libcdr-0.0 >= 0.0.5 )
-elif test $_os = iOS; then
-    # libcdr depends on libwpd and libwpg and those are LGPL
-    AC_MSG_RESULT([none])
 else
     AC_MSG_RESULT([internal])
     SYSTEM_LIBCDR=NO
@@ -6914,13 +6930,13 @@
 dnl Check for system libmspub
 dnl ===================================================================
 AC_MSG_CHECKING([which libmspub to use])
-if test "$with_system_libmspub" = "yes"; then
+if test "$BUILD_OLD_DOC_FILTERS" = "NO"; then
+    AC_MSG_RESULT([none])
+    SYSTEM_LIBMSPUB=NO
+elif test "$with_system_libmspub" = "yes"; then
     AC_MSG_RESULT([external])
     SYSTEM_LIBMSPUB=YES
     PKG_CHECK_MODULES( MSPUB, libmspub-0.0 )
-elif test $_os = iOS; then
-    # libmspub depends on libwpd and libwpg and those are LGPL
-    AC_MSG_RESULT([none])
 else
     AC_MSG_RESULT([internal])
     SYSTEM_LIBMSPUB=NO
@@ -6934,13 +6950,13 @@
 dnl Check for system libvisio
 dnl ===================================================================
 AC_MSG_CHECKING([which libvisio to use])
-if test "$with_system_libvisio" = "yes"; then
+if test "$BUILD_OLD_DOC_FILTERS" = "NO"; then
+    AC_MSG_RESULT([none])
+    SYSTEM_LIBVISIO=NO
+elif test "$with_system_libvisio" = "yes"; then
     AC_MSG_RESULT([external])
     SYSTEM_LIBVISIO=YES
     PKG_CHECK_MODULES( VISIO, libvisio-0.0 )
-elif test $_os = iOS; then
-    # libvisio depends on libwpd and libwpg and those are LGPL
-    AC_MSG_RESULT([none])
 else
     AC_MSG_RESULT([internal])
     SYSTEM_LIBVISIO=NO
@@ -6972,12 +6988,13 @@
 dnl Check for system libwpd
 dnl ===================================================================
 AC_MSG_CHECKING([which libwpd to use])
-if test "$with_system_libwpd" = "yes"; then
+if test "$BUILD_OLD_DOC_FILTERS" = "NO"; then
+    AC_MSG_RESULT([none])
+    SYSTEM_LIBWPD=NO
+elif test "$with_system_libwpd" = "yes"; then
     AC_MSG_RESULT([external])
     SYSTEM_LIBWPD=YES
     PKG_CHECK_MODULES( WPD, libwpd-0.9 libwpd-stream-0.9 )
-elif test $_os = iOS; then
-    AC_MSG_RESULT([none])
 else
     AC_MSG_RESULT([internal])
     SYSTEM_LIBWPD=NO
@@ -7051,12 +7068,13 @@
 dnl Check for system libwps
 dnl ===================================================================
 AC_MSG_CHECKING([which libwps to use])
-if test "$with_system_libwps" = "yes"; then
+if test "$BUILD_OLD_DOC_FILTERS" = "NO"; then
+    AC_MSG_RESULT([none])
+    SYSTEM_LIBWPS=NO
+elif test "$with_system_libwps" = "yes"; then
     AC_MSG_RESULT([external])
     SYSTEM_LIBWPS=YES
     PKG_CHECK_MODULES( WPS, libwps-0.2 )
-elif test $_os = iOS; then
-    AC_MSG_RESULT([none])
 else
     AC_MSG_RESULT([internal])
     SYSTEM_LIBWPS=NO
@@ -7072,12 +7090,13 @@
 dnl Check for system libwpg
 dnl ===================================================================
 AC_MSG_CHECKING([which libwpg to use])
-if test "$with_system_libwpg" = "yes"; then
+if test "$BUILD_OLD_DOC_FILTERS" = "NO"; then
+    AC_MSG_RESULT([none])
+    SYSTEM_LIBWPG=NO
+elif test "$with_system_libwpg" = "yes"; then
     AC_MSG_RESULT([external])
     SYSTEM_LIBWPG=YES
     PKG_CHECK_MODULES( WPG, libwpg-0.2 )
-elif test $_os = iOS; then
-    AC_MSG_RESULT([none])
 else
     AC_MSG_RESULT([internal])
     SYSTEM_LIBWPG=NO
diff -urN libreoffice-4.0.2.2-orig/postprocess/packcomponents/makefile.mk libreoffice-4.0.2.2/postprocess/packcomponents/makefile.mk
--- libreoffice-4.0.2.2-orig/postprocess/packcomponents/makefile.mk	2013-03-26 20:02:28 +0900
+++ libreoffice-4.0.2.2/postprocess/packcomponents/makefile.mk	2013-04-30 19:47:16 +0900
@@ -212,6 +212,12 @@
 my_components += \
     component/sccomp/source/solver/solver \
     component/writerfilter/util/writerfilter \
+
+.ENDIF
+
+.IF "$(BUILD_OLD_DOC_FILTERS)" != "NO"
+
+my_components += \
     component/writerperfect/util/wpftwriter \
     component/writerperfect/util/wpftdraw \
 
diff -urN libreoffice-4.0.2.2-orig/scp2/InstallModule_ooo.mk libreoffice-4.0.2.2/scp2/InstallModule_ooo.mk
--- libreoffice-4.0.2.2-orig/scp2/InstallModule_ooo.mk	2013-03-26 20:02:28 +0900
+++ libreoffice-4.0.2.2/scp2/InstallModule_ooo.mk	2013-04-09 12:14:08 +0900
@@ -28,6 +28,7 @@
 $(eval $(call gb_InstallModule_InstallModule,scp2/ooo))
 
 $(eval $(call gb_InstallModule_define_if_set,scp2/ooo,\
+	BUILD_OLD_DOC_FILTERS \
 	DISABLE_ATL \
 	DISABLE_NEON \
 	ENABLE_CAIRO_CANVAS \
diff -urN libreoffice-4.0.2.2-orig/scp2/source/graphicfilter/file_graphicfilter.scp libreoffice-4.0.2.2/scp2/source/graphicfilter/file_graphicfilter.scp
--- libreoffice-4.0.2.2-orig/scp2/source/graphicfilter/file_graphicfilter.scp	2013-03-26 20:02:28 +0900
+++ libreoffice-4.0.2.2/scp2/source/graphicfilter/file_graphicfilter.scp	2013-04-09 12:12:20 +0900
@@ -38,4 +38,6 @@
 
 STD_LIB_FILE( gid_File_Lib_Svg, svgfilter )
 
+#ifdef BUILD_OLD_DOC_FILTERS
 STD_FILTER_FILE( gid_File_Lib_WpftDraw, wpftdraw )
+#endif
diff -urN libreoffice-4.0.2.2-orig/scp2/source/ooo/file_library_ooo.scp libreoffice-4.0.2.2/scp2/source/ooo/file_library_ooo.scp
--- libreoffice-4.0.2.2-orig/scp2/source/ooo/file_library_ooo.scp	2013-03-26 20:02:28 +0900
+++ libreoffice-4.0.2.2/scp2/source/ooo/file_library_ooo.scp	2013-04-09 12:12:20 +0900
@@ -851,7 +851,9 @@
 
 #endif
 
+#ifdef BUILD_OLD_DOC_FILTERS
 STD_LIB_FILE(gid_File_Lib_WpftWriter,wpftwriter)
+#endif
 
 STD_LIB_FILE(gid_File_Lib_T602Filter,t602filter)
 
--- libreoffice-4.0.2.2-orig/writerperfect/Module_writerperfect.mk	2013-03-26 20:02:28 +0900
+++ libreoffice-4.0.2.2/writerperfect/Module_writerperfect.mk	2013-04-12 13:40:57 +0900
@@ -19,34 +19,12 @@
 
 $(eval $(call gb_Module_Module,writerperfect))
 
-ifneq (,$(SYSTEM_LIBWPD))
-ifneq (,$(SYSTEM_LIBWPS))
+ifneq (NO,$(BUILD_OLD_DOC_FILTERS))
 $(eval $(call gb_Module_add_targets,writerperfect,\
 	Library_wpftwriter \
-))
-endif
-endif
-
-ifneq (,$(SYSTEM_LIBWPD))
-ifneq (,$(SYSTEM_LIBWPG))
-ifneq (,$(SYSTEM_LIBVISIO))
-ifneq (,$(SYSTEM_LIBCDR))
-ifneq (,$(SYSTEM_LIBMSPUB))
-$(eval $(call gb_Module_add_targets,writerperfect,\
 	Library_wpftdraw \
-))
-endif
-endif
-endif
-endif
-endif
-
-ifneq (,$(SYSTEM_LIBWPD))
-ifneq (,$(SYSTEM_LIBWPG))
-$(eval $(call gb_Module_add_targets,writerperfect,\
 	StaticLibrary_writerperfect \
 ))
 endif
-endif
 
 # vim: set noet sw=4 ts=4:
