Advertisement
tasuku

Untitled

Oct 17th, 2015
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 7.31 KB | None | 0 0
  1. --- src/corelib/global/global.pri
  2. +++ src/corelib/global/global.pri
  3. @@ -44,6 +44,10 @@ if(linux*|hurd*):!cross_compile:!static:!*-armcc* {
  4.     DEFINES += ELF_INTERPRETER=\\\"$$system(LC_ALL=C readelf -l /bin/ls | perl -n -e \'$$prog\')\\\"
  5.  }
  6.  
  7. +debug_buffer {
  8. +    DEFINES += QT_USE_DEBUG_BUFFER
  9. +}
  10. +
  11.  slog2 {
  12.      LIBS_PRIVATE += -lslog2
  13.      DEFINES += QT_USE_SLOG2
  14. --- src/corelib/global/qlogging.cpp
  15. +++ src/corelib/global/qlogging.cpp
  16. @@ -1499,7 +1499,7 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con
  17.          return;
  18.  
  19.      if (!qt_logging_to_console()) {
  20. -#if defined(Q_OS_WIN)
  21. +#if defined(QT_USE_DEBUG_BUFFER)
  22.          logMessage.append(QLatin1Char('\n'));
  23.          OutputDebugString(reinterpret_cast<const wchar_t *>(logMessage.utf16()));
  24.          return;
  25. --- tools/configure/configureapp.cpp
  26. +++ tools/configure/configureapp.cpp
  27. @@ -185,7 +185,8 @@ Configure::Configure(int& argc, char** argv) : verbose(0)
  28.      dictionary[ "QT_EVENTFD" ]      = "auto";
  29.      dictionary[ "QT_CUPS" ]         = "auto";
  30.      dictionary[ "CFG_GCC_SYSROOT" ] = "yes";
  31. -    dictionary[ "SLOG2" ]           = "no";
  32. +    dictionary[ "LOGGING_BACKEND" ] = "debug buffer";
  33. +    dictionary["OBSOLETE_LOGGING_BACKEND_ARG"] = "no";
  34.      dictionary[ "QNX_IMF" ]         = "no";
  35.      dictionary[ "PPS" ]             = "no";
  36.      dictionary[ "LGMON" ]           = "no";
  37. @@ -935,9 +936,11 @@ void Configure::parseCmdLine()
  38.          } else if (configCmdLine.at(i) == "-plugin-manifests") {
  39.              dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
  40.          } else if (configCmdLine.at(i) == "-no-slog2") {
  41. -            dictionary[ "SLOG2" ] = "no";
  42. +            dictionary[ "OBSOLETE_LOGGING_BACKEND_ARG" ] = "-no-slog2";
  43. +            dictionary[ "LOGGING_BACKEND" ] = "stderr";
  44.          } else if (configCmdLine.at(i) == "-slog2") {
  45. -            dictionary[ "SLOG2" ] = "yes";
  46. +            dictionary[ "OBSOLETE_LOGGING_BACKEND_ARG" ] = "slog2";
  47. +            dictionary[ "LOGGING_BACKEND" ] = "slog2";
  48.          } else if (configCmdLine.at(i) == "-no-imf") {
  49.              dictionary[ "QNX_IMF" ] = "no";
  50.          } else if (configCmdLine.at(i) == "-imf") {
  51. @@ -1385,6 +1388,13 @@ void Configure::parseCmdLine()
  52.              dictionary[ "ANDROID_STYLE_ASSETS" ] = "yes";
  53.          }
  54.  
  55. +        else if (configCmdLine.at(i) == "-logging-backend") {
  56. +            i++;
  57. +            if (i == argCount)
  58. +                break;
  59. +            dictionary[ "LOGGING_BACKEND" ] = configCmdLine.at(i);
  60. +        }
  61. +
  62.          else {
  63.              dictionary[ "DONE" ] = "error";
  64.              cout << "Unknown option " << configCmdLine.at(i) << endl;
  65. @@ -1734,8 +1744,8 @@ void Configure::applySpecSpecifics()
  66.  
  67.          dictionary["DECORATIONS"]           = "default windows styled";
  68.      } else if ((platform() == QNX) || (platform() == BLACKBERRY)) {
  69. +        dictionary["LOGGING_BACKEND"]        = "slog2";
  70.          dictionary["STACK_PROTECTOR_STRONG"] = "auto";
  71. -        dictionary["SLOG2"]                 = "auto";
  72.          dictionary["QNX_IMF"]               = "auto";
  73.          dictionary["PPS"]                   = "auto";
  74.          dictionary["LGMON"]                 = "auto";
  75. @@ -1976,9 +1986,12 @@ bool Configure::displayHelp()
  76.                                                          "by setting the QT_HARFBUZZ environment variable to \"old\".\n"
  77.                                                          "See http://www.harfbuzz.org\n");
  78.  
  79. +        desc(                "-logging-backend <type>",
  80. +                             qPrintable(QStringLiteral("Send logging output to backend <type>.\n"
  81. +                                                       "Valid values are: debug buffer, slog2, stderr\n"
  82. +                                                       "(Default: %1)\n").arg(dictionary[ "LOGGING_BACKEND"])));
  83. +
  84.          if ((platform() == QNX) || (platform() == BLACKBERRY)) {
  85. -            desc("SLOG2", "yes",  "-slog2",             "Compile with slog2 support.");
  86. -            desc("SLOG2", "no",  "-no-slog2",           "Do not compile with slog2 support.");
  87.              desc("QNX_IMF", "yes",  "-imf",             "Compile with imf support.");
  88.              desc("QNX_IMF", "no",  "-no-imf",           "Do not compile with imf support.");
  89.              desc("PPS", "yes",  "-pps",                 "Compile with PPS support.");
  90. @@ -2550,10 +2563,6 @@ void Configure::autoDetection()
  91.      if (dictionary["STACK_PROTECTOR_STRONG"] == "auto")
  92.          dictionary["STACK_PROTECTOR_STRONG"] = checkAvailability("STACK_PROTECTOR_STRONG") ? "yes" : "no";
  93.  
  94. -    if ((platform() == QNX || platform() == BLACKBERRY) && dictionary["SLOG2"] == "auto") {
  95. -        dictionary["SLOG2"] = checkAvailability("SLOG2") ? "yes" : "no";
  96. -    }
  97. -
  98.      if ((platform() == QNX || platform() == BLACKBERRY) && dictionary["QNX_IMF"] == "auto") {
  99.          dictionary["QNX_IMF"] = checkAvailability("QNX_IMF") ? "yes" : "no";
  100.      }
  101. @@ -2706,6 +2715,13 @@ bool Configure::verifyConfiguration()
  102.          }
  103.      }
  104.  
  105. +    if (dictionary["LOGGING_BACKEND"] == "slog2") {
  106. +        if (!checkAvailability("SLOG2")) {
  107. +            cout << "ERROR: slog2 is not available." << endl;
  108. +            dictionary[ "DONE" ] = "error";
  109. +        }
  110. +    }
  111. +
  112.      if (prompt)
  113.          promptKeyPress();
  114.  
  115. @@ -3509,7 +3525,9 @@ void Configure::generateQConfigPri()
  116.          if (dictionary["CROSS_COMPILE"] == "yes")
  117.              configStream << " cross_compile";
  118.  
  119. -        if (dictionary[ "SLOG2" ] == "yes")
  120. +        if (dictionary[ "LOGGING_BACKEND" ] == "debug buffer")
  121. +            configStream << " debug_buffer";
  122. +        else if (dictionary[ "LOGGING_BACKEND" ] == "slog2")
  123.              configStream << " slog2";
  124.  
  125.          if (dictionary[ "QNX_IMF" ] == "yes")
  126. @@ -3872,6 +3890,7 @@ void Configure::displayConfig()
  127.      sout << "QML debugging..............." << dictionary[ "QML_DEBUG" ] << endl;
  128.      sout << "DirectWrite support........." << dictionary[ "DIRECTWRITE" ] << endl;
  129.      sout << "Use system proxies.........." << dictionary[ "SYSTEM_PROXIES" ] << endl;
  130. +    sout << "Logging backend............." << dictionary[ "LOGGING_BACKEND" ] << endl;
  131.      sout << endl;
  132.  
  133.      sout << "QPA Backends:" << endl;
  134. @@ -3890,7 +3909,6 @@ void Configure::displayConfig()
  135.      sout << "    PCRE support............" << dictionary[ "PCRE" ] << endl;
  136.      sout << "    ICU support............." << dictionary[ "ICU" ] << endl;
  137.      if ((platform() == QNX) || (platform() == BLACKBERRY)) {
  138. -        sout << "    SLOG2 support..........." << dictionary[ "SLOG2" ] << endl;
  139.          sout << "    IMF support............." << dictionary[ "QNX_IMF" ] << endl;
  140.          sout << "    PPS support............." << dictionary[ "PPS" ] << endl;
  141.          sout << "    LGMON support..........." << dictionary[ "LGMON" ] << endl;
  142. @@ -4005,6 +4023,11 @@ void Configure::displayConfig()
  143.               << "will be the same unless you are cross-compiling)." << endl
  144.               << endl;
  145.      }
  146. +    if (dictionary["OBSOLETE_LOGGING_BACKEND_ARG"] != "no") {
  147. +        sout << endl
  148. +             << "NOTE: The " << dictionary["OBSOLETE_LOGGING_BACKEND_ARG"] << " option is obsolete. Use -logging-backend." << endl
  149. +             << endl;
  150. +    }
  151.      if (!dictionary["PREFIX_COMPLAINTS"].isEmpty()) {
  152.          sout << endl
  153.               << dictionary["PREFIX_COMPLAINTS"] << endl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement