From 626a436137c9b9a9384a5c1e9d16eff8dd475f4a Mon Sep 17 00:00:00 2001 From: carnold Date: Wed, 13 Feb 2008 17:23:14 +0000 Subject: Use relative paths on -L options which helps cygwin git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/cpptasks/trunk@153 32d7a393-a5a9-423c-abd3-5d954feb1f2f --- .../net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') 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); } } // -- cgit v1.2.3