summaryrefslogtreecommitdiff
path: root/src/net/sf
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/sf')
-rw-r--r--src/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java7
-rw-r--r--src/net/sf/antcontrib/cpptasks/gcc/GccLinker.java26
-rw-r--r--src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java26
3 files changed, 25 insertions, 34 deletions
diff --git a/src/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java b/src/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java
index d0cd77b..045f1ff 100644
--- a/src/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java
+++ b/src/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java
@@ -123,6 +123,13 @@ public abstract class AbstractProcessor implements Processor, Cloneable {
String osName = getOSName();
return "Mac OS X".equals(osName);
}
+// BEGINFREEHEP
+ protected boolean isWindows() {
+ String osName = getOSName();
+ return (osName != null) && osName.startsWith("Windows");
+ }
+// ENDFREEHEP
+
public final String toString() {
return getIdentifier();
}
diff --git a/src/net/sf/antcontrib/cpptasks/gcc/GccLinker.java b/src/net/sf/antcontrib/cpptasks/gcc/GccLinker.java
index ed1a052..a551bfa 100644
--- a/src/net/sf/antcontrib/cpptasks/gcc/GccLinker.java
+++ b/src/net/sf/antcontrib/cpptasks/gcc/GccLinker.java
@@ -38,7 +38,8 @@ public class GccLinker extends AbstractLdLinker {
"-dynamiclib", "-nostartfiles", "-nostdlib", "-prebind", "-s",
"-static", "-shared", "-symbolic", "-Xlinker",
"--export-all-symbols", "-static-libgcc",};
- private static final GccLinker dllLinker = new GccLinker("gcc", objFiles,
+// FREEHEP refactored dllLinker to soLinker
+ private static final GccLinker soLinker = new GccLinker("gcc", objFiles,
discardFiles, "lib", ".so", false, new GccLinker("gcc", objFiles,
discardFiles, "lib", ".so", true, null));
private static final GccLinker instance = new GccLinker("gcc", objFiles,
@@ -49,6 +50,9 @@ public class GccLinker extends AbstractLdLinker {
objFiles, discardFiles, "lib", ".dylib", false, null);
private static final GccLinker machJNILinker = new GccLinker("gcc",
objFiles, discardFiles, "lib", ".jnilib", false, null);
+// FREEHEP added dllLinker for windows
+ private static final GccLinker dllLinker = new GccLinker("gcc",
+ objFiles, discardFiles, "", ".dll", false, null);
public static GccLinker getInstance() {
return instance;
}
@@ -197,27 +201,15 @@ public class GccLinker extends AbstractLdLinker {
}
// BEGINFREEHEP
if (type.isJNIModule()) {
- if (isDarwin()) {
- return machJNILinker;
- } else {
- return dllLinker;
- }
+ return isDarwin() ? machJNILinker : isWindows() ? dllLinker : soLinker;
}
-// ENDFREEHEP
if (type.isPluginModule()) {
- if (isDarwin()) {
- return machBundleLinker;
- } else {
- return dllLinker;
- }
+ return isDarwin() ? machBundleLinker : isWindows() ? dllLinker : soLinker;
}
if (type.isSharedLibrary()) {
- if (isDarwin()) {
- return machDllLinker;
- } else {
- return dllLinker;
- }
+ return isDarwin() ? machDllLinker : isWindows() ? dllLinker : soLinker;
}
+// ENDFREEHEP
return instance;
}
}
diff --git a/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java b/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
index c57845e..fa6b77c 100644
--- a/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
+++ b/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
@@ -33,7 +33,8 @@ public class GppLinker extends AbstractLdLinker {
protected static final String[] discardFiles = new String[0];
protected static final String[] objFiles = new String[]{".o", ".a", ".lib",
".dll", ".so", ".sl"};
- private static final GppLinker dllLinker = new GppLinker("gcc", objFiles,
+// FREEHEP refactored dllLinker into soLinker
+ private static final GppLinker soLinker = new GppLinker("gcc", objFiles,
discardFiles, "lib", ".so", false, new GppLinker("gcc", objFiles,
discardFiles, "lib", ".so", true, null));
private final static String libPrefix = "libraries: =";
@@ -53,6 +54,9 @@ public class GppLinker extends AbstractLdLinker {
// FREEHEP
private static final GppLinker machJNILinker = new GppLinker("gcc",
objFiles, discardFiles, "lib", ".jnilib", false, null);
+ // FREEHEP added dllLinker for windows
+ private static final GppLinker dllLinker = new GppLinker("gcc",
+ objFiles, discardFiles, "", ".dll", false, null);
public static GppLinker getInstance() {
return instance;
}
@@ -219,27 +223,15 @@ public class GppLinker extends AbstractLdLinker {
}
// BEGINFREEHEP
if (type.isJNIModule()) {
- if (GccProcessor.getMachine().indexOf("darwin") >= 0) {
- return machJNILinker;
- } else {
- return dllLinker;
- }
+ return isDarwin() ? machJNILinker : isWindows() ? dllLinker : soLinker;
}
-// ENDFREEHEP
if (type.isPluginModule()) {
- if (GccProcessor.getMachine().indexOf("darwin") >= 0) {
- return machPluginLinker;
- } else {
- return dllLinker;
- }
+ return isDarwin() ? machPluginLinker : isWindows() ? dllLinker : soLinker;
}
if (type.isSharedLibrary()) {
- if (GccProcessor.getMachine().indexOf("darwin") >= 0) {
- return machDllLinker;
- } else {
- return dllLinker;
- }
+ return isDarwin() ? machDllLinker : isWindows() ? dllLinker : soLinker;
}
+// ENDFREEHEP
return instance;
}
}