avr-libc-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-commit] [2121] Reimplement CHECK_BUILTIN_DELAY_CYCLES as a com


From: Joerg Wunsch
Subject: [avr-libc-commit] [2121] Reimplement CHECK_BUILTIN_DELAY_CYCLES as a compiler + grep pipeline
Date: Mon, 12 Apr 2010 09:33:49 +0000

Revision: 2121
          http://svn.sv.gnu.org/viewvc/?view=rev&root=avr-libc&revision=2121
Author:   joerg_wunsch
Date:     2010-04-12 09:33:49 +0000 (Mon, 12 Apr 2010)
Log Message:
-----------
Reimplement CHECK_BUILTIN_DELAY_CYCLES as a compiler + grep pipeline
rather than through AC_LINK_IFELSE, as we cannot rely on a working
linker while building the library.

Modified Paths:
--------------
    trunk/avr-libc/ChangeLog
    trunk/avr-libc/configure.ac

Modified: trunk/avr-libc/ChangeLog
===================================================================
--- trunk/avr-libc/ChangeLog    2010-04-12 05:54:15 UTC (rev 2120)
+++ trunk/avr-libc/ChangeLog    2010-04-12 09:33:49 UTC (rev 2121)
@@ -1,5 +1,11 @@
 2010-04-12  Joerg Wunsch <address@hidden>
 
+       * configure.ac (CHECK_BUILTIN_DELAY_CYCLES): Reimplement as a
+       compiler + grep pipeline rather than through AC_LINK_IFELSE, as we
+       cannot rely on a working linker while building the library.
+
+2010-04-12  Joerg Wunsch <address@hidden>
+
        * devtools/gen-avr-lib-tree.sh: Fix directory name for ATxmega64A1U.
 
 2010-04-06  Anitha Boyapati <address@hidden>

Modified: trunk/avr-libc/configure.ac
===================================================================
--- trunk/avr-libc/configure.ac 2010-04-12 05:54:15 UTC (rev 2120)
+++ trunk/avr-libc/configure.ac 2010-04-12 09:33:49 UTC (rev 2121)
@@ -375,15 +375,16 @@
   [
     CC=`echo "${CC}" | sed 's/-mmcu=avr.//'`
     AC_MSG_CHECKING(whether ${CC} supports __builtin_avr_delay_cycles)
-    AC_LINK_IFELSE(
-      [AC_LANG_PROGRAM([extern void __builtin_avr_delay_cycles(unsigned 
long);],
-                      [__builtin_avr_delay_cycles(42);])],
-      [has_delay_cycles=yes],
-      [has_delay_cycles=no]
-    )
-    if test "x$has_delay_cycles" = "xyes"
+    echo "extern void __builtin_avr_delay_cycles(unsigned long);\
+    int main(void) { __builtin_avr_delay_cycles(42); return 0; }" |\
+    ${CC} -S -xc -o- - |\
+    grep __builtin_avr_delay_cycles >/dev/null
+    if test "$?" != "0"
     then
       HAS_DELAY_CYCLES=1
+      has_delay_cycles="yes"
+    else
+      has_delay_cycles="no"
     fi
     AC_MSG_RESULT($has_delay_cycles)
     CC=${old_CC}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]