diff options
Diffstat (limited to 'src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java')
-rw-r--r-- | src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java b/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java index 75ddcc7..f1eb2d7 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java @@ -55,11 +55,17 @@ public abstract class AbstractLdLinker extends CommandLineLinker { args.addElement("-g"); } if (isDarwin()) { - if (linkType.isPluginModule()) { + if (linkType.isPluginModule()) { + args.addElement("-bundle"); +// BEGINFREEHEP + } else if (linkType.isJNIModule()) { + args.addElement("-dynamic"); args.addElement("-bundle"); +// ENDFREEHEP } else { if (linkType.isSharedLibrary()) { - args.addElement("-prebind"); +// FREEHEP no longer needed for 10.4+ +// args.addElement("-prebind"); args.addElement("-dynamiclib"); } } @@ -121,11 +127,16 @@ public abstract class AbstractLdLinker extends CommandLineLinker { // if (set.getType() != previousLibraryType) { if (set.getType() != null && "static".equals(set.getType().getValue())) { +// BEGINFREEHEP not on MacOS X + if (!isDarwin()) { endargs.addElement(getStaticLibFlag()); previousLibraryType = set.getType(); + } +//ENDFREEHEP } else { +// FREEHEP not on MacOS X, recheck this! if (set.getType() == null || - !"framework".equals(set.getType().getValue()) || + !"framework".equals(set.getType().getValue()) && !isDarwin()) { endargs.addElement(getDynamicLibFlag()); previousLibraryType = set.getType(); @@ -137,7 +148,8 @@ public abstract class AbstractLdLinker extends CommandLineLinker { "framework".equals(set.getType().getValue()) && isDarwin()) { buf.setLength(0); - buf.append("-framework "); +// FREEHEP, added as endarg w/o trailing space to avoid quoting! + endargs.addElement("-framework"); } int initialLength = buf.length(); for (int j = 0; j < libs.length; j++) { @@ -154,6 +166,13 @@ public abstract class AbstractLdLinker extends CommandLineLinker { endargs.addElement(buf.toString()); } } + +// BEGINFREEHEP if last was -Bstatic reset it to -Bdynamic so that libc and libm can be found as shareables + if ((previousLibraryType != null) && previousLibraryType.getValue().equals("static") && !isDarwin()) { + endargs.addElement(getDynamicLibFlag()); + } +// ENDFREEHEP + String rc[] = new String[libnames.size()]; for (int i = 0; i < libnames.size(); i++) { rc[i] = (String) libnames.elementAt(i); @@ -239,7 +258,8 @@ public abstract class AbstractLdLinker extends CommandLineLinker { return patterns; } public int getMaximumCommandLength() { - return Integer.MAX_VALUE; +// FREEHEP + return isWindows() ? 20000 : Integer.MAX_VALUE; } public String[] getOutputFileNames(String baseName, VersionInfo versionInfo) { String[] baseNames = super.getOutputFileNames(baseName, versionInfo); |