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