summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java12
1 files changed, 9 insertions, 3 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 ffeb6b2..940d8bc 100644
--- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java
+++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java
@@ -101,13 +101,19 @@ public abstract class AbstractLdLinker extends CommandLineLinker {
LibrarySet set = libsets[i];
File libdir = set.getDir(null);
String[] libs = set.getLibs();
- if (libdir != null) {
+ if (libdir != null) {
+ String relPath = libdir.getAbsolutePath();
+ File outputFile = task.getOutfile();
+ if (outputFile != null && outputFile.getParentFile() != null) {
+ relPath = CUtil.getRelativePath(
+ outputFile.getParentFile().getAbsolutePath(), libdir);
+ }
if (set.getType() != null &&
"framework".equals(set.getType().getValue()) &&
isDarwin()) {
- endargs.addElement("-F" + libdir.getAbsolutePath());
+ endargs.addElement("-F" + relPath);
} else {
- endargs.addElement("-L" + libdir.getAbsolutePath());
+ endargs.addElement("-L" + relPath);
}
}
//