diff options
author | Jeff Johnston | 2013-05-08 20:26:20 +0000 |
---|---|---|
committer | Jeff Johnston | 2013-05-08 21:07:50 +0000 |
commit | 143d87d88ca20b7f40dec1eb187a2b533e42bb56 (patch) | |
tree | a1a1fe46e8c615ee5bc968c17bbddc02d233e9f6 /build | |
parent | 9a4a52cc00d22449a70f9a2a72ec2dd264279050 (diff) | |
download | org.eclipse.cdt-143d87d88ca20b7f40dec1eb187a2b533e42bb56.tar.gz org.eclipse.cdt-143d87d88ca20b7f40dec1eb187a2b533e42bb56.tar.xz org.eclipse.cdt-143d87d88ca20b7f40dec1eb187a2b533e42bb56.zip |
Bug 407580: Can't build project with GnuMakefile using Autotools plug-in
- Remove trailing separator from PWD during configuration step
Change-Id: Ideddd1ce9b9d0a5a90219a411c114315046a7c8d
Reviewed-on: https://git.eclipse.org/r/12657
Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
IP-Clean: Jeff Johnston <jjohnstn@redhat.com>
Tested-by: Jeff Johnston <jjohnstn@redhat.com>
Diffstat (limited to 'build')
-rw-r--r-- | build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java index ae7c4b16266..10e703376f0 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java @@ -1152,9 +1152,20 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { // For Windows/Mac, check for PWD environment variable being passed. // Remove it for now as it is causing errors in configuration. // Fix for bug #343879 - if (!removePWD || !variables[i].getName().equals("PWD")) // $NON-NLS-1$ + if (!removePWD || !variables[i].getName().equals("PWD")) { // $NON-NLS-1$ + String value = variables[i].getValue(); + // The following is a work-around for bug #407580. Configure doesn't recognize + // a directory with a trailing separator at the end is equivalent to the same + // directory without that trailing separator. This problem can cause + // configure to try and link a file to itself (e.g. projects with a GnuMakefile) and + // obliterate the contents. Thus, we remove the trailing separator to be safe. + if (variables[i].getName().equals("PWD")) { // $NON-NLS-1$ + if (value.charAt(value.length()-1) == IPath.SEPARATOR) + value = value.substring(0, value.length() - 1); + } envList.add(variables[i].getName() - + "=" + variables[i].getValue()); //$NON-NLS-1$ + + "=" + value); //$NON-NLS-1$ + } } if (additionalEnvs != null) envList.addAll(additionalEnvs); // add any additional environment variables specified ahead of script |