From 00646d2700a2f4cf500e716e5a111057e3820475 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 13 Jun 2020 23:09:54 -0700 Subject: [PATCH] Check for picolibc when testing arm compilers Remove configuration checks for newlib as picolibc doesn't need separate configuration variables. Make sure test program actually links as this tests to make sure picolibc is working. Signed-off-by: Keith Packard --- configure.ac | 38 ++++---------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/configure.ac b/configure.ac index 74a96a40..f9031d0b 100644 --- a/configure.ac +++ b/configure.ac @@ -262,18 +262,18 @@ if test "x$HAVE_ARM_CC" = "xyes"; then save_LIBS="$LIBS" CC="$ARM_CC" CFLAGS="-mthumb -mcpu=cortex-m0" - LIBS="-ffreestanding -nostdlib" + LIBS="--specs=picolibc.specs" AC_LANG_PUSH([C]) AC_MSG_CHECKING([if ]$ARM_CC[ supports cortex-m0]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int i;])], + AC_LINK_IFELSE([AC_LANG_PROGRAM([])], [HAVE_ARM_M0_CC=yes], [HAVE_ARM_M0_CC=no]) AC_MSG_RESULT([$HAVE_ARM_M0_CC]) CFLAGS="-mthumb -mcpu=cortex-m3" AC_MSG_CHECKING([if ]$ARM_CC[ supports cortex-m3]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int i;])], + AC_LINK_IFELSE([AC_LANG_PROGRAM([])], [HAVE_ARM_M3_CC=yes], [HAVE_ARM_M3_CC=no]) AC_MSG_RESULT([$HAVE_ARM_M3_CC]) @@ -294,39 +294,10 @@ if test "x$HAVE_ARM_M3_CC" = "xno"; then fi 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 + AC_MSG_WARN([No cortex-m0 arm compiler found, LPC11U14 and STM32F0 binaries will not be built]) 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 @@ -604,7 +575,6 @@ echo " AVR support.................: ${HAVE_AVR_CC}" echo " Android support.............: ${HAVE_ANDROID_SDK}" echo " Android release support.....: ${ANDROID_RELEASE}" echo " STlink support..............: ${HAVE_STLINK}" -echo " Newlib-nano support.........: ${NEWLIB_NANO}" echo " i386 and amd64 libaltos.....: ${MULTI_ARCH}" echo " install shared mime info....: ${INSTALL_SHARED_MIME_INFO}" echo " Strip jar timestamps........: ${STRIP_NONDETERMINISM}" -- 2.30.2