[PATCH] Enable configure switch for cups
Dave Flogeras
dflogeras at gmail.com
Mon May 7 01:49:41 PDT 2012
This allows us not to have cups during the build time of libreoffice.
Change-Id: I2c79b5e59a514fd6a0f9adda40289e2e26af400c
Signed-off-by: Tomas Chvatal <tchvatal at 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
--nextPart1510023.MI223PjTLS--
--nextPart3028576.fq71Jop6pD
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)
iQIcBAABAgAGBQJPp452AAoJEOSiRoyO7jvoeFIP/3VX9ZPt7IlzQuXE5Yl9wra9
4HYt2UEzjj01d+iUGk75DY6WhUOz9LsYwrzb5Z8YsbOBLPC7stOcZys8/CoIXqLF
ASegFyeIzKAXwuJUNMctWxrOxNmvgLFed52fDA1Y3b9eZ/C2H0qvCpGryJbSMLur
HmJGD3BfROUxD6ij3txh2gGMBzXXWv7XqBUJssuys1m9J6BniKc78U6BP2/SHlo3
HwiD0Q1prwUu526hElT1VIFlIIqwu5YENj1P+hbNjNcA51oAFRsTs5torDeGM1n/
c6HkDinOKefeGAIEjik2pJDRGlSfGwjzpv07cKeyQoD90zHRuiom8qkIfi9PWjiY
Fo62SDN0LTdrvDKVbM3Qao9s9JCD6umPuibqG/ruhhxWKoxMmFNxOZQQ1zlzAT0l
ciLBzPCDawS+wazdlGh8mG5uzXM3ZORkzeyyPMZVxfW93BXUvOfAgQHZCScpxTuw
fe9IhoQGQQHzSRTkuYHSBtNilWXgn+f+NYJs1ZXGzs7SKwF2thFsLmmqeYQzdhQ+
rjuursVLl01oy1JAAvhG+WGl7DEkPq160fbAgYc4+DGSo+ImQm83jjybTemOi+Nr
Q161uaRI0m5piWHKQf15SKfOBIIAWuZ8PvTm75ay8qDe+SicKAkYB7BFRvAnqYGi
MrGd2Hd7tyQj6BtbcS+j
=2u1T
-----END PGP SIGNATURE-----
--nextPart3028576.fq71Jop6pD--
More information about the LibreOffice
mailing list