diff options
author | darius42 <[email protected]> | 2007-05-13 14:27:55 +0000 |
---|---|---|
committer | darius42 <[email protected]> | 2007-05-13 14:27:55 +0000 |
commit | c0bb0d2abc84c1266d809ae37d176ecd4c0dba72 (patch) | |
tree | c1b46d639066fb0e17098b32f9d49d6b005d685a | |
parent | 5e4e580f84b1a827b0c4fca865d40cefc353e061 (diff) |
Address 1716271, fix linker issues with shared libraries with VisualAge.
git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/trunk/cpptasks@119 32d7a393-a5a9-423c-abd3-5d954feb1f2f
-rw-r--r-- | src/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java | 12 | ||||
-rw-r--r-- | src/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java | 14 |
2 files changed, 21 insertions, 5 deletions
diff --git a/src/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java b/src/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java index a210e7e..ffeb6b2 100644 --- a/src/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java +++ b/src/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java @@ -115,13 +115,13 @@ public abstract class AbstractLdLinker extends CommandLineLinker { // if (set.getType() != previousLibraryType) { if (set.getType() != null && "static".equals(set.getType().getValue())) { - endargs.addElement("-Bstatic"); + endargs.addElement(getStaticLibFlag()); previousLibraryType = set.getType(); } else { if (set.getType() == null || !"framework".equals(set.getType().getValue()) || !isDarwin()) { - endargs.addElement("-Bdynamic"); + endargs.addElement(getDynamicLibFlag()); previousLibraryType = set.getType(); } } @@ -322,4 +322,12 @@ public abstract class AbstractLdLinker extends CommandLineLinker { return super.prepareArguments(task, outputDir, outputFile, finalSources, config); } + + protected String getDynamicLibFlag() { + return "-Bdynamic"; + } + + protected String getStaticLibFlag() { + return "-Bstatic"; + } } diff --git a/src/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java b/src/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java index 8e614b3..59ad6a3 100644 --- a/src/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java +++ b/src/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java @@ -31,7 +31,7 @@ public final class VisualAgeLinker extends AbstractLdLinker { private static final String[] objFiles = new String[]{".o", ".a", ".lib", ".dll", ".so", ".sl"}; private static final VisualAgeLinker dllLinker = new VisualAgeLinker( - "makeC++SharedLib", objFiles, discardFiles, "lib", ".so"); + "xlC", objFiles, discardFiles, "lib", ".a"); private static final VisualAgeLinker instance = new VisualAgeLinker("xlC", objFiles, discardFiles, "", ""); public static VisualAgeLinker getInstance() { @@ -50,7 +50,7 @@ public final class VisualAgeLinker extends AbstractLdLinker { //args.addElement("-g"); } if (linkType.isSharedLibrary()) { - //args.addElement("-G"); + args.addElement("-qmkshrobj"); } } public Linker getLinker(LinkType type) { @@ -69,7 +69,15 @@ public final class VisualAgeLinker extends AbstractLdLinker { * would lock up. Using a stock response. */ public String getIdentifier() { - return "VisualAge linker - unidentified version"; + return "VisualAge linker - unidentified version"; + } + + protected String getDynamicLibFlag() { + return "-bdynamic"; + } + + protected String getStaticLibFlag() { + return "-bstatic"; } } |