summaryrefslogtreecommitdiff
path: root/src/net/sf/antcontrib/cpptasks/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/sf/antcontrib/cpptasks/gcc')
-rw-r--r--src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java15
1 files changed, 10 insertions, 5 deletions
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 {