Kaydet (Commit) 68ffb332 authored tarafından Caolán McNamara's avatar Caolán McNamara

nothing propagates HAVE_CUPS_H so cups is always disabled

regression from 22f2e5f2

so, lets follow the same pattern as else where and fixup
ENABLE_CUPS to be TRUE when enabled and lets just link
against cups and not do the dlopen dance

Change-Id: I3cff1bd98a7474c403d7ff66183e76e26e407de8
üst c20ba023
...@@ -1219,6 +1219,26 @@ $(call gb_LinkTarget_add_libs,$(1),$(GTHREAD_LIBS)) ...@@ -1219,6 +1219,26 @@ $(call gb_LinkTarget_add_libs,$(1),$(GTHREAD_LIBS))
endef endef
ifeq ($(ENABLE_CUPS),TRUE)
define gb_LinkTarget__use_cups
$(call gb_LinkTarget_add_defs,$(1),\
-DENABLE_CUPS \
)
$(call gb_LinkTarget_add_libs,$(1),\
-lcups \
)
endef
else # ENABLE_CUPS
define gb_LinkTarget__use_cups
endef
endif # ENABLE_DBUS
ifeq ($(ENABLE_DBUS),TRUE) ifeq ($(ENABLE_DBUS),TRUE)
......
...@@ -4109,32 +4109,32 @@ if test "$enable_headless" = "yes"; then ...@@ -4109,32 +4109,32 @@ if test "$enable_headless" = "yes"; then
enable_gnome_vfs=no enable_gnome_vfs=no
fi fi
dnl ===================================================================
dnl check for cups support dnl check for cups support
dnl =================================================================== dnl ===================================================================
ENABLE_CUPS=""
if test "$enable_cups" = "no"; then if test "$enable_cups" = "no"; then
test_cups=no test_cups=no
ENABLE_CUPS="NO"
elif test "$enable_cups" = "yes"; then
if test $_os = iOS -o $_os = Android; then
AC_MSG_ERROR([CUPS makes no sense for $_os])
fi
ENABLE_CUPS="YES"
elif test $_os = iOS -o $_os = Android; then
ENABLE_CUPS=NO
else
ENABLE_CUPS="YES"
fi fi
AC_SUBST(ENABLE_CUPS)
AC_MSG_CHECKING([whether to enable CUPS support])
if test "$test_cups" = "yes"; then if test "$test_cups" = "yes"; then
ENABLE_CUPS="TRUE"
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([whether cups support is present]) AC_MSG_CHECKING([whether cups support is present])
AC_CHECK_LIB([cups], [cupsPrintFiles], [:]) AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H)) AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -a "$ac_cv_header_cups_cups_h" != "yes"; then if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -a "$ac_cv_header_cups_cups_h" != "yes"; then
AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups???-devel.]) AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups-devel.])
fi fi
else
AC_MSG_RESULT([no])
fi fi
AC_SUBST(ENABLE_CUPS)
# fontconfig checks # fontconfig checks
if test "$test_fontconfig" = "yes"; then if test "$test_fontconfig" = "yes"; then
......
...@@ -498,12 +498,6 @@ $(eval $(call gb_Library_add_defs,vcl,\ ...@@ -498,12 +498,6 @@ $(eval $(call gb_Library_add_defs,vcl,\
) \ ) \
)) ))
ifeq ($(ENABLE_CUPS),YES)
$(eval $(call gb_Library_add_defs,vcl,\
-DENABLE_CUPS\
))
endif
ifeq ($(GUIBASE),unx) ifeq ($(GUIBASE),unx)
$(eval $(call gb_Library_add_defs,vcl,\ $(eval $(call gb_Library_add_defs,vcl,\
-DSAL_DLLPREFIX=\"$(gb_Library_SYSPRE)\" \ -DSAL_DLLPREFIX=\"$(gb_Library_SYSPRE)\" \
...@@ -515,15 +509,15 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ ...@@ -515,15 +509,15 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/unx/generic/plugadapt/salplug \ vcl/unx/generic/plugadapt/salplug \
vcl/unx/generic/printer/jobdata \ vcl/unx/generic/printer/jobdata \
vcl/unx/generic/printer/ppdparser \ vcl/unx/generic/printer/ppdparser \
$(if $(filter YES,$(ENABLE_CUPS)),\ $(if $(filter TRUE,$(ENABLE_CUPS)),\
vcl/unx/generic/printer/cupsmgr \ vcl/unx/generic/printer/cupsmgr \
vcl/unx/generic/printer/printerinfomanager \ vcl/unx/generic/printer/printerinfomanager, \
) \ else \
$(if $(filter NO,$(ENABLE_CUPS)),\
vcl/null/printerinfomanager \ vcl/null/printerinfomanager \
) \ ) \
)) ))
$(eval $(call gb_Library_use_externals,vcl,\ $(eval $(call gb_Library_use_externals,vcl,\
cups \
dbus \ dbus \
fontconfig \ fontconfig \
freetype \ freetype \
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
namespace psp namespace psp
{ {
class CUPSWrapper;
class PPDParser; class PPDParser;
struct FPtrHash struct FPtrHash
...@@ -48,7 +47,6 @@ struct FPtrHash ...@@ -48,7 +47,6 @@ struct FPtrHash
class CUPSManager : public PrinterInfoManager class CUPSManager : public PrinterInfoManager
{ {
CUPSWrapper* m_pCUPSWrapper;
boost::unordered_map< FILE*, rtl::OString, FPtrHash > m_aSpoolFiles; boost::unordered_map< FILE*, rtl::OString, FPtrHash > m_aSpoolFiles;
int m_nDests; int m_nDests;
void* m_pDests; void* m_pDests;
...@@ -66,13 +64,17 @@ class CUPSManager : public PrinterInfoManager ...@@ -66,13 +64,17 @@ class CUPSManager : public PrinterInfoManager
osl::Mutex m_aCUPSMutex; osl::Mutex m_aCUPSMutex;
oslThread m_aDestThread; oslThread m_aDestThread;
CUPSManager( CUPSWrapper* ); osl::Mutex m_aGetPPDMutex;
bool m_bPPDThreadRunning;
CUPSManager();
virtual ~CUPSManager(); virtual ~CUPSManager();
virtual void initialize(); virtual void initialize();
void getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) const; void getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) const;
void runDests(); void runDests();
OString threadedCupsGetPPD(const char* pPrinter);
public: public:
// public for stub // public for stub
static void runDestThread(void* pMgr); static void runDestThread(void* pMgr);
......
...@@ -655,7 +655,7 @@ const PPDParser* PPDParser::getParser( const String& rFile ) ...@@ -655,7 +655,7 @@ const PPDParser* PPDParser::getParser( const String& rFile )
PrinterInfoManager& rMgr = PrinterInfoManager::get(); PrinterInfoManager& rMgr = PrinterInfoManager::get();
if( rMgr.getType() == PrinterInfoManager::CUPS ) if( rMgr.getType() == PrinterInfoManager::CUPS )
{ {
#ifdef HAVE_CUPS_H #ifdef ENABLE_CUPS
pNewParser = const_cast<PPDParser*>(static_cast<CUPSManager&>(rMgr).createCUPSParser( aFile )); pNewParser = const_cast<PPDParser*>(static_cast<CUPSManager&>(rMgr).createCUPSParser( aFile ));
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment