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-03-26 20:02:28 +0900
+++ libreoffice-4.0.2.2/Module_tail_build.mk	2013-04-09 14:22:16 +0900
@@ -97,7 +97,7 @@
 	$(call gb_Helper_optional,LANGUAGETOOL,languagetool) \
 	$(call gb_Helper_optional,LCMS2,lcms2) \
 	libcdr \
-	libcmis \
+	$(call gb_Helper_optional,CMIS,libcmis) \
 	$(call gb_Helper_optional,LIBEXTTEXTCAT,libexttextcat) \
 	$(call gb_Helper_optional,LIBLANGTAG,liblangtag) \
 	libmspub \
diff -urN libreoffice-4.0.2.2-orig/RepositoryExternal.mk libreoffice-4.0.2.2/RepositoryExternal.mk
--- libreoffice-4.0.2.2-orig/RepositoryExternal.mk	2013-03-26 20:02:28 +0900
+++ libreoffice-4.0.2.2/RepositoryExternal.mk	2013-04-09 12:07:28 +0900
@@ -460,6 +460,8 @@
 endif # SYSTEM_BOOST
 
 
+ifeq ($(BUILD_CMIS),YES)
+
 ifeq ($(SYSTEM_LIBCMIS),YES)
 
 define gb_LinkTarget__use_cmis
@@ -486,6 +488,8 @@
 
 endif # SYSTEM_LIBCMIS
 
+endif # BUILD_CMIS
+
 
 ifeq ($(SYSTEM_LIBEXTTEXTCAT),YES)
 
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:07:28 +0900
@@ -38,6 +38,7 @@
 export BOOST_LDFLAGS=@BOOST_LDFLAGS@
 export BOOST_SYSTEM_LIB=@BOOST_SYSTEM_LIB@
 export BSH_JAR=@BSH_JAR@
+export BUILD_CMIS=@BUILD_CMIS@
 export BUILD_DMAKE=@BUILD_DMAKE@
 export BUILD_PLATFORM=@build@
 export BUILD_POSTGRESQL_SDBC=@BUILD_POSTGRESQL_SDBC@
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 12:07:28 +0900
@@ -1317,6 +1317,11 @@
         [Use expat already on system.]),,
     [with_system_expat="$with_system_libs"])
 
+AC_ARG_ENABLE(cmis,
+    AS_HELP_STRING([--disable-cmis],
+        [Don't include CMIS support.]),,
+    [enable_cmis="yes"])
+
 AC_ARG_WITH(system-libcmis,
     AS_HELP_STRING([--with-system-libcmis],
         [Use libcmis already on system.]),,
@@ -6950,11 +6955,21 @@
 AC_SUBST(VISIO_CFLAGS)
 AC_SUBST(VISIO_LIBS)
 
+if test "$enable_cmis" = "no"; then
+    BUILD_CMIS=NO
+else
+    BUILD_CMIS=YES
+fi
+AC_SUBST(BUILD_CMIS)
+
 dnl ===================================================================
 dnl Check for system libcmis
 dnl ===================================================================
 AC_MSG_CHECKING([which libcmis to use])
-if test "$with_system_libcmis" = "yes"; then
+if test "$BUILD_CMIS" = "NO"; then
+    AC_MSG_RESULT([none])
+    SYSTEM_LIBCMIS=NO
+elif test "$with_system_libcmis" = "yes"; then
     AC_MSG_RESULT([external])
     SYSTEM_LIBCMIS=YES
     PKG_CHECK_MODULES( CMIS, libcmis-0.3 >= 0.3.1 )
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-09 12:07:28 +0900
@@ -103,7 +103,6 @@
     component/ucb/source/sorter/srtrs1 \
     component/ucb/source/core/ucb1 \
     component/ucb/source/cacher/cached1 \
-    component/ucb/source/ucp/cmis/ucpcmis1 \
     component/ucb/source/ucp/expand/ucpexpand1 \
     component/ucb/source/ucp/ext/ucpext \
     component/ucb/source/ucp/file/ucpfile1 \
@@ -122,6 +121,13 @@
     component/xmlsecurity/util/xmlsecurity \
     component/xmlsecurity/util/xsec_fw \
 
+.IF "$(BUILD_CMIS)" != "NO"
+
+my_components += \
+    component/ucb/source/ucp/cmis/ucpcmis1 \
+
+.ENDIF
+
 .IF "$(BUILD_TYPE)" != "$(BUILD_TYPE:s/DBCONNECTIVITY//)"
 
 my_components += \
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:07:28 +0900
@@ -28,6 +28,7 @@
 $(eval $(call gb_InstallModule_InstallModule,scp2/ooo))
 
 $(eval $(call gb_InstallModule_define_if_set,scp2/ooo,\
+	BUILD_CMIS \
 	DISABLE_ATL \
 	DISABLE_NEON \
 	ENABLE_CAIRO_CANVAS \
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:07:28 +0900
@@ -1335,7 +1335,9 @@
 
 SPECIAL_COMPONENT_LIB_FILE(gid_File_Ucpexpand1, ucpexpand1.uno)
 
+#ifdef BUILD_CMIS
 SPECIAL_COMPONENT_LIB_FILE(gid_File_Ucpcmis, ucpcmis1.uno)
+#endif
 
 File gid_File_Lib_Lnth
     LIB_FILE_BODY;
diff -urN libreoffice-4.0.2.2-orig/ucb/Module_ucb.mk libreoffice-4.0.2.2/ucb/Module_ucb.mk
--- libreoffice-4.0.2.2-orig/ucb/Module_ucb.mk	2013-03-26 20:02:28 +0900
+++ libreoffice-4.0.2.2/ucb/Module_ucb.mk	2013-04-09 12:09:26 +0900
@@ -32,7 +32,6 @@
 	Library_cached1 \
 	Library_srtrs1 \
 	Library_ucb1 \
-	Library_ucpcmis1 \
 	Library_ucpexpand1 \
 	Library_ucpext \
 	Library_ucpfile1 \
@@ -42,6 +41,12 @@
 	Library_ucptdoc1 \
 ))
 
+ifeq ($(BUILD_CMIS),YES)
+$(eval $(call gb_Module_add_targets,ucb,\
+	Library_ucpcmis1 \
+))
+endif
+
 ifneq ($(DISABLE_NEON),TRUE)
 $(eval $(call gb_Module_add_targets,ucb,\
 	Library_ucpdav1 \
