From: Christian P. <cp...@us...> - 2005-04-23 12:00:15
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9938 Modified Files: configure.in Log Message: Added configure check for native atomic integers Index: configure.in =================================================================== RCS file: /cvsroot/pclasses/pclasses2/configure.in,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- configure.in 19 Jan 2005 13:25:55 -0000 1.8 +++ configure.in 23 Apr 2005 12:00:06 -0000 1.9 @@ -70,6 +70,36 @@ AC_FUNC_MMAP dnl +dnl check cpu/compiler type for atomicint support ... +dnl + +AC_MSG_CHECKING([for native atomic int support ...]) +pc_atomic_int="none" + +AC_TRY_COMPILE([], [ + int val; + unsigned char c; + __asm__ __volatile__( + "lock; incl %0; sete %1" + :"=m" (val), "=qm" (c) + :"m" (val) : "memory"); +], pc_atomic_int="gcc_x86") + +AC_TRY_COMPILE([#include <windows.h>], [ + int val; + InterlockedIncrement((volatile LONG*)val); +], pc_atomic_int="win32") + +AC_MSG_RESULT($pc_atomic_int) + +AM_CONDITIONAL(WITH_GCC_X86_ATOMIC_INT, test "$pc_atomic_int" = "gcc_x86") +AM_CONDITIONAL(WITH_WIN32_ATOMIC_INT, test "$pc_atomic_int" = "win32") + +if test "$pc_atomic_int" != "none"; then + AC_DEFINE_UNQUOTED(HAVE_ATOMIC_INT, 1, [Defined if atomic integers are supported]) +fi + +dnl dnl check for threading libraries dnl ACX_PTHREAD |