summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PATCHES3
-rw-r--r--src/net/sf/antcontrib/cpptasks/CCTask.java6
-rw-r--r--src/net/sf/antcontrib/cpptasks/compiler/LinkType.java11
-rw-r--r--src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java20
4 files changed, 32 insertions, 8 deletions
diff --git a/PATCHES b/PATCHES
index 5a4533c..78f9cd8 100644
--- a/PATCHES
+++ b/PATCHES
@@ -1,5 +1,8 @@
*** Changes marked with FREEHEP.
cpptasks-20051015-patched-1.1-SNAPSHOT
+- [CCTask] added method to link with CPP
+- [compiler.LinkType] added method to link with CPP
+- [gcc.GppLinker] link with or without CPP
- [gcc.AbstractLdLinker] added jni
- [OutputTypeEnum] added jni
- [compiler.LinkType] add jni as type
diff --git a/src/net/sf/antcontrib/cpptasks/CCTask.java b/src/net/sf/antcontrib/cpptasks/CCTask.java
index d4b0db2..60f7883 100644
--- a/src/net/sf/antcontrib/cpptasks/CCTask.java
+++ b/src/net/sf/antcontrib/cpptasks/CCTask.java
@@ -1072,6 +1072,12 @@ public class CCTask extends Task {
public void setLink(OutputTypeEnum outputType) {
linkType.setOutputType(outputType);
}
+
+// FREEHEP added method to link with cpp
+ public void setLinkCPP(boolean linkCPP) {
+ linkType.setLinkCPP(linkCPP);
+ }
+
/**
* Enables or disables generation of multithreaded code
*
diff --git a/src/net/sf/antcontrib/cpptasks/compiler/LinkType.java b/src/net/sf/antcontrib/cpptasks/compiler/LinkType.java
index 31348f2..2ab5380 100644
--- a/src/net/sf/antcontrib/cpptasks/compiler/LinkType.java
+++ b/src/net/sf/antcontrib/cpptasks/compiler/LinkType.java
@@ -27,6 +27,9 @@ public class LinkType {
private OutputTypeEnum outputType = new OutputTypeEnum();
private boolean staticRuntime = false;
private SubsystemEnum subsystem = new SubsystemEnum();
+// FREEHEP
+ private boolean linkCPP = true;
+
/**
* Constructor
*
@@ -156,6 +159,14 @@ public class LinkType {
return subsystem.getValue();
}
+ public void setLinkCPP(boolean linkCPP) {
+ this.linkCPP = linkCPP;
+ }
+
+ public boolean linkCPP() {
+ return linkCPP;
+ }
+
// FREEHEP: flag
public boolean callAddLibrarySets = false;
}
diff --git a/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java b/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
index 6248e00..c8d1da0 100644
--- a/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
+++ b/src/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
@@ -72,16 +72,20 @@ public class GppLinker extends AbstractLdLinker {
args.addElement("-mwindows");
}
}
- 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];
+// FREEHEP, avoid stdc++ if requested
+ runtimeLibrary = 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];
+ } else {
+ runtimeLibrary = null;
+ }
} else {
- runtimeLibrary = null;
+ runtimeLibrary = "-lstdc++";
}
- } else {
- runtimeLibrary = "-lstdc++";
}
// FREEHEP: set flag
linkType.callAddLibrarySets = true;