[PATCH] Enable configure switch for cups

Tomas Chvatal tchvatal at suse.cz
Mon May 7 04:46:09 PDT 2012


This allows us not to have cups during the build time of libreoffice.

Commit is based of patch from Dave Flogeras <dflogeras at gmail.com>.

Change-Id: I32a14eb6e7bdd13de1a737d4798c852a830ae326

Signed-off-by: Tomas Chvatal <tchvatal at suse.cz>
---
 config_host.mk.in                     |    1 +
 configure.in                          |   12 ++++++++++++
 vcl/Library_vcl.mk                    |    9 +++++++--
 vcl/null/printerinfomanager.cxx       |   10 ++++++++++
 vcl/unx/generic/printer/ppdparser.cxx |    2 +-
 5 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/config_host.mk.in b/config_host.mk.in
index 65affa9..fd5e8a0 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -98,6 +98,7 @@ export DPKG=@DPKG@
 export DYNAMIC_CRT=@DYNAMIC_CRT@
 export ENABLE_CAIRO_CANVAS=@ENABLE_CAIRO_CANVAS@
 export ENABLE_CRASHDUMP=@ENABLE_CRASHDUMP@
+export ENABLE_CUPS=@ENABLE_CUPS@
 export ENABLE_DBUS=@ENABLE_DBUS@
 export ENABLE_DIRECTX=@ENABLE_DIRECTX@
 export ENABLE_EVOAB2=@ENABLE_EVOAB2@
diff --git a/configure.in b/configure.in
index 43a6544..91c871d 100644
--- a/configure.in
+++ b/configure.in
@@ -842,6 +842,11 @@ AC_ARG_ENABLE(nsplugin,
         [Do not build nsplugin extension for browser embedding.])
 )
 
+AC_ARG_ENABLE(cups,
+    AS_HELP_STRING([--disable-cups],
+        [Do not build cups support.])
+)
+
 AC_ARG_ENABLE(ccache,
     AS_HELP_STRING([--disable-ccache],
         [Do not try to use ccache automatically.
@@ -3597,6 +3602,13 @@ fi
 
 dnl check for cups support
 dnl ===================================================================
+if test "$enable_cups" = "no"; then
+    test_cups=no
+    ENABLE_CUPS="NO"
+else
+    ENABLE_CUPS="YES"
+fi
+AC_SUBST(ENABLE_CUPS)
 if test "$test_cups" = "yes"; then
     AC_MSG_CHECKING([whether cups support is present])
     AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 92e35a2..05be361 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -445,10 +445,15 @@ $(eval $(call gb_Library_add_defs,vcl,\
 $(eval $(call gb_Library_add_exception_objects,vcl,\
 	$(vcl_generic_code) \
     vcl/unx/generic/plugadapt/salplug \
-    vcl/unx/generic/printer/cupsmgr \
     vcl/unx/generic/printer/jobdata \
     vcl/unx/generic/printer/ppdparser \
-    vcl/unx/generic/printer/printerinfomanager \
+    $(if $(filter YES,$(ENABLE_CUPS)),\
+        vcl/unx/generic/printer/cupsmgr \
+        vcl/unx/generic/printer/printerinfomanager \
+    ) \
+    $(if $(filter NO,$(ENABLE_CUPS)),\
+        vcl/null/printerinfomanager \
+    ) \
 ))
 $(eval $(call gb_Library_use_externals,vcl,\
 	fontconfig \
diff --git a/vcl/null/printerinfomanager.cxx b/vcl/null/printerinfomanager.cxx
index 526a936..d606c41 100644
--- a/vcl/null/printerinfomanager.cxx
+++ b/vcl/null/printerinfomanager.cxx
@@ -84,6 +84,16 @@ void PrinterInfoManager::initialize()
     // ???
 }
 
+bool PrinterInfoManager::isCUPSDisabled() const
+{
+    return m_bDisableCUPS;
+}
+
+void PrinterInfoManager::setCUPSDisabled( bool bDisable )
+{
+    // cups is already disabled in config so do nothing
+}
+
 void PrinterInfoManager::listPrinters( ::std::list< OUString >& rList ) const
 {
     rList.clear();
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index e555396..9acee56 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -655,7 +655,7 @@ const PPDParser* PPDParser::getParser( const String& rFile )
         PrinterInfoManager& rMgr = PrinterInfoManager::get();
         if( rMgr.getType() == PrinterInfoManager::CUPS )
         {
-#if !defined(ANDROID) && !defined(LIBO_HEADLESS)
+#if defined HAVE_CUPS_H
             pNewParser = const_cast<PPDParser*>(static_cast<CUPSManager&>(rMgr).createCUPSParser( aFile ));
 #endif
         }
-- 
1.7.3.4


--nextPart4155373.mSmJrr0CQL--

--nextPart668200731.yLuOF1Z6OH
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iQIcBAABAgAGBQJPp7ZzAAoJEOSiRoyO7jvo6JsP/jTzfSsXk0TQFkBPpisOTvzd
lNRdvt5SVO4FurXe2jkIzbCs/5k4hjAg/i82wzkqA0xAIgpXvb46i9FgehL02Icr
IOceJOI7oCBeCQU/qH8AV/z3cUihDwcj39B6uyVmyVi3L08FBJXP0Tdk0iGhewk3
iGwasGFVbZ1kJcGSKP/0u5Gfl71WAKzjETyjqedLtj9MxrMK3GBc0XvnJ7+eiGBI
jWGpqHxjpdRgcOfdf6dxH6u0LGV9TvpmiJUGlx3SzMh6tnwAama4Lz5mY6qJ39NO
6I+hCwXcIZ737QBYvUSj9lCcVSUU0xsC/JJwdBKt5oQxh1G/qH/20FVfB4mh/cSB
vLP2Lk54JqmUgtk0HdrCyk4vRU9q5DnnYuloQsD1oil9gtyWMIOB1b5FFnDzYkhd
UG0qr0LMZXtt9JsyXo8ZB3ZD5xq2LTzlUUN0u9vf1nGsJCjWLo/9K9vixOT0umcQ
3U98QGzxZDK4sN3w2/SGHoRdQyZlNWKBeNquB+Ekvq1/xvpvycvAJ2oyug28UoFB
xY6P+0lkOT/529xnd6DdvRm1ZWY064coa7VE+BM06T1wPjfDWEgTPzZi1Dv2vgNd
eqxA6geIxK1LvALlgvHjA1UYpkbVE+O1Hq9kB+hq4SLYICrmpgKDdZ/jG1nbRplh
A8s99DBzEbMCa6UWQMZF
=S7gg
-----END PGP SIGNATURE-----

--nextPart668200731.yLuOF1Z6OH--



More information about the LibreOffice mailing list