diff -urN libreoffice-4.1.0.2-orig/RepositoryExternal.mk libreoffice-4.1.0.2/RepositoryExternal.mk
--- libreoffice-4.1.0.2-orig/RepositoryExternal.mk	2013-07-03 23:52:47 +0900
+++ libreoffice-4.1.0.2/RepositoryExternal.mk	2013-07-25 02:41:13 +0900
@@ -607,6 +607,8 @@
 endif # SYSTEM_BOOST
 
 
+ifeq ($(BUILD_CMIS),YES)
+
 ifeq ($(SYSTEM_CMIS),YES)
 
 define gb_LinkTarget__use_cmis
@@ -637,6 +639,8 @@
 
 endif # SYSTEM_CMIS
 
+endif # BUILD_CMIS
+
 ifeq ($(OS)$(COM),WNTGCC)
 
 define gb_LinkTarget__use_jawt
diff -urN libreoffice-4.1.0.2-orig/config_host.mk.in libreoffice-4.1.0.2/config_host.mk.in
--- libreoffice-4.1.0.2-orig/config_host.mk.in	2013-07-03 23:52:47 +0900
+++ libreoffice-4.1.0.2/config_host.mk.in	2013-07-25 02:02:57 +0900
@@ -35,6 +35,7 @@
 export BOOST_SYSTEM_LIB=@BOOST_SYSTEM_LIB@
 export BRAND_INTRO_IMAGES=@BRAND_INTRO_IMAGES@
 export BSH_JAR=@BSH_JAR@
+export BUILD_CMIS=@BUILD_CMIS@
 export BUILD_PLATFORM=@build@
 export BUILD_POSTGRESQL_SDBC=@BUILD_POSTGRESQL_SDBC@
 export BUILD_TYPE=@BUILD_TYPE@
diff -urN libreoffice-4.1.0.2-orig/configure.ac libreoffice-4.1.0.2/configure.ac
--- libreoffice-4.1.0.2-orig/configure.ac	2013-07-25 01:53:33 +0900
+++ libreoffice-4.1.0.2/configure.ac	2013-07-25 01:57:41 +0900
@@ -1191,6 +1191,11 @@
          use only if you are hacking on it.]),
 ,enable_openssl=yes)
 
+AC_ARG_ENABLE(cmis,
+    AS_HELP_STRING([--disable-cmis],
+        [Don't include CMIS support.]),,
+    [enable_cmis="yes"])
+
 dnl ===================================================================
 dnl Optional Packages (--with/without-)
 dnl ===================================================================
@@ -7213,10 +7218,23 @@
 dnl ===================================================================
 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.0])
 
+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 ===================================================================
-libo_CHECK_SYSTEM_MODULE([libcmis],[CMIS],[libcmis-0.3 >= 0.3.1])
+if test "$BUILD_CMIS" = "NO"; then
+    AC_MSG_CHECKING([which libcmis to use])
+    AC_MSG_RESULT([none])
+    SYSTEM_LIBCMIS=NO
+else
+    libo_CHECK_SYSTEM_MODULE([libcmis],[CMIS],[libcmis-0.3 >= 0.3.1])
+fi
 
 dnl ===================================================================
 dnl Check for system libwpd
diff -urN libreoffice-4.1.0.2-orig/postprocess/Rdb_services.mk libreoffice-4.1.0.2/postprocess/Rdb_services.mk
--- libreoffice-4.1.0.2-orig/postprocess/Rdb_services.mk	2013-07-03 23:52:47 +0900
+++ libreoffice-4.1.0.2/postprocess/Rdb_services.mk	2013-07-26 11:19:16 +0900
@@ -94,7 +94,9 @@
 	ucb/source/sorter/srtrs1 \
 	ucb/source/core/ucb1 \
 	ucb/source/cacher/cached1 \
-	ucb/source/ucp/cmis/ucpcmis1 \
+    $(if $(filter YES,$(BUILD_CMIS)), \
+		ucb/source/ucp/cmis/ucpcmis1 \
+	) \
 	ucb/source/ucp/expand/ucpexpand1 \
 	ucb/source/ucp/ext/ucpext \
 	ucb/source/ucp/file/ucpfile1 \
diff -urN libreoffice-4.1.0.2-orig/scp2/InstallModule_ooo.mk libreoffice-4.1.0.2/scp2/InstallModule_ooo.mk
--- libreoffice-4.1.0.2-orig/scp2/InstallModule_ooo.mk	2013-07-03 23:52:47 +0900
+++ libreoffice-4.1.0.2/scp2/InstallModule_ooo.mk	2013-07-25 01:54:35 +0900
@@ -18,6 +18,7 @@
 $(eval $(call gb_InstallModule_use_auto_install_libs,scp2/ooo,ooo))
 
 $(eval $(call gb_InstallModule_define_if_set,scp2/ooo,\
+	BUILD_CMIS \
 	DISABLE_ATL \
 	DISABLE_NEON \
 	ENABLE_CAIRO_CANVAS \
diff -urN libreoffice-4.1.0.2-orig/scp2/source/ooo/file_library_ooo.scp libreoffice-4.1.0.2/scp2/source/ooo/file_library_ooo.scp
--- libreoffice-4.1.0.2-orig/scp2/source/ooo/file_library_ooo.scp	2013-07-03 23:52:47 +0900
+++ libreoffice-4.1.0.2/scp2/source/ooo/file_library_ooo.scp	2013-07-25 01:55:08 +0900
@@ -876,7 +876,9 @@
 
 STD_LIB_FILE(gid_File_Ucpext, ucpext)
 
+#ifdef BUILD_CMIS
 STD_LIB_FILE(gid_File_Ucpcmis, ucpcmis1)
+#endif
 
 STD_LIB_FILE( gid_File_Lib_Textfd, textfd )
 
diff -urN libreoffice-4.1.0.2-orig/ucb/Module_ucb.mk libreoffice-4.1.0.2/ucb/Module_ucb.mk
--- libreoffice-4.1.0.2-orig/ucb/Module_ucb.mk	2013-07-03 23:52:47 +0900
+++ libreoffice-4.1.0.2/ucb/Module_ucb.mk	2013-07-25 01:54:35 +0900
@@ -13,7 +13,6 @@
 	Library_cached1 \
 	Library_srtrs1 \
 	Library_ucb1 \
-	Library_ucpcmis1 \
 	Library_ucpexpand1 \
 	Library_ucpext \
 	Library_ucpfile1 \
@@ -23,6 +22,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 \
