summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PATCHES7
-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
4 files changed, 32 insertions, 34 deletions
diff --git a/PATCHES b/PATCHES
index 17bb7bc..f4a485e 100644
--- a/PATCHES
+++ b/PATCHES
@@ -27,6 +27,13 @@
- [src/net/sf/antcontrib/cpptasks/devstudio/DevStudioResourceCompiler.java] limit command line length to 32000.
- [src/net/sf/antcontrib/cpptasks/devstudio/VisualStudioNETProjectWriter.java] limit command line length to 32000.
+** dll for g++ on windows changes
+- [src/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java] Added isWindows()
+- [src/net/sf/antcontrib/cpptasks/gcc/GccLinker.java] refactored dllLinker to soLinker
+- [src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java] refactored dllLinker to soLinker
+- [src/net/sf/antcontrib/cpptasks/gcc/GccLinker.java] added dllLinker for windows
+- [src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java] added dllLinker for windows
+
** -fno-rtti changes
- [src/net/sf/antcontrib/cpptasks/gcc/GccCompatibleCCompiler.java] removed -fno-rtti flag
- [src/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java] only add -fno-rtti for g++ and c++
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;
}
}