Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2018-11-20 21:20:39 +0000
committerJonah Graham2018-11-20 21:20:39 +0000
commit48d2271a58a68743e428d3096d2bca054d04e310 (patch)
tree235ba23e71c393ad22d1d57fc8fdfec14754c4ee /build/org.eclipse.cdt.build.gcc.core
parent3cf0297769e5cfb91823e93ce570120a75fe01ce (diff)
downloadorg.eclipse.cdt-48d2271a58a68743e428d3096d2bca054d04e310.tar.gz
org.eclipse.cdt-48d2271a58a68743e428d3096d2bca054d04e310.tar.xz
org.eclipse.cdt-48d2271a58a68743e428d3096d2bca054d04e310.zip
Bug 540373: Normalize newlines with .gitattributes
There is also a new script to verify completeness of .gitattributes: releng/scripts/verify_gitattributes.sh Change-Id: I2ce270852ab54b66b6c474a6ec94203fe5bba78b
Diffstat (limited to 'build/org.eclipse.cdt.build.gcc.core')
-rw-r--r--build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/ClangToolChain.java72
-rw-r--r--build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/Msys2ToolChainProvider.java252
2 files changed, 162 insertions, 162 deletions
diff --git a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/ClangToolChain.java b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/ClangToolChain.java
index 96fa84d7a59..ae4f4cbb7a8 100644
--- a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/ClangToolChain.java
+++ b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/ClangToolChain.java
@@ -1,36 +1,36 @@
-/*******************************************************************************
- * Copyright (c) 2017 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.cdt.build.gcc.core;
-
-import java.nio.file.Path;
-
-import org.eclipse.cdt.core.build.IToolChainProvider;
-import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
-
-/**
- * The Clang toolchain. There's little different from the GCC toolchain other
- * than the toolchain type and name.
- *
- * @author dschaefer
- *
- */
-public class ClangToolChain extends GCCToolChain {
-
- public static final String TYPE_ID = "org.eclipse.cdt.build.clang"; //$NON-NLS-1$
-
- public ClangToolChain(IToolChainProvider provider, Path pathToToolChain, String arch,
- IEnvironmentVariable[] envVars) {
- super(provider, pathToToolChain, arch, envVars);
- }
-
- @Override
- public String getTypeId() {
- return TYPE_ID;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2017 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.cdt.build.gcc.core;
+
+import java.nio.file.Path;
+
+import org.eclipse.cdt.core.build.IToolChainProvider;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
+
+/**
+ * The Clang toolchain. There's little different from the GCC toolchain other
+ * than the toolchain type and name.
+ *
+ * @author dschaefer
+ *
+ */
+public class ClangToolChain extends GCCToolChain {
+
+ public static final String TYPE_ID = "org.eclipse.cdt.build.clang"; //$NON-NLS-1$
+
+ public ClangToolChain(IToolChainProvider provider, Path pathToToolChain, String arch,
+ IEnvironmentVariable[] envVars) {
+ super(provider, pathToToolChain, arch, envVars);
+ }
+
+ @Override
+ public String getTypeId() {
+ return TYPE_ID;
+ }
+
+}
diff --git a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/Msys2ToolChainProvider.java b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/Msys2ToolChainProvider.java
index 7b4cb3a5e1d..c702701820f 100644
--- a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/Msys2ToolChainProvider.java
+++ b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/Msys2ToolChainProvider.java
@@ -1,126 +1,126 @@
-/*******************************************************************************
- * Copyright (c) 2016 QNX Software Systems and others. All rights reserved. This program and the
- * accompanying materials are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.cdt.build.gcc.core.internal;
-
-import java.io.File;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import org.eclipse.cdt.build.gcc.core.GCCToolChain;
-import org.eclipse.cdt.core.build.IToolChain;
-import org.eclipse.cdt.core.build.IToolChainManager;
-import org.eclipse.cdt.core.build.IToolChainProvider;
-import org.eclipse.cdt.core.envvar.EnvironmentVariable;
-import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
-import org.eclipse.cdt.utils.WindowsRegistry;
-import org.eclipse.core.runtime.Platform;
-
-public class Msys2ToolChainProvider implements IToolChainProvider {
-
- private static final String ID = "org.eclipse.cdt.build.gcc.core.msys2Provider"; //$NON-NLS-1$
-
- @Override
- public String getId() {
- return ID;
- }
-
- @Override
- public void init(IToolChainManager manager) {
- if (Platform.getOS().equals(Platform.OS_WIN32)) {
- WindowsRegistry registry = WindowsRegistry.getRegistry();
- String uninstallKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; //$NON-NLS-1$
- String subkey;
- boolean on64bit = Platform.getOSArch().equals(Platform.ARCH_X86_64);
- String key32bit = null;
- for (int i = 0; (subkey = registry.getCurrentUserKeyName(uninstallKey, i)) != null; i++) {
- String compKey = uninstallKey + '\\' + subkey;
- String displayName = registry.getCurrentUserValue(compKey, "DisplayName"); //$NON-NLS-1$
- if (on64bit) {
- if ("MSYS2 64bit".equals(displayName)) { //$NON-NLS-1$
- if (addToolChain64(manager, registry, compKey)) {
- key32bit = null;
- break;
- }
- } else if ("MSYS2 32bit".equals(displayName)) { //$NON-NLS-1$
- key32bit = compKey;
- }
- } else {
- if ("MSYS2 32bit".equals(displayName)) { //$NON-NLS-1$
- if (addToolChain32(manager, registry, compKey)) {
- break;
- }
- }
- }
- }
-
- if (on64bit && key32bit != null) {
- addToolChain64(manager, registry, key32bit);
- }
- }
- }
-
- private boolean addToolChain64(IToolChainManager manager, WindowsRegistry registry, String key) {
- String installLocation = registry.getCurrentUserValue(key, "InstallLocation"); //$NON-NLS-1$
- Path msysPath = Paths.get(installLocation);
- Path gccPath = msysPath.resolve("mingw64\\bin\\gcc.exe"); //$NON-NLS-1$
- if (Files.exists(gccPath)) {
- StringBuilder pathVar = new StringBuilder();
- pathVar.append(msysPath);
- pathVar.append("\\mingw64\\bin"); //$NON-NLS-1$
- pathVar.append(File.pathSeparatorChar);
- pathVar.append(msysPath);
- pathVar.append("\\usr\\local\\bin"); //$NON-NLS-1$
- pathVar.append(File.pathSeparatorChar);
- pathVar.append(msysPath);
- pathVar.append("\\usr\\bin"); //$NON-NLS-1$
- pathVar.append(File.pathSeparatorChar);
- pathVar.append(msysPath);
- pathVar.append("\\bin"); //$NON-NLS-1$
- IEnvironmentVariable[] vars = new IEnvironmentVariable[] {
- new EnvironmentVariable("PATH", pathVar.toString(), IEnvironmentVariable.ENVVAR_PREPEND, //$NON-NLS-1$
- File.pathSeparator)
- };
- GCCToolChain toolChain = new GCCToolChain(this, gccPath, Platform.ARCH_X86_64, vars);
- toolChain.setProperty(IToolChain.ATTR_PACKAGE, "msys2"); //$NON-NLS-1$
- manager.addToolChain(toolChain);
- return true;
- } else {
- return addToolChain32(manager, registry, key);
- }
- }
-
- private boolean addToolChain32(IToolChainManager manager, WindowsRegistry registry, String key) {
- String installLocation = registry.getCurrentUserValue(key, "InstallLocation"); //$NON-NLS-1$
- Path msysPath = Paths.get(installLocation);
- Path gccPath = msysPath.resolve("mingw32\\bin\\gcc.exe"); //$NON-NLS-1$
- if (Files.exists(gccPath)) {
- StringBuilder pathVar = new StringBuilder();
- pathVar.append(msysPath);
- pathVar.append("\\mingw32\\bin"); //$NON-NLS-1$
- pathVar.append(File.pathSeparatorChar);
- pathVar.append(msysPath);
- pathVar.append("\\usr\\local\\bin"); //$NON-NLS-1$
- pathVar.append(File.pathSeparatorChar);
- pathVar.append(msysPath);
- pathVar.append("\\usr\\bin"); //$NON-NLS-1$
- pathVar.append(File.pathSeparatorChar);
- pathVar.append(msysPath);
- pathVar.append("\\bin"); //$NON-NLS-1$
- IEnvironmentVariable[] vars = new IEnvironmentVariable[] {
- new EnvironmentVariable("PATH", pathVar.toString(), IEnvironmentVariable.ENVVAR_PREPEND, //$NON-NLS-1$
- File.pathSeparator) };
- GCCToolChain toolChain = new GCCToolChain(this, gccPath, Platform.ARCH_X86, vars);
- toolChain.setProperty(IToolChain.ATTR_PACKAGE, "msys2"); //$NON-NLS-1$
- manager.addToolChain(toolChain);
- return true;
- } else {
- return false;
- }
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2016 QNX Software Systems and others. All rights reserved. This program and the
+ * accompanying materials are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.cdt.build.gcc.core.internal;
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import org.eclipse.cdt.build.gcc.core.GCCToolChain;
+import org.eclipse.cdt.core.build.IToolChain;
+import org.eclipse.cdt.core.build.IToolChainManager;
+import org.eclipse.cdt.core.build.IToolChainProvider;
+import org.eclipse.cdt.core.envvar.EnvironmentVariable;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
+import org.eclipse.cdt.utils.WindowsRegistry;
+import org.eclipse.core.runtime.Platform;
+
+public class Msys2ToolChainProvider implements IToolChainProvider {
+
+ private static final String ID = "org.eclipse.cdt.build.gcc.core.msys2Provider"; //$NON-NLS-1$
+
+ @Override
+ public String getId() {
+ return ID;
+ }
+
+ @Override
+ public void init(IToolChainManager manager) {
+ if (Platform.getOS().equals(Platform.OS_WIN32)) {
+ WindowsRegistry registry = WindowsRegistry.getRegistry();
+ String uninstallKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; //$NON-NLS-1$
+ String subkey;
+ boolean on64bit = Platform.getOSArch().equals(Platform.ARCH_X86_64);
+ String key32bit = null;
+ for (int i = 0; (subkey = registry.getCurrentUserKeyName(uninstallKey, i)) != null; i++) {
+ String compKey = uninstallKey + '\\' + subkey;
+ String displayName = registry.getCurrentUserValue(compKey, "DisplayName"); //$NON-NLS-1$
+ if (on64bit) {
+ if ("MSYS2 64bit".equals(displayName)) { //$NON-NLS-1$
+ if (addToolChain64(manager, registry, compKey)) {
+ key32bit = null;
+ break;
+ }
+ } else if ("MSYS2 32bit".equals(displayName)) { //$NON-NLS-1$
+ key32bit = compKey;
+ }
+ } else {
+ if ("MSYS2 32bit".equals(displayName)) { //$NON-NLS-1$
+ if (addToolChain32(manager, registry, compKey)) {
+ break;
+ }
+ }
+ }
+ }
+
+ if (on64bit && key32bit != null) {
+ addToolChain64(manager, registry, key32bit);
+ }
+ }
+ }
+
+ private boolean addToolChain64(IToolChainManager manager, WindowsRegistry registry, String key) {
+ String installLocation = registry.getCurrentUserValue(key, "InstallLocation"); //$NON-NLS-1$
+ Path msysPath = Paths.get(installLocation);
+ Path gccPath = msysPath.resolve("mingw64\\bin\\gcc.exe"); //$NON-NLS-1$
+ if (Files.exists(gccPath)) {
+ StringBuilder pathVar = new StringBuilder();
+ pathVar.append(msysPath);
+ pathVar.append("\\mingw64\\bin"); //$NON-NLS-1$
+ pathVar.append(File.pathSeparatorChar);
+ pathVar.append(msysPath);
+ pathVar.append("\\usr\\local\\bin"); //$NON-NLS-1$
+ pathVar.append(File.pathSeparatorChar);
+ pathVar.append(msysPath);
+ pathVar.append("\\usr\\bin"); //$NON-NLS-1$
+ pathVar.append(File.pathSeparatorChar);
+ pathVar.append(msysPath);
+ pathVar.append("\\bin"); //$NON-NLS-1$
+ IEnvironmentVariable[] vars = new IEnvironmentVariable[] {
+ new EnvironmentVariable("PATH", pathVar.toString(), IEnvironmentVariable.ENVVAR_PREPEND, //$NON-NLS-1$
+ File.pathSeparator)
+ };
+ GCCToolChain toolChain = new GCCToolChain(this, gccPath, Platform.ARCH_X86_64, vars);
+ toolChain.setProperty(IToolChain.ATTR_PACKAGE, "msys2"); //$NON-NLS-1$
+ manager.addToolChain(toolChain);
+ return true;
+ } else {
+ return addToolChain32(manager, registry, key);
+ }
+ }
+
+ private boolean addToolChain32(IToolChainManager manager, WindowsRegistry registry, String key) {
+ String installLocation = registry.getCurrentUserValue(key, "InstallLocation"); //$NON-NLS-1$
+ Path msysPath = Paths.get(installLocation);
+ Path gccPath = msysPath.resolve("mingw32\\bin\\gcc.exe"); //$NON-NLS-1$
+ if (Files.exists(gccPath)) {
+ StringBuilder pathVar = new StringBuilder();
+ pathVar.append(msysPath);
+ pathVar.append("\\mingw32\\bin"); //$NON-NLS-1$
+ pathVar.append(File.pathSeparatorChar);
+ pathVar.append(msysPath);
+ pathVar.append("\\usr\\local\\bin"); //$NON-NLS-1$
+ pathVar.append(File.pathSeparatorChar);
+ pathVar.append(msysPath);
+ pathVar.append("\\usr\\bin"); //$NON-NLS-1$
+ pathVar.append(File.pathSeparatorChar);
+ pathVar.append(msysPath);
+ pathVar.append("\\bin"); //$NON-NLS-1$
+ IEnvironmentVariable[] vars = new IEnvironmentVariable[] {
+ new EnvironmentVariable("PATH", pathVar.toString(), IEnvironmentVariable.ENVVAR_PREPEND, //$NON-NLS-1$
+ File.pathSeparator) };
+ GCCToolChain toolChain = new GCCToolChain(this, gccPath, Platform.ARCH_X86, vars);
+ toolChain.setProperty(IToolChain.ATTR_PACKAGE, "msys2"); //$NON-NLS-1$
+ manager.addToolChain(toolChain);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+}

Back to the top