summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net/sf/antcontrib/cpptasks/CCTask.java10
-rw-r--r--src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java15
2 files changed, 17 insertions, 8 deletions
diff --git a/src/net/sf/antcontrib/cpptasks/CCTask.java b/src/net/sf/antcontrib/cpptasks/CCTask.java
index b385393..a7945b6 100644
--- a/src/net/sf/antcontrib/cpptasks/CCTask.java
+++ b/src/net/sf/antcontrib/cpptasks/CCTask.java
@@ -742,16 +742,20 @@ public class CCTask extends Task {
// BEGINFREEHEP
int noOfCores = Runtime.getRuntime().availableProcessors();
+ log("Found "+noOfCores+" processors available");
if (maxCores > 0) {
noOfCores = Math.min(maxCores, noOfCores);
+ log("Limited processors to "+noOfCores);
}
int noOfFiles = targetsForConfig.size();
- if (noOfFiles < noOfCores)
- noOfCores = targetsForConfig.size();
+ if (noOfFiles < noOfCores) {
+ noOfCores = noOfFiles;
+ log("Limited used processors to "+noOfCores);
+ }
Set[] sourceFiles = new HashSet[noOfCores];
for (int j = 0; j < sourceFiles.length; j++) {
- sourceFiles[j] = new HashSet(targetsForConfig.size()
+ sourceFiles[j] = new HashSet(noOfFiles
/ sourceFiles.length);
}
Enumeration targetsEnum = targetsForConfig.elements();
diff --git a/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java b/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
index 9a70451..c57845e 100644
--- a/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
+++ b/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
@@ -77,16 +77,21 @@ public class GppLinker extends AbstractLdLinker {
}
}
// BEGINFREEHEP link or not with libstdc++
+// for MacOS X see: http://developer.apple.com/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/LibCPPDeployment.html
runtimeLibrary = null;
gccLibrary = null;
if (linkType.linkCPP()) {
if (linkType.isStaticRuntime()) {
- String[] cmdin = new String[]{"g++", "-print-file-name=libstdc++.a"};
- String[] cmdout = CaptureStreamHandler.run(cmdin);
- if (cmdout.length > 0) {
- runtimeLibrary = cmdout[0];
+ if (isDarwin()) {
+ runtimeLibrary = "-lstdc++-static";
} else {
- runtimeLibrary = null;
+ String[] cmdin = new String[]{"g++", "-print-file-name=libstdc++.a"};
+ String[] cmdout = CaptureStreamHandler.run(cmdin);
+ if (cmdout.length > 0) {
+ runtimeLibrary = cmdout[0];
+ } else {
+ runtimeLibrary = null;
+ }
}
gccLibrary = "-static-libgcc";
} else {