From 30cb19ee08f7c07beab6c097ab81468883f5a68a Mon Sep 17 00:00:00 2001 From: Ken Ryall Date: Fri, 18 Jan 2008 21:27:36 +0000 Subject: [PATCH] BUg 212474, check makefile device for included files --- .../internal/core/makefile/gnu/Include.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java index 2f0b6f53c6f..751caf94f89 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java @@ -16,6 +16,7 @@ import org.eclipse.cdt.make.core.makefile.IDirective; import org.eclipse.cdt.make.core.makefile.gnu.IInclude; import org.eclipse.cdt.make.internal.core.makefile.Directive; import org.eclipse.cdt.make.internal.core.makefile.Parent; +import org.eclipse.core.runtime.Path; public class Include extends Parent implements IInclude { @@ -51,7 +52,21 @@ public class Include extends Parent implements IInclude { continue; } catch (IOException e) { } - if (!filenames[i].startsWith(GNUMakefile.FILE_SEPARATOR) && dirs != null) { + if (filenames[i].startsWith(GNUMakefile.FILE_SEPARATOR)) { + // Try to set the device to that of the parent makefile. + String filename = getFileName(); + if (filename != null) { + String device = new Path(filename).getDevice(); + if (device != null) { + try { + gnu.parse(new Path(filenames[i]).setDevice(device).toOSString()); + addDirective(gnu); + continue; + } catch (IOException e) { + } + } + } + } else if (dirs != null) { for (int j = 0; j < dirs.length; j++) { try { String filename = dirs[j] + GNUMakefile.FILE_SEPARATOR + filenames[i];