I noticed that when building ardupilot-mega, there are some differences in what AVR tools (compiler, linker, etc.) are used depending on which platform you're on:

Under OS X and Windows, it uses the tools that are packaged with the Ardunio software.  In Linux, it looks for separately installed avr-gcc, avr-g++, avr-gdb etc.

Since even in Linux you need to have Arduino installed anyway, and since the other platforms use the Arduino versions of the tools, is there any reason to do something different in Linux?  It seems that doing the same thing in Linux that ardupilot-mega does on other platforms would mean one less step is required before building the software--you no longer have to install avr-gcc, etc.  And removing unnecessary steps in build processes is always good.

Can any devs comment?  it looks like Amilcar Lucas and DrZipLok were the last people to change this section of the makefile, most recently in October 2010.  The diff is small:

[wiseman@wiseman-vbox ArduCopter (use_arduino_tools_on_linux)]$ git diff
diff --git a/libraries/AP_Common/Arduino.mk b/libraries/AP_Common/Arduino.mk
index 381125f..8b0e136 100644
--- a/libraries/AP_Common/Arduino.mk
+++ b/libraries/AP_Common/Arduino.mk
@@ -194,8 +194,8 @@ ifeq ($(SYSTYPE),Darwin)
AWK = awk
endif
ifeq ($(SYSTYPE),Linux)
- # expect that tools are on the path
- TOOLPATH := $(subst :, ,$(PATH))
+ # use the tools that come with Arduino
+ TOOLPATH := $(ARDUINO)/hardware/tools/avr/bin
endif
ifeq ($(findstring CYGWIN, $(SYSTYPE)),CYGWIN)
TOOLPATH := $(ARDUINO)/hardware/tools/avr/bin
@@ -216,7 +216,7 @@ AVRDUDE := $(call FIND_TOOL,avrdude)
AVARICE := $(call FIND_TOOL,avarice)
OBJCOPY := $(call FIND_TOOL,avr-objcopy)
ifeq ($(CXX),)
-$(error ERROR: cannot find the compiler tools anywhere on the path $(TOOLPATH))
+$(error ERROR: cannot find the Arduino compiler tools, please set ARDUINO=<path to arduino installation>)
endif

# Find awk

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…