Enable CUPS auto detection on Windows

Detect CUPS availability automatically when cross-compiling from a Windows
host.

Change-Id: Ife9bb90732c39794a7b760ced4aaea232612fe54
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This commit is contained in:
Rafael Roquetto 2012-07-18 15:37:21 +02:00 committed by Qt by Nokia
parent af8e318b35
commit eba0efe10e

View File

@ -238,6 +238,7 @@ Configure::Configure(int& argc, char** argv)
dictionary[ "POSIX_IPC" ] = "no"; dictionary[ "POSIX_IPC" ] = "no";
dictionary[ "QT_GLIB" ] = "no"; dictionary[ "QT_GLIB" ] = "no";
dictionary[ "QT_ICONV" ] = "auto"; dictionary[ "QT_ICONV" ] = "auto";
dictionary[ "QT_CUPS" ] = "auto";
//Only used when cross compiling. //Only used when cross compiling.
dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg"; dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg";
@ -2096,6 +2097,8 @@ bool Configure::checkAvailability(const QString &part)
available = findFile("dwrite.h") && findFile("d2d1.h") && findFile("dwrite.lib"); available = findFile("dwrite.h") && findFile("d2d1.h") && findFile("dwrite.lib");
} else if (part == "ICONV") { } else if (part == "ICONV") {
available = tryCompileProject("unix/iconv") || tryCompileProject("unix/gnu-libiconv"); available = tryCompileProject("unix/iconv") || tryCompileProject("unix/gnu-libiconv");
} else if (part == "CUPS") {
available = (platform() != WINDOWS) && (platform() != WINDOWS_CE) && tryCompileProject("unix/cups");
} }
return available; return available;
@ -2199,6 +2202,10 @@ void Configure::autoDetection()
if (dictionary["QT_ICONV"] == "auto") if (dictionary["QT_ICONV"] == "auto")
dictionary["QT_ICONV"] = checkAvailability("ICONV") ? "yes" : "no"; dictionary["QT_ICONV"] = checkAvailability("ICONV") ? "yes" : "no";
// Detection of iconv support
if (dictionary["QT_CUPS"] == "auto")
dictionary["QT_CUPS"] = checkAvailability("CUPS") ? "yes" : "no";
// Mark all unknown "auto" to the default value.. // Mark all unknown "auto" to the default value..
for (QMap<QString,QString>::iterator i = dictionary.begin(); i != dictionary.end(); ++i) { for (QMap<QString,QString>::iterator i = dictionary.begin(); i != dictionary.end(); ++i) {
if (i.value() == "auto") if (i.value() == "auto")
@ -3304,6 +3311,7 @@ void Configure::displayConfig()
sout << "NIS support................." << dictionary[ "NIS" ] << endl; sout << "NIS support................." << dictionary[ "NIS" ] << endl;
sout << "Iconv support..............." << dictionary[ "QT_ICONV" ] << endl; sout << "Iconv support..............." << dictionary[ "QT_ICONV" ] << endl;
sout << "Glib support................" << dictionary[ "QT_GLIB" ] << endl; sout << "Glib support................" << dictionary[ "QT_GLIB" ] << endl;
sout << "CUPS support................" << dictionary[ "QT_CUPS" ] << endl;
if (dictionary.value(QStringLiteral("OPENGL_ES_2")) == QStringLiteral("yes")) { if (dictionary.value(QStringLiteral("OPENGL_ES_2")) == QStringLiteral("yes")) {
const QString angleDir = dictionary.value(QStringLiteral("ANGLE_DIR")); const QString angleDir = dictionary.value(QStringLiteral("ANGLE_DIR"));
if (!angleDir.isEmpty()) if (!angleDir.isEmpty())