diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 1b2f147df595..2d35152eb0b8 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -2594,9 +2594,6 @@ endif # ENABLE_CPDB ifeq ($(ENABLE_CUPS),TRUE) define gb_LinkTarget__use_cups -$(call gb_LinkTarget_add_defs,$(1),\ - -DENABLE_CUPS \ -) $(call gb_LinkTarget_add_libs,$(1),\ -lcups \ diff --git a/config_host/config_cups.h.in b/config_host/config_cups.h.in new file mode 100644 index 000000000000..5dd46d67ba49 --- /dev/null +++ b/config_host/config_cups.h.in @@ -0,0 +1,14 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#define ENABLE_CUPS 0 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configure.ac b/configure.ac index 98ec7071cba1..f441745f0b4b 100644 --- a/configure.ac +++ b/configure.ac @@ -6421,6 +6421,7 @@ if test "$test_cups" = yes -a "$enable_cups" != no; then if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.]) fi + AC_DEFINE([ENABLE_CUPS],[1]) else AC_MSG_RESULT([no]) fi @@ -15722,6 +15723,7 @@ AC_CONFIG_HEADERS([config_host/config_box2d.h]) AC_CONFIG_HEADERS([config_host/config_clang.h]) AC_CONFIG_HEADERS([config_host/config_cpdb.h]) AC_CONFIG_HEADERS([config_host/config_crypto.h]) +AC_CONFIG_HEADERS([config_host/config_cups.h]) AC_CONFIG_HEADERS([config_host/config_dconf.h]) AC_CONFIG_HEADERS([config_host/config_eot.h]) AC_CONFIG_HEADERS([config_host/config_extensions.h]) diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index cda747e3d9b0..db88eaa72b40 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -44,10 +44,6 @@ $(eval $(call gb_Library_set_include,sfx,\ $(eval $(call gb_Library_add_defs,sfx,-DSFX2_DLLIMPLEMENTATION)) -$(eval $(call gb_Library_add_defs,sfx,\ - $(if $(filter TRUE,$(ENABLE_CUPS)),-DENABLE_CUPS) \ -)) - $(eval $(call gb_Library_use_libraries,sfx,\ basegfx \ comphelper \ diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 40ba184603da..cc16c4f563bb 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -19,6 +19,7 @@ #include #include +#include #include @@ -55,7 +56,7 @@ #include #include -#ifdef ENABLE_CUPS +#if ENABLE_CUPS #include #endif @@ -568,7 +569,7 @@ const PPDParser* PPDParser::getParser( const OUString& rFile ) PrinterInfoManager& rMgr = PrinterInfoManager::get(); if( rMgr.getType() == PrinterInfoManager::Type::CUPS ) { -#ifdef ENABLE_CUPS +#if ENABLE_CUPS pNewParser = const_cast(static_cast(rMgr).createCUPSParser( aFile )); #endif } else if ( rMgr.getType() == PrinterInfoManager::Type::CPD ) @@ -617,7 +618,7 @@ PPDParser::PPDParser(OUString aFile, const std::vector& keys) if ( pKey ) { std::unique_ptr pImageableAreas(new PPDKey(u"ImageableArea"_ustr)); std::unique_ptr pPaperDimensions(new PPDKey(u"PaperDimension"_ustr)); -#ifdef ENABLE_CUPS +#if ENABLE_CUPS for (int i = 0; i < pKey->countValues(); i++) { const PPDValue* pValue = pKey -> getValue(i); OUString aValueName = pValue -> m_aOption;