[libdispatch-changes] [58] trunk
source_changes at macosforge.org
source_changes at macosforge.org
Tue Oct 27 16:24:40 PDT 2009
Revision: 58
http://trac.macosforge.org/projects/libdispatch/changeset/58
Author: robert at fledge.watson.org
Date: 2009-10-27 16:24:40 -0700 (Tue, 27 Oct 2009)
Log Message:
-----------
Move atomic builtin detections to separate autoconf macro.
Submitted by: Paolo Bonzini <bonzini at gnu.org>
Modified Paths:
--------------
trunk/configure.ac
Added Paths:
-----------
trunk/m4/atomic.m4
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2009-10-27 23:11:08 UTC (rev 57)
+++ trunk/configure.ac 2009-10-27 23:24:40 UTC (rev 58)
@@ -109,24 +109,7 @@
AM_INIT_AUTOMAKE([foreign])
-#
-# This is a bit subtle: on i386 systems without at least -march=i486 defined,
-# certain built-in atomics fall back to depending on undefined symbols if
-# their return values are used.
-#
-AC_CACHE_CHECK([for gcc atomic builtins],[dispatch_cv_atomic],
-[AC_LINK_IFELSE([AC_LANG_PROGRAM([],[[
-int i, x =0;
-i = __sync_add_and_fetch(&x,1);
-return x;]])],[dispatch_cv_atomic=yes],
- [saveCFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -march=i486"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[[
- int i, x =0;
- i = __sync_add_and_fetch(&x,1);
- return x;]])],[CFLAGS="$saveCFLAGS"
-dispatch_cv_atomic="-march=i486"
-])])])
+DISPATCH_C_ATOMIC_BUILTINS
case $dispatch_cv_atomic in
yes) ;;
Added: trunk/m4/atomic.m4
===================================================================
--- trunk/m4/atomic.m4 (rev 0)
+++ trunk/m4/atomic.m4 2009-10-27 23:24:40 UTC (rev 58)
@@ -0,0 +1,21 @@
+AC_DEFUN([DISPATCH_C_ATOMIC_BUILTINS], [
+#
+# This is a bit subtle: on i386 systems without at least -march=i486 defined,
+# certain built-in atomics fall back to depending on undefined symbols if
+# their return values are used.
+#
+AC_CACHE_CHECK([for gcc atomic builtins],[dispatch_cv_atomic],
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([],[[
+int i, x =0;
+i = __sync_add_and_fetch(&x,1);
+return x;]])],[dispatch_cv_atomic=yes],
+ [saveCFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -march=i486"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[[
+ int i, x =0;
+ i = __sync_add_and_fetch(&x,1);
+ return x;]])],[CFLAGS="$saveCFLAGS"
+dispatch_cv_atomic="-march=i486"
+])])])
+
+])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/libdispatch-changes/attachments/20091027/d5bde51c/attachment.html>
More information about the libdispatch-changes
mailing list