Kaydet (Commit) 7b4825af authored tarafından François Tigeot's avatar François Tigeot

Enable CUPS unconditionally

It doesn't make sense to try to use anything else to print on *nix
systems these days
üst f2079a12
...@@ -180,10 +180,6 @@ AC_ARG_ENABLE(evolution2, ...@@ -180,10 +180,6 @@ AC_ARG_ENABLE(evolution2,
[Allows the built-in evolution 2 addressbook connectivity build to be [Allows the built-in evolution 2 addressbook connectivity build to be
enabled.])) enabled.]))
AC_ARG_ENABLE(cups,
AS_HELP_STRING([--disable-cups],
[Disable cups support in the psprint project.]))
AC_ARG_ENABLE(directx, AC_ARG_ENABLE(directx,
AS_HELP_STRING([--disable-directx], AS_HELP_STRING([--disable-directx],
[Remove DirectX implementation for the new XCanvas interface. [Remove DirectX implementation for the new XCanvas interface.
...@@ -1461,7 +1457,6 @@ dnl These values may be checked and reset later. ...@@ -1461,7 +1457,6 @@ dnl These values may be checked and reset later.
dnl =================================================================== dnl ===================================================================
#defaults unless the os test overrides this: #defaults unless the os test overrides this:
test_randr=yes test_randr=yes
test_cups=yes
test_fontconfig=yes test_fontconfig=yes
case "$host_os" in case "$host_os" in
...@@ -1511,7 +1506,6 @@ linux-gnu*|k*bsd*-gnu*) ...@@ -1511,7 +1506,6 @@ linux-gnu*|k*bsd*-gnu*)
gnu) gnu)
test_randr=no test_randr=no
test_cups=no
_os=GNU _os=GNU
;; ;;
...@@ -1532,7 +1526,6 @@ cygwin*|interix*|mingw32*) ...@@ -1532,7 +1526,6 @@ cygwin*|interix*|mingw32*)
# is "mingw32" (because in that case it is the MinGW # is "mingw32" (because in that case it is the MinGW
# tool-chain that is used). # tool-chain that is used).
test_cups=no
test_randr=no test_randr=no
test_freetype=no test_freetype=no
test_fontconfig=no test_fontconfig=no
...@@ -1608,7 +1601,6 @@ freebsd*) ...@@ -1608,7 +1601,6 @@ freebsd*)
;; ;;
aix*) aix*)
test_cups=no
test_randr=no test_randr=no
test_freetype=yes test_freetype=yes
PTHREAD_LIBS=-pthread PTHREAD_LIBS=-pthread
...@@ -1636,7 +1628,6 @@ dragonfly*) ...@@ -1636,7 +1628,6 @@ dragonfly*)
androideabi*) androideabi*)
build_gstreamer=no build_gstreamer=no
test_cups=no
test_fontconfig=no test_fontconfig=no
test_freetype=no test_freetype=no
test_gtk=no test_gtk=no
...@@ -2279,20 +2270,12 @@ AC_SUBST(DISABLE_STRIP) ...@@ -2279,20 +2270,12 @@ AC_SUBST(DISABLE_STRIP)
dnl check for cups support dnl check for cups support
dnl =================================================================== dnl ===================================================================
AC_MSG_CHECKING([whether to enable native cups support]) AC_MSG_CHECKING([whether cups support is present])
if test "$test_cups" = "yes" -a "z$enable_cups" != "zno"; then AC_CHECK_LIB(cups, cupsPrintFiles)
ENABLE_CUPS="TRUE" AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
AC_MSG_RESULT([yes]) if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -a "$ac_cv_header_cups_cups_h" != "yes"; then
AC_CHECK_LIB(cups, cupsPrintFiles) AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups???-devel.])
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
AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups???-devel.])
fi
else
ENABLE_CUPS=""
AC_MSG_RESULT([no])
fi fi
AC_SUBST(ENABLE_CUPS)
# check for fontconfig support # check for fontconfig support
...@@ -5939,9 +5922,6 @@ if test "$_os" = "Darwin"; then ...@@ -5939,9 +5922,6 @@ if test "$_os" = "Darwin"; then
x_libraries="no_x_libraries" x_libraries="no_x_libraries"
dnl disable some things used on other Unix versions but not on the aqua build dnl disable some things used on other Unix versions but not on the aqua build
enable_gtk=no enable_gtk=no
enable_cups=no
ENABLE_CUPS=""
AC_SUBST(ENABLE_CUPS)
else else
AC_MSG_ERROR([No AppKit.framewrok found]) AC_MSG_ERROR([No AppKit.framewrok found])
fi fi
......
--host=arm-linux-androideabi --host=arm-linux-androideabi
--disable-cups
--disable-gconf --disable-gconf
--disable-gnome-vfs --disable-gnome-vfs
--disable-gstreamer --disable-gstreamer
......
--build=i386-apple-darwin10.7.0 --build=i386-apple-darwin10.7.0
--host=arm-apple-darwin10 --host=arm-apple-darwin10
--disable-cairo --disable-cairo
--disable-cups
--disable-fontconfig --disable-fontconfig
--disable-gconf --disable-gconf
--disable-gnome-vfs --disable-gnome-vfs
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
--without-system-mozilla --without-system-mozilla
--with-package-format=rpm deb --with-package-format=rpm deb
--enable-epm --enable-epm
--enable-cups
--disable-symbols --disable-symbols
--enable-systray --enable-systray
--with-epm=internal --with-epm=internal
......
...@@ -1847,7 +1847,6 @@ ToFile( "ENABLE_SYMBOLS", "@ENABLE_SYMBOLS@", "e" ); ...@@ -1847,7 +1847,6 @@ ToFile( "ENABLE_SYMBOLS", "@ENABLE_SYMBOLS@", "e" );
ToFile( "DISABLE_STRIP", "@DISABLE_STRIP@", "e" ); ToFile( "DISABLE_STRIP", "@DISABLE_STRIP@", "e" );
ToFile( "LFS_CFLAGS", "@LFS_CFLAGS@", "e" ); ToFile( "LFS_CFLAGS", "@LFS_CFLAGS@", "e" );
ToFile( "ENABLE_CRASHDUMP", "@ENABLE_CRASHDUMP@", "e" ); ToFile( "ENABLE_CRASHDUMP", "@ENABLE_CRASHDUMP@", "e" );
ToFile( "ENABLE_CUPS", "@ENABLE_CUPS@", "e" );
ToFile( "ENABLE_RANDR", "@ENABLE_RANDR@", "e" ); ToFile( "ENABLE_RANDR", "@ENABLE_RANDR@", "e" );
ToFile( "ENABLE_FONTCONFIG", "@ENABLE_FONTCONFIG@", "e" ); ToFile( "ENABLE_FONTCONFIG", "@ENABLE_FONTCONFIG@", "e" );
ToFile( "FONTCONFIG_LIBS", "@FONTCONFIG_LIBS@", "e"); ToFile( "FONTCONFIG_LIBS", "@FONTCONFIG_LIBS@", "e");
......
...@@ -397,9 +397,6 @@ $(eval $(call gb_Library_add_defs,vcl,\ ...@@ -397,9 +397,6 @@ $(eval $(call gb_Library_add_defs,vcl,\
-DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \ -DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \
-D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \ -D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \
)) ))
$(eval $(call gb_Library_add_defs,vcl,\
$(if $(ENABLE_CUPS),-DENABLE_CUPS) \
))
$(eval $(call gb_Library_add_exception_objects,vcl,\ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/unx/generic/glyphs/gcach_ftyp \ vcl/unx/generic/glyphs/gcach_ftyp \
vcl/unx/generic/glyphs/gcach_layout \ vcl/unx/generic/glyphs/gcach_layout \
......
...@@ -29,16 +29,9 @@ ...@@ -29,16 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove // MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx" #include "precompiled_vcl.hxx"
#ifdef ENABLE_CUPS
#include <cups/cups.h> #include <cups/cups.h>
#include <cups/ppd.h> #include <cups/ppd.h>
#else // !ENABLE_CUPS
typedef void ppd_file_t;
typedef void cups_dest_t;
typedef void cups_option_t;
#endif
#include <unistd.h> #include <unistd.h>
#include "cupsmgr.hxx" #include "cupsmgr.hxx"
...@@ -165,7 +158,6 @@ CUPSWrapper::CUPSWrapper() ...@@ -165,7 +158,6 @@ CUPSWrapper::CUPSWrapper()
: m_pLib( NULL ), : m_pLib( NULL ),
m_bPPDThreadRunning( false ) m_bPPDThreadRunning( false )
{ {
#ifdef ENABLE_CUPS
OUString aLib( RTL_CONSTASCII_USTRINGPARAM( CUPS_LIB_NAME ) ); OUString aLib( RTL_CONSTASCII_USTRINGPARAM( CUPS_LIB_NAME ) );
m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY ); m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY );
if( ! m_pLib ) if( ! m_pLib )
...@@ -173,7 +165,6 @@ CUPSWrapper::CUPSWrapper() ...@@ -173,7 +165,6 @@ CUPSWrapper::CUPSWrapper()
aLib = OUString( RTL_CONSTASCII_USTRINGPARAM( SAL_MODULENAME( "cups" ) ) ); aLib = OUString( RTL_CONSTASCII_USTRINGPARAM( SAL_MODULENAME( "cups" ) ) );
m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY ); m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY );
} }
#endif
if( ! m_pLib ) if( ! m_pLib )
{ {
...@@ -357,7 +348,6 @@ OString CUPSWrapper::cupsGetPPD( const char* pPrinter ) ...@@ -357,7 +348,6 @@ OString CUPSWrapper::cupsGetPPD( const char* pPrinter )
return aResult; return aResult;
} }
#ifdef ENABLE_CUPS
static const char* setPasswordCallback( const char* pIn ) static const char* setPasswordCallback( const char* pIn )
{ {
const char* pRet = NULL; const char* pRet = NULL;
...@@ -367,7 +357,6 @@ static const char* setPasswordCallback( const char* pIn ) ...@@ -367,7 +357,6 @@ static const char* setPasswordCallback( const char* pIn )
pRet = static_cast<CUPSManager&>(rMgr).authenticateUser( pIn ); pRet = static_cast<CUPSManager&>(rMgr).authenticateUser( pIn );
return pRet; return pRet;
} }
#endif
/* /*
* CUPSManager class * CUPSManager class
...@@ -376,7 +365,6 @@ static const char* setPasswordCallback( const char* pIn ) ...@@ -376,7 +365,6 @@ static const char* setPasswordCallback( const char* pIn )
CUPSManager* CUPSManager::tryLoadCUPS() CUPSManager* CUPSManager::tryLoadCUPS()
{ {
CUPSManager* pManager = NULL; CUPSManager* pManager = NULL;
#ifdef ENABLE_CUPS
static const char* pEnv = getenv( "SAL_DISABLE_CUPS" ); static const char* pEnv = getenv( "SAL_DISABLE_CUPS" );
if( ! pEnv || ! *pEnv ) if( ! pEnv || ! *pEnv )
...@@ -388,7 +376,6 @@ CUPSManager* CUPSManager::tryLoadCUPS() ...@@ -388,7 +376,6 @@ CUPSManager* CUPSManager::tryLoadCUPS()
else else
delete pWrapper; delete pWrapper;
} }
#endif
return pManager; return pManager;
} }
...@@ -499,7 +486,6 @@ void CUPSManager::initialize() ...@@ -499,7 +486,6 @@ void CUPSManager::initialize()
// get normal printers, clear printer list // get normal printers, clear printer list
PrinterInfoManager::initialize(); PrinterInfoManager::initialize();
#ifdef ENABLE_CUPS
// check whether thread has completed // check whether thread has completed
// if not behave like old printing system // if not behave like old printing system
osl::MutexGuard aGuard( m_aCUPSMutex ); osl::MutexGuard aGuard( m_aCUPSMutex );
...@@ -634,10 +620,8 @@ void CUPSManager::initialize() ...@@ -634,10 +620,8 @@ void CUPSManager::initialize()
} }
m_pCUPSWrapper->cupsSetPasswordCB( setPasswordCallback ); m_pCUPSWrapper->cupsSetPasswordCB( setPasswordCallback );
#endif // ENABLE_CUPS
} }
#ifdef ENABLE_CUPS
static void updatePrinterContextInfo( ppd_group_t* pPPDGroup, PPDContext& rContext ) static void updatePrinterContextInfo( ppd_group_t* pPPDGroup, PPDContext& rContext )
{ {
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding(); rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
...@@ -687,7 +671,6 @@ static void updatePrinterContextInfo( ppd_group_t* pPPDGroup, PPDContext& rConte ...@@ -687,7 +671,6 @@ static void updatePrinterContextInfo( ppd_group_t* pPPDGroup, PPDContext& rConte
updatePrinterContextInfo( pPPDGroup->subgroups + g, rContext ); updatePrinterContextInfo( pPPDGroup->subgroups + g, rContext );
} }
} }
#endif // ENABLE_CUPS
const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter ) const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter )
{ {
...@@ -699,7 +682,6 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter ) ...@@ -699,7 +682,6 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter )
else else
aPrinter = rPrinter; aPrinter = rPrinter;
#ifdef ENABLE_CUPS
if( m_aCUPSMutex.tryToAcquire() ) if( m_aCUPSMutex.tryToAcquire() )
{ {
if( m_nDests && m_pDests && ! isCUPSDisabled() ) if( m_nDests && m_pDests && ! isCUPSDisabled() )
...@@ -776,7 +758,6 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter ) ...@@ -776,7 +758,6 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter )
else else
fprintf( stderr, "could not acquire CUPS mutex !!!\n" ); fprintf( stderr, "could not acquire CUPS mutex !!!\n" );
#endif #endif
#endif // ENABLE_CUPS
if( ! pNewParser ) if( ! pNewParser )
{ {
...@@ -792,14 +773,8 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter ) ...@@ -792,14 +773,8 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter )
return pNewParser; return pNewParser;
} }
void CUPSManager::setupJobContextData( void CUPSManager::setupJobContextData( JobData& rData )
JobData&
#ifdef ENABLE_CUPS
rData
#endif
)
{ {
#ifdef ENABLE_CUPS
boost::unordered_map< OUString, int, OUStringHash >::iterator dest_it = boost::unordered_map< OUString, int, OUStringHash >::iterator dest_it =
m_aCUPSDestMap.find( rData.m_aPrinterName ); m_aCUPSDestMap.find( rData.m_aPrinterName );
...@@ -835,7 +810,6 @@ void CUPSManager::setupJobContextData( ...@@ -835,7 +810,6 @@ void CUPSManager::setupJobContextData(
rData.m_pParser = p_it->second.m_aInfo.m_pParser; rData.m_pParser = p_it->second.m_aInfo.m_pParser;
rData.m_aContext = p_it->second.m_aInfo.m_aContext; rData.m_aContext = p_it->second.m_aInfo.m_aContext;
#endif
} }
FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand ) FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand )
...@@ -850,7 +824,6 @@ FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand ...@@ -850,7 +824,6 @@ FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand
return PrinterInfoManager::startSpool( rPrintername, bQuickCommand ); return PrinterInfoManager::startSpool( rPrintername, bQuickCommand );
} }
#ifdef ENABLE_CUPS
OUString aTmpURL, aTmpFile; OUString aTmpURL, aTmpFile;
osl_createTempFile( NULL, NULL, &aTmpURL.pData ); osl_createTempFile( NULL, NULL, &aTmpURL.pData );
osl_getSystemPathFromFileURL( aTmpURL.pData, &aTmpFile.pData ); osl_getSystemPathFromFileURL( aTmpURL.pData, &aTmpFile.pData );
...@@ -860,9 +833,6 @@ FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand ...@@ -860,9 +833,6 @@ FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand
m_aSpoolFiles[fp] = aSysFile; m_aSpoolFiles[fp] = aSysFile;
return fp; return fp;
#else
return NULL;
#endif
} }
struct less_ppd_key : public ::std::binary_function<double, double, bool> struct less_ppd_key : public ::std::binary_function<double, double, bool>
...@@ -933,7 +903,6 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit ...@@ -933,7 +903,6 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData, bBanner ); return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData, bBanner );
} }
#ifdef ENABLE_CUPS
boost::unordered_map< FILE*, OString, FPtrHash >::const_iterator it = m_aSpoolFiles.find( pFile ); boost::unordered_map< FILE*, OString, FPtrHash >::const_iterator it = m_aSpoolFiles.find( pFile );
if( it != m_aSpoolFiles.end() ) if( it != m_aSpoolFiles.end() )
{ {
...@@ -972,7 +941,6 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit ...@@ -972,7 +941,6 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
if( pOptions ) if( pOptions )
m_pCUPSWrapper->cupsFreeOptions( nNumOptions, pOptions ); m_pCUPSWrapper->cupsFreeOptions( nNumOptions, pOptions );
} }
#endif // ENABLE_CUPS
return nJobID; return nJobID;
} }
...@@ -1060,7 +1028,6 @@ bool CUPSManager::removePrinter( const OUString& rName, bool bCheck ) ...@@ -1060,7 +1028,6 @@ bool CUPSManager::removePrinter( const OUString& rName, bool bCheck )
bool CUPSManager::setDefaultPrinter( const OUString& rName ) bool CUPSManager::setDefaultPrinter( const OUString& rName )
{ {
bool bSuccess = false; bool bSuccess = false;
#ifdef ENABLE_CUPS
boost::unordered_map< OUString, int, OUStringHash >::iterator nit = boost::unordered_map< OUString, int, OUStringHash >::iterator nit =
m_aCUPSDestMap.find( rName ); m_aCUPSDestMap.find( rName );
if( nit != m_aCUPSDestMap.end() && m_aCUPSMutex.tryToAcquire() ) if( nit != m_aCUPSDestMap.end() && m_aCUPSMutex.tryToAcquire() )
...@@ -1075,7 +1042,6 @@ bool CUPSManager::setDefaultPrinter( const OUString& rName ) ...@@ -1075,7 +1042,6 @@ bool CUPSManager::setDefaultPrinter( const OUString& rName )
bSuccess = true; bSuccess = true;
} }
else else
#endif
bSuccess = PrinterInfoManager::setDefaultPrinter( rName ); bSuccess = PrinterInfoManager::setDefaultPrinter( rName );
return bSuccess; return bSuccess;
...@@ -1083,7 +1049,6 @@ bool CUPSManager::setDefaultPrinter( const OUString& rName ) ...@@ -1083,7 +1049,6 @@ bool CUPSManager::setDefaultPrinter( const OUString& rName )
bool CUPSManager::writePrinterConfig() bool CUPSManager::writePrinterConfig()
{ {
#ifdef ENABLE_CUPS
bool bDestModified = false; bool bDestModified = false;
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding(); rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
...@@ -1131,7 +1096,6 @@ bool CUPSManager::writePrinterConfig() ...@@ -1131,7 +1096,6 @@ bool CUPSManager::writePrinterConfig()
m_pCUPSWrapper->cupsSetDests( m_nDests, (cups_dest_t*)m_pDests ); m_pCUPSWrapper->cupsSetDests( m_nDests, (cups_dest_t*)m_pDests );
m_aCUPSMutex.release(); m_aCUPSMutex.release();
} }
#endif // ENABLE_CUPS
return PrinterInfoManager::writePrinterConfig(); return PrinterInfoManager::writePrinterConfig();
} }
...@@ -1145,7 +1109,6 @@ const char* CUPSManager::authenticateUser( const char* /*pIn*/ ) ...@@ -1145,7 +1109,6 @@ const char* CUPSManager::authenticateUser( const char* /*pIn*/ )
{ {
const char* pRet = NULL; const char* pRet = NULL;
#ifdef ENABLE_CUPS
OUString aLib(RTL_CONSTASCII_USTRINGPARAM( _XSALSET_LIBNAME )); OUString aLib(RTL_CONSTASCII_USTRINGPARAM( _XSALSET_LIBNAME ));
oslModule pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY ); oslModule pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY );
if( pLib ) if( pLib )
...@@ -1173,7 +1136,6 @@ const char* CUPSManager::authenticateUser( const char* /*pIn*/ ) ...@@ -1173,7 +1136,6 @@ const char* CUPSManager::authenticateUser( const char* /*pIn*/ )
#if OSL_DEBUG_LEVEL > 1 #if OSL_DEBUG_LEVEL > 1
else fprintf( stderr, "loading of module %s failed\n", OUStringToOString( aLib, osl_getThreadTextEncoding() ).getStr() ); else fprintf( stderr, "loading of module %s failed\n", OUStringToOString( aLib, osl_getThreadTextEncoding() ).getStr() );
#endif #endif
#endif // ENABLE_CUPS
return pRet; return pRet;
} }
......
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