configure.exe: add inotify auto detection support
authorRafael Roquetto <rafael.roquetto.qnx@kdab.com>
Wed, 14 Nov 2012 16:33:16 +0000 (14:33 -0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 16 Nov 2012 14:59:20 +0000 (15:59 +0100)
This patch complements already existing functionality in the configure shell
script.

Change-Id: I09f4875cbe7ec60d36bb33774d28944a34cc8470
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
tools/configure/configureapp.cpp

index dfc3d21..239060e 100644 (file)
@@ -240,6 +240,7 @@ Configure::Configure(int& argc, char** argv)
     dictionary[ "POSIX_IPC" ]       = "no";
     dictionary[ "QT_GLIB" ]         = "no";
     dictionary[ "QT_ICONV" ]        = "auto";
+    dictionary[ "QT_INOTIFY" ]      = "auto";
     dictionary[ "QT_CUPS" ]         = "auto";
     dictionary[ "CFG_GCC_SYSROOT" ] = "yes";
     dictionary[ "SLOG2" ]           = "no";
@@ -1182,6 +1183,12 @@ void Configure::parseCmdLine()
             dictionary["QT_ICONV"] = "gnu";
         }
 
+        else if (configCmdLine.at(i) == "-inotify") {
+            dictionary["QT_INOTIFY"] = "yes";
+        } else if (configCmdLine.at(i) == "-no-inotify") {
+            dictionary["QT_INOTIFY"] = "no";
+        }
+
         else if (configCmdLine.at(i) == "-neon") {
             dictionary["NEON"] = "yes";
         } else if (configCmdLine.at(i) == "-no-neon") {
@@ -1684,6 +1691,9 @@ bool Configure::displayHelp()
         desc("QT_ICONV",    "yes",     "-sun-iconv",    "Enable support for iconv(3) using sun-iconv.");
         desc("QT_ICONV",    "yes",     "-gnu-iconv",    "Enable support for iconv(3) using gnu-libiconv.\n");
 
+        desc("QT_INOTIFY",  "yes",     "-inotify",      "Explicitly enable Qt inotify(7) support.");
+        desc("QT_INOTIFY",  "no",      "-no-inotify",   "Explicitly disable Qt inotify(7) support.\n");
+
         desc("LARGE_FILE",  "yes",     "-largefile",    "Enables Qt to access files larger than 4 GB.\n");
 
         desc("FONT_CONFIG", "yes",     "-fontconfig",   "Build with FontConfig support.");
@@ -2072,6 +2082,8 @@ bool Configure::checkAvailability(const QString &part)
         available = findFile("dwrite.h") && findFile("d2d1.h") && findFile("dwrite.lib");
     } else if (part == "ICONV") {
         available = tryCompileProject("unix/iconv") || tryCompileProject("unix/gnu-libiconv");
+    } else if (part == "INOTIFY") {
+        available = tryCompileProject("unix/inotify");
     } else if (part == "CUPS") {
         available = (platform() != WINDOWS) && (platform() != WINDOWS_CE) && tryCompileProject("unix/cups");
     } else if (part == "STACK_PROTECTOR_STRONG") {
@@ -2196,6 +2208,10 @@ void Configure::autoDetection()
     if (dictionary["QT_ICONV"] == "auto")
         dictionary["QT_ICONV"] = checkAvailability("ICONV") ? "yes" : "no";
 
+    // Detection of inotify
+    if (dictionary["QT_INOTIFY"] == "auto")
+        dictionary["QT_INOTIFY"] = checkAvailability("INOTIFY") ? "yes" : "no";
+
     // Detection of cups support
     if (dictionary["QT_CUPS"] == "auto")
         dictionary["QT_CUPS"] = checkAvailability("CUPS") ? "yes" : "no";
@@ -3349,6 +3365,7 @@ void Configure::displayConfig()
     sout << "Large File support.........." << dictionary[ "LARGE_FILE" ] << endl;
     sout << "NIS support................." << dictionary[ "NIS" ] << endl;
     sout << "Iconv support..............." << dictionary[ "QT_ICONV" ] << endl;
+    sout << "Inotify support............." << dictionary[ "QT_INOTIFY" ] << endl;
     sout << "Glib support................" << dictionary[ "QT_GLIB" ] << endl;
     sout << "CUPS support................" << dictionary[ "QT_CUPS" ] << endl;
     sout << "OpenVG support.............." << dictionary[ "OPENVG" ] << endl;