From adb0575e6e086e3ac35958dfdde3957955090c38 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 27 Oct 2013 15:03:20 +0100 Subject: reduce the amount of cmdline output from btool, make it easier to see compile warnings (bzr r12731) --- buildtool.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'buildtool.cpp') diff --git a/buildtool.cpp b/buildtool.cpp index 46c4c91ae..5c3d19ada 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -4140,8 +4140,8 @@ bool MakeBase::executeCommand(const String &command, String &errbuf) { - status("============ cmd ============\n%s\n=============================", - command.c_str()); +// status("============ cmd ============\n%s\n=============================", +// command.c_str()); outbuf.clear(); errbuf.clear(); @@ -7060,8 +7060,9 @@ public: //# First we check if the source is newer than the .o if (isNewerThan(srcFullName, destFullName)) { - taskstatus("compile of %s required by source: %s", - destFullName.c_str(), srcFullName.c_str()); +// taskstatus("compile of %s (req. by: %s)", +// destFullName.c_str(), srcFullName.c_str()); + taskstatus("compile %s", srcFullName.c_str()); compileMe = true; } else @@ -7083,8 +7084,8 @@ public: // destFullName.c_str(), depFullName.c_str()); if (depRequires) { - taskstatus("compile of %s required by included: %s", - destFullName.c_str(), depFullName.c_str()); + taskstatus("compile %s (%s modified)", + srcFullName.c_str(), depFullName.c_str()); compileMe = true; break; } @@ -7143,11 +7144,13 @@ public: fprintf(f, "#### STDERR ###\n%s\n\n", errString.c_str()); fflush(f); } - if (!ret) - { + if (!ret) { error("problem compiling: %s", errString.c_str()); errorOccurred = true; - } + } else if (!errString.empty()) { + status("STDERR: \n%s\n", errString.c_str()); + } + if (errorOccurred && !continueOnError) { #ifndef _OPENMP // figure out a way to break the loop here with OpenMP -- cgit v1.2.3 From 844912db9a81ab302198068ec7dee4bc1a528856 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Tue, 29 Oct 2013 22:19:35 +0100 Subject: btool: i know the whole multithread thing was a hack :-) so the fprinting should be done through fprint directly (seems to be more multithread resistant :), instead of through helper functions. (bzr r12747) --- buildtool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'buildtool.cpp') diff --git a/buildtool.cpp b/buildtool.cpp index 5c3d19ada..c6aa6e127 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -7062,7 +7062,7 @@ public: { // taskstatus("compile of %s (req. by: %s)", // destFullName.c_str(), srcFullName.c_str()); - taskstatus("compile %s", srcFullName.c_str()); + fprintf(stdout, "compile %s\n", srcFullName.c_str()); compileMe = true; } else @@ -7148,7 +7148,7 @@ public: error("problem compiling: %s", errString.c_str()); errorOccurred = true; } else if (!errString.empty()) { - status("STDERR: \n%s\n", errString.c_str()); + fprintf(stdout, "STDERR: \n%s\n", errString.c_str()); } -- cgit v1.2.3 From 8068c552ab3a41189de9be9d2086c44338be988b Mon Sep 17 00:00:00 2001 From: Bryce Harrington Date: Fri, 10 Jan 2014 13:19:17 -0800 Subject: btool: Fix hitting cmdline limit on XP/Mingw/Msys (Fixes #1251405) Current releases of trunk fail to build on Windows XP because command line length limits are hit. This patch sends only the unique parameters from the "libs" field during the link stage to the command. This saves enough characters so that btool will complete the build. It is not a long term solution, but will allow development to continue on Windows for a while longer, until the underlying problems can be addressed. Patch authored by David Mathog (mathog) Signed-off-by: Bryce Harrington (bzr r12913) --- buildtool.cpp | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'buildtool.cpp') diff --git a/buildtool.cpp b/buildtool.cpp index c6aa6e127..7ef10c87d 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -52,6 +52,8 @@ #include #include +#include +#include #include #include #include @@ -4163,7 +4165,7 @@ bool MakeBase::executeCommand(const String &command, return false; } strcpy(paramBuf, (char *)command.c_str()); - + //# Go to http://msdn2.microsoft.com/en-us/library/ms682499.aspx //# to see how Win32 pipes work @@ -8136,6 +8138,31 @@ public: virtual ~TaskLink() {} + virtual void UniqueParams(std::string& source) { + size_t prev = 0; + size_t next = 0; + std::list thelist; + std::list::iterator it; + std::string tstring=" "; + source +=std::string(" "); // else the last token may be lost + while ((next = source.find_first_of(" ", prev)) != std::string::npos){ + if (next - prev != 0){ + thelist.push_back(source.substr(prev, next - prev)); + } + prev = next + 1; + } + thelist.sort(); + source.clear(); + source +=std::string(" "); + for(it=thelist.begin(); it!=thelist.end();it++){ + if(*it != tstring){ + tstring = *it; + source +=tstring; + source +=std::string(" "); + } + } + } + virtual bool execute() { String command = parent.eval(commandOpt, "g++"); @@ -8177,6 +8204,8 @@ public: doit = true; } cmd.append(" "); + // trim it down to unique elements, reduce command line size + UniqueParams(libs); cmd.append(libs); if (!doit) { @@ -8187,6 +8216,7 @@ public: String outbuf, errbuf; + std::cout << "DEBUG command = " << cmd << std::endl; if (!executeCommand(cmd.c_str(), "", outbuf, errbuf)) { error("LINK problem: %s", errbuf.c_str()); @@ -8488,7 +8518,7 @@ public: String outString, errString; - if (!executeCommand(cmd.c_str(), "", outString, errString)) + if (!executeCommand(cmd.c_str(), "", outString, errString)) { error(" problem: %s", errString.c_str()); return false; @@ -9058,7 +9088,7 @@ public: cmd = command; cmd.append(getNativePath(fullName)); - if (!executeCommand(cmd, "", outbuf, errbuf)) + if (!executeCommand(cmd, "", outbuf, errbuf)) { error(" failed : %s", errbuf.c_str()); return false; -- cgit v1.2.3 From 28821fb5242b7257a9bbdb81a951844fad538cfa Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 23 Mar 2014 14:58:48 +0100 Subject: fix build with newer mingw64 (#define clashes ...) (bzr r13187) --- buildtool.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'buildtool.cpp') diff --git a/buildtool.cpp b/buildtool.cpp index 7ef10c87d..3f680e48c 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -62,6 +62,8 @@ #ifdef __WIN32__ +#define WIN32_LEAN_AND_MEAN +#define NOGDI #include #endif -- cgit v1.2.3