+if test "x$HAVE_ARM_M0_CC" = "xno"; then
+ AC_MSG_WARN([No cortex-m0 arm compiler found, LPC11U14 binaries will not be built])
+fi
+
+AC_ARG_WITH([newlib-nano],
+ [AS_HELP_STRING([--with-newlib-nano],
+ [Root of newlib nano install])],
+ [],
+ [with_newlib_nano=auto])
+
+HAVE_NEWLIB_NANO=no
+if test "x$with_newlib_nano" != "xno"; then
+ if test "x$with_newlib_nano" = "xauto"; then
+ for d in /usr/local/lib/newlib-nano /usr/lib/newlib-nano; do
+ if test "x$with_newlib_nano" = "xauto" -a -d "$d"; then
+ with_newlib_nano="$d"
+ HAVE_NEWLIB_NANO=yes
+ fi
+ done
+ else
+ HAVE_NEWLIB_NANO=yes
+ fi
+fi
+
+if test "x$HAVE_NEWLIB_NANO" = "xno"; then
+ AC_MSG_WARN([No newlib-nano library found, ARM binaries will not be built])
+ HAVE_ARM_M3_CC=no
+ HAVE_ARM_M0_CC=no
+else
+ NEWLIB_NANO="$with_newlib_nano"
+fi
+
+AC_SUBST(HAVE_NEWLIB_NANO)
+AC_SUBST(NEWLIB_NANO)
+
+#
+# Configure AVR compiler
+#
+
+AC_ARG_WITH([avr-cc],
+ [AS_HELP_STRING([--with-avr-cc],
+ [Name of AVR C compiler])],
+ [],
+ [with_avr_cc=auto])
+
+if test "x$with_avr_cc" != "xno"; then
+ if test "x$with_avr_cc" = "xauto"; then
+ with_avr_cc="avr-gcc"
+ AC_CHECK_PROG([HAVE_AVR_CC],[$with_avr_cc], yes, no)
+ else
+ HAVE_AVR_CC=yes
+ fi
+else
+ HAVE_AVR_CC=no
+fi
+
+AC_ARG_WITH([avr-objcopy],
+ [AS_HELP_STRING([--with-avr-objcopy],
+ [Name of AVR objcopy])],
+ [],
+ [with_avr_objcopy=auto])
+
+if test "x$with_avr_objcopy" != "xno"; then
+ if test "x$with_avr_objcopy" = "xauto"; then
+ with_avr_objcopy="avr-objcopy"
+ AC_CHECK_PROG([HAVE_AVR_OBJCOPY],[$with_avr_objcopy], yes, no)
+ else
+ HAVE_AVR_OBJCOPY=yes
+ fi
+else
+ HAVE_AVR_OBJCOPY=no
+fi
+
+if test "x$HAVE_AVR_CC" = "xno" -o "x$HAVE_AVR_OBJCOPY" = "xno"; then
+ AC_MSG_WARN([AVR compiler and objcopy not found, atmel binaries will not be built])
+ HAVE_AVR_CC=no
+else
+ save_CC="$CC"
+ save_CFLAGS="$CFLAGS"
+ save_LIBS="$LIBS"
+
+ CC="$with_avr_cc"
+ CFLAGS="-mmcu=attiny85"
+ AC_LANG_PUSH([C])
+ AC_MSG_CHECKING([if ]$with_avr_cc[ can link programs])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
+ [AVR_LINK=yes],
+ [AVR_LINK=no])
+ AC_MSG_RESULT([$AVR_LINK])
+ AC_LANG_POP([C])
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+ CC="$save_CC"
+
+ if test "x$AVR_LINK" = xyes; then
+ AVR_CC=$with_avr_cc
+ AVR_OBJCOPY=$with_avr_objcopy
+ else
+ HAVE_AVR_CC=no;
+ fi
+fi
+
+AC_SUBST(AVR_CC)
+AC_SUBST(AVR_OBJCOPY)
+AC_SUBST(HAVE_AVR_CC)
+