diff options
author | Mark Donszelmann <Mark.Donszelmann@gmail.com> | 2007-07-24 06:27:56 +0000 |
---|---|---|
committer | Mark Donszelmann <Mark.Donszelmann@gmail.com> | 2007-07-24 06:27:56 +0000 |
commit | 31b6bd20925883e58f6bdb04bf42cdc6a5788f67 (patch) | |
tree | 4f3e47486161999414d6d6a9c54c6a9b19a12ac8 | |
parent | 5e35dc3659351e9e4e6ec9f1d504cd6e214ec8e4 (diff) | |
download | cpptasks-parallel-31b6bd20925883e58f6bdb04bf42cdc6a5788f67.tar.gz cpptasks-parallel-31b6bd20925883e58f6bdb04bf42cdc6a5788f67.tar.bz2 cpptasks-parallel-31b6bd20925883e58f6bdb04bf42cdc6a5788f67.tar.xz cpptasks-parallel-31b6bd20925883e58f6bdb04bf42cdc6a5788f67.zip |
Fixed a problem linking staticall with libstdc++ on MacOSX; NARPLUGIN-129
-rw-r--r-- | src/net/sf/antcontrib/cpptasks/CCTask.java | 10 | ||||
-rw-r--r-- | src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java | 15 |
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 { |