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 /src/net/sf/antcontrib/cpptasks/gcc | |
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
Diffstat (limited to 'src/net/sf/antcontrib/cpptasks/gcc')
-rw-r--r-- | src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java | 15 |
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 { |