aboutsummaryrefslogtreecommitdiffstats
path: root/testing/kyotocabinet/kyotocabinet-1.2.76-8-byte-atomics.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-03-19 09:29:57 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-03-19 09:47:02 +0000
commitd9d7bc2eac13cd9c52ab05b830c212a1c84f9dd0 (patch)
tree29b1e3b07c8c4d89d21bce847760084f076f4791 /testing/kyotocabinet/kyotocabinet-1.2.76-8-byte-atomics.patch
parent5816caf905555f062a14916a1be29adbc57d07ad (diff)
downloadaports-d9d7bc2eac13cd9c52ab05b830c212a1c84f9dd0.tar.bz2
aports-d9d7bc2eac13cd9c52ab05b830c212a1c84f9dd0.tar.xz
testing/kyotocabinet: new aport
A straightforward implementation of DBM http://fallabs.com/kyotocabinet/
Diffstat (limited to 'testing/kyotocabinet/kyotocabinet-1.2.76-8-byte-atomics.patch')
-rw-r--r--testing/kyotocabinet/kyotocabinet-1.2.76-8-byte-atomics.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/testing/kyotocabinet/kyotocabinet-1.2.76-8-byte-atomics.patch b/testing/kyotocabinet/kyotocabinet-1.2.76-8-byte-atomics.patch
new file mode 100644
index 0000000000..f9417e93c4
--- /dev/null
+++ b/testing/kyotocabinet/kyotocabinet-1.2.76-8-byte-atomics.patch
@@ -0,0 +1,74 @@
+Patch by Shawn Landden <shawnlandden@gmail.com> for kyotocabinet >= 1.2.76, which fixes
+the configure test to handle lack of 8 byte atomics correctly as is the case with ARM 32
+bit on all Fedora releases, Intel 32 bit on RHEL 5 and PowerPC 32 bit on RHEL 5 and all
+Fedora releases.
+
+--- kyotocabinet-1.2.76/configure.in 2012-05-24 13:31:42.000000000 +0200
++++ kyotocabinet-1.2.76/configure.in.8-byte-atomics 2013-03-01 00:21:21.000000000 +0100
+@@ -238,9 +238,22 @@
+ # Atomic operations
+ if test "$enable_atomic" != "no"
+ then
+- printf 'checking for atomic operations... '
+- AC_TRY_COMPILE([], [__sync_fetch_and_add], [MYGCCATOMIC=yes], [MYGCCATOMIC=no])
+- if test "$MYGCCATOMIC" = "yes"
++ printf 'checking for 8 byte atomic operations... '
++ if printf '
++/* Some targets support 4 byte atomics, but not 8 byte atomics,
++ * and will fail at link time if they are used.
++ *
++ * http://gcc.gnu.org/onlinedocs/gcc-4.6.3/gcc/Atomic-Builtins.html
++ * http://gcc.gnu.org/wiki/Atomic
++ */
++#include <stdint.h>
++int
++main ()
++{
++uint64_t n = 0xdeadbeaf;
++__sync_bool_compare_and_swap(&n, 0xdeadbeaf, 0);
++return n;
++}' | $CC -xc -o config.tmp - >/dev/null 2>&1
+ then
+ MYCPPFLAGS="$MYCPPFLAGS -D_MYGCCATOMIC"
+ printf 'yes\n'
+--- kyotocabinet-1.2.76/configure 2012-05-24 13:31:45.000000000 +0200
++++ kyotocabinet-1.2.76/configure.8-byte-atomics 2013-03-01 00:22:37.000000000 +0100
+@@ -4012,25 +4012,22 @@
+ # Atomic operations
+ if test "$enable_atomic" != "no"
+ then
+- printf 'checking for atomic operations... '
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h. */
+-
++ printf 'checking for 8 byte atomic operations... '
++ if printf '
++/* Some targets support 4 byte atomics, but not 8 byte atomics,
++ * and will fail at link time if they are used.
++ *
++ * http://gcc.gnu.org/onlinedocs/gcc-4.6.3/gcc/Atomic-Builtins.html
++ * http://gcc.gnu.org/wiki/Atomic
++ */
++#include <stdint.h>
+ int
+ main ()
+ {
+-__sync_fetch_and_add
+- ;
+- return 0;
+-}
+-_ACEOF
+-if ac_fn_cxx_try_compile "$LINENO"; then :
+- MYGCCATOMIC=yes
+-else
+- MYGCCATOMIC=no
+-fi
+-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+- if test "$MYGCCATOMIC" = "yes"
++uint64_t n = 0xdeadbeaf;
++__sync_bool_compare_and_swap(&n, 0xdeadbeaf, 0);
++return n;
++}' | $CC -xc -o config.tmp - >/dev/null 2>&1
+ then
+ MYCPPFLAGS="$MYCPPFLAGS -D_MYGCCATOMIC"
+ printf 'yes\n'