Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi guys,
please see the patch in the attachment.

I finaly got a Gentoo user to get annoyed enough by the hard requirement of 
cups. The patch itself seems pretty straight-forward and for the basic testing 
on runtime I didn't see anything broken.

Please let me know if you think that something might break or if it is ok to 
commit.

Cheers

Tom
From 48a8cece9fd85230b389996aa4efc414f6ff43f3 Mon Sep 17 00:00:00 2001
From: Dave Flogeras <dflogeras@gmail.com>
Date: Mon, 7 May 2012 10:49:41 +0200
Subject: [PATCH] Enable configure switch for cups

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

Change-Id: I2c79b5e59a514fd6a0f9adda40289e2e26af400c

Signed-off-by: Tomas Chvatal <tchvatal@suse.cz>
---
 configure.in                        |    8 ++++++++
 vcl/unx/generic/printer/cupsmgr.cxx |   22 ++++++++++++++++++----
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/configure.in b/configure.in
index 43a6544..8b5a74e 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 and thus disable printing support.])
+)
+
 AC_ARG_ENABLE(ccache,
     AS_HELP_STRING([--disable-ccache],
         [Do not try to use ccache automatically.
@@ -3597,6 +3602,9 @@ fi
 
 dnl check for cups support
 dnl ===================================================================
+if test "$enable_cups" = "no"; then
+    test_cups=no
+fi
 if test "$test_cups" = "yes"; then
     AC_MSG_CHECKING([whether cups support is present])
     AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
index a0e020a..ed976bc 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -26,6 +26,22 @@
  *
  ************************************************************************/
 
+#include "cupsmgr.hxx"
+#include "rtl/ustrbuf.hxx"
+
+#ifndef HAVE_CUPS_H // disable printing support
+
+namespace psp {
+  CUPSManager* CUPSManager::tryLoadCUPS() {
+    // Don't load anything, the printerInfoManager will take care of this
+    return 0x0;
+  }
+  const PPDParser* CUPSManager::createCUPSParser( const ::rtl::OUString& rPrinter ) {
+    return 0x0;
+  }
+}
+
+#else // HAVE_CUPS_H
 
 #include <cups/cups.h>
 #include <cups/http.h>
@@ -34,14 +50,10 @@
 
 #include <unistd.h>
 
-#include "cupsmgr.hxx"
-
 #include "osl/thread.h"
 #include "osl/diagnose.h"
 #include "osl/conditn.hxx"
 
-#include "rtl/ustrbuf.hxx"
-
 #include <algorithm>
 #include <setjmp.h>
 #include <signal.h>
@@ -1177,4 +1189,6 @@ const char* CUPSManager::authenticateUser( const char* /*pIn*/ )
     return pRet;
 }
 
+#endif // HAVE_CUPS_H
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-- 
1.7.3.4

Attachment: signature.asc
Description: This is a digitally signed message part.


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.