diff --git a/app/src/cc/arduino/packages/Uploader.java b/app/src/cc/arduino/packages/Uploader.java
index 2b9195701e3..734cc2b7965 100644
--- a/app/src/cc/arduino/packages/Uploader.java
+++ b/app/src/cc/arduino/packages/Uploader.java
@@ -94,12 +94,7 @@ protected boolean executeUploadCommand(String command[]) throws Exception {
int result = -1;
try {
- if (verbose) {
- for (String c : command)
- System.out.print(c + " ");
- System.out.println();
- }
- Process process = ProcessUtils.exec(command);
+ Process process = ProcessUtils.execWithSystemFallback(command, verbose);
new MessageSiphon(process.getInputStream(), this);
new MessageSiphon(process.getErrorStream(), this);
diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java
index 5f351f76477..3f544ed1c7a 100644
--- a/app/src/processing/app/Base.java
+++ b/app/src/processing/app/Base.java
@@ -2048,16 +2048,6 @@ static public String getHardwarePath() {
return getHardwareFolder().getAbsolutePath();
}
-
- static public String getAvrBasePath() {
- String path = getHardwarePath() + File.separator + "tools" +
- File.separator + "avr" + File.separator + "bin" + File.separator;
- if (Base.isLinux() && !(new File(path)).exists()) {
- return ""; // use distribution provided avr tools if bundled tools missing
- }
- return path;
- }
-
/**
* Returns a specific TargetPackage
*
diff --git a/app/src/processing/app/debug/Compiler.java b/app/src/processing/app/debug/Compiler.java
index 5bdb7d2e989..9b203839406 100644
--- a/app/src/processing/app/debug/Compiler.java
+++ b/app/src/processing/app/debug/Compiler.java
@@ -180,9 +180,6 @@ private PreferencesMap createBuildPreferences(String _buildPath,
targetArch = targetPlatform.getId();
p.put("build.arch", targetArch.toUpperCase());
- if (!p.containsKey("compiler.path"))
- p.put("compiler.path", Base.getAvrBasePath());
-
// Core folder
TargetPlatform tp = corePlatform;
if (tp == null)
@@ -346,18 +343,12 @@ private void execAsynchronously(String[] command) throws RunnerException {
return;
int result = 0;
- if (verbose) {
- for (String c : command)
- System.out.print(c + " ");
- System.out.println();
- }
-
firstErrorFound = false; // haven't found any errors yet
secondErrorFound = false;
Process process;
try {
- process = ProcessUtils.exec(command);
+ process = ProcessUtils.execWithSystemFallback(command, verbose);
} catch (IOException e) {
RunnerException re = new RunnerException(e.getMessage());
re.hideStackTrace();
diff --git a/app/src/processing/app/debug/Sizer.java b/app/src/processing/app/debug/Sizer.java
index 09cb8ea3064..6b443407fec 100644
--- a/app/src/processing/app/debug/Sizer.java
+++ b/app/src/processing/app/debug/Sizer.java
@@ -68,7 +68,7 @@ public long[] computeSize() throws RunnerException {
textSize = -1;
dataSize = -1;
eepromSize = -1;
- Process process = ProcessUtils.exec(cmd);
+ Process process = ProcessUtils.execWithSystemFallback(cmd, false);
MessageSiphon in = new MessageSiphon(process.getInputStream(), this);
MessageSiphon err = new MessageSiphon(process.getErrorStream(), this);
diff --git a/app/src/processing/app/helpers/ProcessUtils.java b/app/src/processing/app/helpers/ProcessUtils.java
index ebbbb0bcd2e..ee27f517781 100644
--- a/app/src/processing/app/helpers/ProcessUtils.java
+++ b/app/src/processing/app/helpers/ProcessUtils.java
@@ -1,12 +1,30 @@
package processing.app.helpers;
import java.io.IOException;
+import java.io.File;
import processing.app.Base;
public class ProcessUtils {
- public static Process exec(String[] command) throws IOException {
+ public static Process execWithSystemFallback(String[] command, boolean print) throws IOException {
+ File path = new File(command[0]);
+ if (!path.exists()) {
+ String[] newcmd = command.clone();
+ newcmd[0] = path.getName();
+ return exec(newcmd, print);
+ } else {
+ return exec(command, print);
+ }
+ }
+
+ public static Process exec(String[] command, boolean print) throws IOException {
+ if (print) {
+ for (String c : command)
+ System.out.print(c + " ");
+ System.out.println();
+ }
+
// No problems on linux and mac
if (!Base.isWindows()) {
return Runtime.getRuntime().exec(command);
diff --git a/build/build.xml b/build/build.xml
index 4a89922295f..39d3bf23f7e 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -26,6 +26,15 @@
+
+
+
+
+
@@ -97,8 +106,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
@@ -112,18 +150,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
@@ -198,7 +224,7 @@
-
+
@@ -222,9 +248,12 @@
-
-
+
+
+
+
+
@@ -243,10 +272,6 @@
-
-
-
-
@@ -259,7 +284,9 @@
+
+
@@ -460,7 +487,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -472,17 +514,9 @@
-
-
-
-
-
-
-
-
-
+
@@ -495,14 +529,9 @@
-
-
-
-
-
-
+
@@ -637,7 +666,7 @@
@@ -663,28 +692,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -706,6 +713,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hardware/arduino/avr/platform.txt b/hardware/arduino/avr/platform.txt
index 4e28f0a38d9..a6b82038400 100644
--- a/hardware/arduino/avr/platform.txt
+++ b/hardware/arduino/avr/platform.txt
@@ -11,8 +11,7 @@ version=1.5.5
# AVR compile variables
# ---------------------
-# Default "compiler.path" is correct, change only if you want to overidde the initial value
-#compiler.path={ide.path}/tools/avr/bin/..
+compiler.path={runtime.ide.path}/hardware/tools/avr/bin/
compiler.c.cmd=avr-gcc
compiler.c.flags=-c -g -Os -w -ffunction-sections -fdata-sections -MMD
compiler.c.elf.flags=-Os -Wl,--gc-sections
diff --git a/hardware/tools/.keep b/hardware/tools/.keep
deleted file mode 100644
index e69de29bb2d..00000000000