+ AC_MSG_WARN([SDCC not found, cc1111 binaries will not be built])
+else
+ SDCC=$with_sdcc
+fi
+
+AC_SUBST(SDCC)
+AC_SUBST(HAVE_SDCC)
+
+#
+# Configure ARM compiler for STM32L and LPC11U14
+#
+
+AC_ARG_WITH([arm-cc],
+ [AS_HELP_STRING([--with-arm-cc],
+ [Name of ARM C compiler])],
+ [],
+ [with_arm_cc=auto])
+
+if test "x$with_arm_cc" != "xno"; then
+ if test "x$with_arm_cc" = "xauto"; then
+ with_arm_cc="arm-none-eabi-gcc"
+ AC_CHECK_PROG([HAVE_ARM_CC],[$with_arm_cc], yes, no)
+ else
+ HAVE_ARM_CC=yes
+ fi
+else
+ HAVE_ARM_CC=no
+fi
+
+if test "x$HAVE_ARM_CC" = "xno"; then
+ AC_MSG_WARN([Arm compiler not found, ARM binaries will not be built])
+else
+ ARM_CC=$with_arm_cc
+fi
+AC_SUBST(HAVE_ARM_CC)
+AC_SUBST(ARM_CC)
+
+if test "x$HAVE_ARM_CC" = "xyes"; then
+ save_CC="$CC"
+ save_CFLAGS="$CFLAGS"
+ save_LIBS="$LIBS"
+ CC="$ARM_CC"
+ CFLAGS="-mthumb -mcpu=cortex-m0"
+ LIBS="-ffreestanding -nostdlib"
+ AC_LANG_PUSH([C])
+
+ AC_MSG_CHECKING([if ]$ARM_CC[ supports cortex-m0])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int i;])],
+ [HAVE_ARM_M0_CC=yes],
+ [HAVE_ARM_M0_CC=no])
+ AC_MSG_RESULT([$HAVE_ARM_M0_CC])
+
+ AC_CHECK_LIB(pdclib-cortex-m0,memcpy,
+ [],
+ [HAVE_ARM_M0_CC=no])
+
+ CFLAGS="-mthumb -mcpu=cortex-m3"
+ AC_MSG_CHECKING([if ]$ARM_CC[ supports cortex-m3])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int i;])],
+ [HAVE_ARM_M3_CC=yes],
+ [HAVE_ARM_M3_CC=no])
+ AC_MSG_RESULT([$HAVE_ARM_M3_CC])
+
+ AC_CHECK_LIB(pdclib-cortex-m3,memcpy,
+ [],
+ [HAVE_ARM_M3_CC=no])
+
+ AC_LANG_POP([C])
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+ CC="$save_CC"
+else
+ HAVE_ARM_M3_CC=no
+ HAVE_ARM_M0_CC=no
+fi
+AC_SUBST(HAVE_ARM_M3_CC)
+AC_SUBST(HAVE_ARM_M0_CC)
+
+if test "x$HAVE_ARM_M3_CC" = "xno"; then
+ AC_MSG_WARN([No cortex-m3 arm compiler found, STM32L binaries will not be built])