From: Keith Packard Date: Thu, 10 Oct 2013 16:47:52 +0000 (-0700) Subject: Make sure the AVR compiler can actually link stuff X-Git-Tag: 1.2.9.4~47 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=2296175eff9e4286eaf44451690701a46595987e Make sure the AVR compiler can actually link stuff avr-gcc was broken for a while, causing all linking to fail. Check for that and don't try to build avr bits in that case. Signed-off-by: Keith Packard --- diff --git a/configure.ac b/configure.ac index 8024b7c6..28a673c5 100644 --- a/configure.ac +++ b/configure.ac @@ -330,8 +330,29 @@ 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 - AVR_CC=$with_avr_cc - AVR_OBJCOPY=$with_avr_objcopy + save_CC="$CC" + save_CFLAGS="$CFLAGS" + save_LIBS="$LIBS" + + CC="$with_avr_cc" + 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)