|
| 1 | +commit e2584eed1c84c18f16e42188c30d2c3d8e3e8853 |
| 2 | +Author: Chun-wei Fan <fanchunwei@src.gnome.org> |
| 3 | +Date: Tue Nov 12 17:37:05 2019 +0800 |
| 4 | + |
| 5 | + win32: Add configuration for profiler |
| 6 | + |
| 7 | + Without this the generated xsltconfig.h will not be complete as there |
| 8 | + will be a configuration variable that is left in the header, breaking |
| 9 | + builds. |
| 10 | + |
| 11 | + This will allow one to enable or disable profiler support in Windows |
| 12 | + builds, and the default is to enable this. |
| 13 | + |
| 14 | +diff --git a/win32/configure.js b/win32/configure.js |
| 15 | +index 56694cce..12c99f30 100644 |
| 16 | +--- a/win32/configure.js |
| 17 | ++++ b/win32/configure.js |
| 18 | +@@ -47,6 +47,7 @@ var withIconv = true; |
| 19 | + var withZlib = false; |
| 20 | + var withCrypto = true; |
| 21 | + var withModules = false; |
| 22 | ++var withProfiler = true; |
| 23 | + /* Win32 build options. */ |
| 24 | + var dirSep = "\\"; |
| 25 | + var compiler = "msvc"; |
| 26 | +@@ -106,6 +107,7 @@ function usage() |
| 27 | + txt += " zlib: Use zlib library (" + (withZlib? "yes" : "no") + ")\n"; |
| 28 | + txt += " crypto: Enable Crypto support (" + (withCrypto? "yes" : "no") + ")\n"; |
| 29 | + txt += " modules: Enable Module support (" + (withModules? "yes" : "no") + ")\n"; |
| 30 | ++ txt += " profiler: Enable Profiler support (" + (withProfiler? "yes" : "no") + ")\n"; |
| 31 | + txt += "\nWin32 build options, default value given in parentheses:\n\n"; |
| 32 | + txt += " compiler: Compiler to be used [msvc|mingw] (" + compiler + ")\n"; |
| 33 | + txt += " cruntime: C-runtime compiler option (only msvc) (" + cruntime + ")\n"; |
| 34 | +@@ -192,6 +194,7 @@ function discoverVersion() |
| 35 | + vf.WriteLine("WITH_ZLIB=" + (withZlib? "1" : "0")); |
| 36 | + vf.WriteLine("WITH_CRYPTO=" + (withCrypto? "1" : "0")); |
| 37 | + vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0")); |
| 38 | ++ vf.WriteLine("WITH_PROFILER=" + (withProfiler? "1" : "0")); |
| 39 | + vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0")); |
| 40 | + vf.WriteLine("STATIC=" + (buildStatic? "1" : "0")); |
| 41 | + vf.WriteLine("PREFIX=" + buildPrefix); |
| 42 | +@@ -240,6 +243,8 @@ function configureXslt() |
| 43 | + of.WriteLine(s.replace(/\@WITH_DEBUGGER\@/, withDebugger? "1" : "0")); |
| 44 | + } else if (s.search(/\@WITH_MODULES\@/) != -1) { |
| 45 | + of.WriteLine(s.replace(/\@WITH_MODULES\@/, withModules? "1" : "0")); |
| 46 | ++ } else if (s.search(/\@WITH_PROFILER\@/) != -1) { |
| 47 | ++ of.WriteLine(s.replace(/\@WITH_PROFILER\@/, withProfiler? "1" : "0")); |
| 48 | + } else if (s.search(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/) != -1) { |
| 49 | + of.WriteLine(s.replace(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/, "NULL")); |
| 50 | + } else |
| 51 | +@@ -343,6 +348,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) { |
| 52 | + withCrypto = strToBool(arg.substring(opt.length + 1, arg.length)); |
| 53 | + else if (opt == "modules") |
| 54 | + withModules = strToBool(arg.substring(opt.length + 1, arg.length)); |
| 55 | ++ else if (opt == "profiler") |
| 56 | ++ withProfiler = strToBool(arg.substring(opt.length + 1, arg.length)); |
| 57 | + else if (opt == "compiler") |
| 58 | + compiler = arg.substring(opt.length + 1, arg.length); |
| 59 | + else if (opt == "cruntime") |
| 60 | +@@ -477,6 +484,7 @@ txtOut += " Use iconv: " + boolToStr(withIconv) + "\n"; |
| 61 | + txtOut += " With zlib: " + boolToStr(withZlib) + "\n"; |
| 62 | + txtOut += " Crypto: " + boolToStr(withCrypto) + "\n"; |
| 63 | + txtOut += " Modules: " + boolToStr(withModules) + "\n"; |
| 64 | ++txtOut += " Profiler: " + boolToStr(withProfiler) + "\n"; |
| 65 | + txtOut += "\n"; |
| 66 | + txtOut += "Win32 build configuration\n"; |
| 67 | + txtOut += "-------------------------\n"; |
0 commit comments