Hello everyone,
I have locally modified the <make> task to account for the -j
option... I still cannot build qt-jambi completely (it fails at the
native jar stage because it cannot find libsdtc++...), but at least
with this patch, it fails earlier :p
What do you think about generalizing it? For now, it only every does
the correct thing if GNU Make is used, I don't even know if other make
versions support this option...
And BTW, in this same <make> task, the make executable is confusedly
(imho) called the "compiler", what about replacing compiler with
makeExecutable all around?
--- cut ---
diff --git a/com/trolltech/tools/ant/MakeTask.java
b/com/trolltech/tools/ant/MakeTask.java
index fe8af55..27e48f2 100755
--- a/com/trolltech/tools/ant/MakeTask.java
+++ b/com/trolltech/tools/ant/MakeTask.java
@@ -75,6 +75,21 @@ public class MakeTask extends Task {
String arguments = "";
+ /*
+ * Multiple CPU support: try and determine whether we use GNU Make. If
+ * this is the case, assume that the -j option works...
+ */
+ String makeExecutable = compilerName();
+
+ if ("make".equals(makeExecutable)) {
+ try {
+ String tmp = Util.execute("make", "-version")[0];
+ if (tmp.startsWith("GNU Make"))
+ arguments += " -j" +
Runtime.getRuntime().availableProcessors();
+ } catch (Exception e) {
+ }
+ }
+
if (silent && OSInfo.os() != OSInfo.OS.Windows)
arguments += " -s";
--- cut ---
--
Francis Galiegue, [email protected]
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (Stéphane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest