~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_have_gcc_atomics.m4

pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
macros.
Add PANDORA_DRIZZLE_BUILD to run the extra checks that drizzle needs that 
plugins would also need to run so we can just use that macro in generated
external plugin builds.
Added support to register_plugins for external plugin building.
Renamed register_plugins.py to pandora-plugin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl  Copyright (C) 2009 Sun Microsystems
 
2
dnl This file is free software; Sun Microsystems
 
3
dnl gives unlimited permission to copy and/or distribute it,
 
4
dnl with or without modifications, as long as this notice is preserved.
 
5
 
 
6
#--------------------------------------------------------------------
 
7
# Check for GCC Atomic Support
 
8
#--------------------------------------------------------------------
 
9
 
 
10
 
 
11
AC_DEFUN([PANDORA_HAVE_GCC_ATOMICS],[
 
12
        
 
13
  AC_CACHE_CHECK(
 
14
    [whether the compiler provides atomic builtins],
 
15
    [ac_cv_gcc_atomic_builtins],
 
16
    [AC_RUN_IFELSE(
 
17
      [AC_LANG_PROGRAM([],[[
 
18
        int foo= -10; int bar= 10;
 
19
        if (!__sync_fetch_and_add(&foo, bar) || foo)
 
20
          return -1;
 
21
        bar= __sync_lock_test_and_set(&foo, bar);
 
22
        if (bar || foo != 10)
 
23
          return -1;
 
24
        bar= __sync_val_compare_and_swap(&bar, foo, 15);
 
25
        if (bar)
 
26
          return -1;
 
27
        return 0;
 
28
        ]])],
 
29
      [ac_cv_gcc_atomic_builtins=yes],
 
30
      [ac_cv_gcc_atomic_builtins=no])])
 
31
 
 
32
  AS_IF([test "x$ac_cv_gcc_atomic_builtins" = "xyes"],[
 
33
    AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
 
34
              [Define to 1 if compiler provides atomic builtins.])
 
35
  ])
 
36
 
 
37
])
 
 
b'\\ No newline at end of file'