Advertisement
tasuku

configure: introduce -logging-backend option

Oct 17th, 2015
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.88 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,8 +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[ "LOGGING_BACKEND" ] = "auto";
  32. -    dictionary[ "SLOG2" ]           = "no";
  33. +    dictionary[ "LOGGING_BACKEND" ] = "debug buffer";
  34. +    dictionary["OBSOLETE_LOGGING_BACKEND_ARG"] = "no";
  35.      dictionary[ "QNX_IMF" ]         = "no";
  36.      dictionary[ "PPS" ]             = "no";
  37.      dictionary[ "LGMON" ]           = "no";
  38. @@ -936,9 +936,11 @@ void Configure::parseCmdLine()
  39.          } else if (configCmdLine.at(i) == "-plugin-manifests") {
  40.              dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
  41.          } else if (configCmdLine.at(i) == "-no-slog2") {
  42. -            dictionary[ "SLOG2" ] = "no";
  43. +            dictionary[ "OBSOLETE_LOGGING_BACKEND_ARG" ] = "-no-slog2";
  44. +            dictionary[ "LOGGING_BACKEND" ] = "stderr";
  45.          } else if (configCmdLine.at(i) == "-slog2") {
  46. -            dictionary[ "SLOG2" ] = "yes";
  47. +            dictionary[ "OBSOLETE_LOGGING_BACKEND_ARG" ] = "slog2";
  48. +            dictionary[ "LOGGING_BACKEND" ] = "slog2";
  49.          } else if (configCmdLine.at(i) == "-no-imf") {
  50.              dictionary[ "QNX_IMF" ] = "no";
  51.          } else if (configCmdLine.at(i) == "-imf") {
  52. @@ -1742,8 +1744,8 @@ void Configure::applySpecSpecifics()
  53.  
  54.          dictionary["DECORATIONS"]           = "default windows styled";
  55.      } else if ((platform() == QNX) || (platform() == BLACKBERRY)) {
  56. +        dictionary["LOGGING_BACKEND"]        = "slog2";
  57.          dictionary["STACK_PROTECTOR_STRONG"] = "auto";
  58. -        dictionary["SLOG2"]                 = "auto";
  59.          dictionary["QNX_IMF"]               = "auto";
  60.          dictionary["PPS"]                   = "auto";
  61.          dictionary["LGMON"]                 = "auto";
  62. @@ -1984,9 +1986,12 @@ bool Configure::displayHelp()
  63.                                                          "by setting the QT_HARFBUZZ environment variable to \"old\".\n"
  64.                                                          "See http://www.harfbuzz.org\n");
  65.  
  66. +        desc(                "-logging-backend <type>",
  67. +                             qPrintable(QStringLiteral("Send logging output to backend <type>.\n"
  68. +                                                       "Valid values are: debug buffer, slog2, stderr\n"
  69. +                                                       "(Default: %1)\n").arg(dictionary[ "LOGGING_BACKEND"])));
  70. +
  71.          if ((platform() == QNX) || (platform() == BLACKBERRY)) {
  72. -            desc("SLOG2", "yes",  "-slog2",             "Compile with slog2 support.");
  73. -            desc("SLOG2", "no",  "-no-slog2",           "Do not compile with slog2 support.");
  74.              desc("QNX_IMF", "yes",  "-imf",             "Compile with imf support.");
  75.              desc("QNX_IMF", "no",  "-no-imf",           "Do not compile with imf support.");
  76.              desc("PPS", "yes",  "-pps",                 "Compile with PPS support.");
  77. @@ -2558,10 +2563,6 @@ void Configure::autoDetection()
  78.      if (dictionary["STACK_PROTECTOR_STRONG"] == "auto")
  79.          dictionary["STACK_PROTECTOR_STRONG"] = checkAvailability("STACK_PROTECTOR_STRONG") ? "yes" : "no";
  80.  
  81. -    if ((platform() == QNX || platform() == BLACKBERRY) && dictionary["SLOG2"] == "auto") {
  82. -        dictionary["SLOG2"] = checkAvailability("SLOG2") ? "yes" : "no";
  83. -    }
  84. -
  85.      if ((platform() == QNX || platform() == BLACKBERRY) && dictionary["QNX_IMF"] == "auto") {
  86.          dictionary["QNX_IMF"] = checkAvailability("QNX_IMF") ? "yes" : "no";
  87.      }
  88. @@ -2714,6 +2715,13 @@ bool Configure::verifyConfiguration()
  89.          }
  90.      }
  91.  
  92. +    if (dictionary["LOGGING_BACKEND"] == "slog2") {
  93. +        if (!checkAvailability("SLOG2")) {
  94. +            cout << "ERROR: slog2 is not available." << endl;
  95. +            dictionary[ "DONE" ] = "error";
  96. +        }
  97. +    }
  98. +
  99.      if (prompt)
  100.          promptKeyPress();
  101.  
  102. @@ -3517,7 +3525,9 @@ void Configure::generateQConfigPri()
  103.          if (dictionary["CROSS_COMPILE"] == "yes")
  104.              configStream << " cross_compile";
  105.  
  106. -        if (dictionary[ "SLOG2" ] == "yes")
  107. +        if (dictionary[ "LOGGING_BACKEND" ] == "debug buffer")
  108. +            configStream << " debug_buffer";
  109. +        else if (dictionary[ "LOGGING_BACKEND" ] == "slog2")
  110.              configStream << " slog2";
  111.  
  112.          if (dictionary[ "QNX_IMF" ] == "yes")
  113. @@ -3880,6 +3890,7 @@ void Configure::displayConfig()
  114.      sout << "QML debugging..............." << dictionary[ "QML_DEBUG" ] << endl;
  115.      sout << "DirectWrite support........." << dictionary[ "DIRECTWRITE" ] << endl;
  116.      sout << "Use system proxies.........." << dictionary[ "SYSTEM_PROXIES" ] << endl;
  117. +    sout << "Logging backend............." << dictionary[ "LOGGING_BACKEND" ] << endl;
  118.      sout << endl;
  119.  
  120.      sout << "QPA Backends:" << endl;
  121. @@ -3898,7 +3909,6 @@ void Configure::displayConfig()
  122.      sout << "    PCRE support............" << dictionary[ "PCRE" ] << endl;
  123.      sout << "    ICU support............." << dictionary[ "ICU" ] << endl;
  124.      if ((platform() == QNX) || (platform() == BLACKBERRY)) {
  125. -        sout << "    SLOG2 support..........." << dictionary[ "SLOG2" ] << endl;
  126.          sout << "    IMF support............." << dictionary[ "QNX_IMF" ] << endl;
  127.          sout << "    PPS support............." << dictionary[ "PPS" ] << endl;
  128.          sout << "    LGMON support..........." << dictionary[ "LGMON" ] << endl;
  129. @@ -4013,6 +4023,11 @@ void Configure::displayConfig()
  130.               << "will be the same unless you are cross-compiling)." << endl
  131.               << endl;
  132.      }
  133. +    if (dictionary["OBSOLETE_LOGGING_BACKEND_ARG"] != "no") {
  134. +        sout << endl
  135. +             << "NOTE: The " << dictionary["OBSOLETE_LOGGING_BACKEND_ARG"] << " option is obsolete. Use -logging-backend." << endl
  136. +             << endl;
  137. +    }
  138.      if (!dictionary["PREFIX_COMPLAINTS"].isEmpty()) {
  139.          sout << endl
  140.               << dictionary["PREFIX_COMPLAINTS"] << endl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement