summaryrefslogtreecommitdiff
path: root/textproc/icu
diff options
context:
space:
mode:
authorobache <obache@pkgsrc.org>2014-03-04 12:07:16 +0000
committerobache <obache@pkgsrc.org>2014-03-04 12:07:16 +0000
commit4856eea5cb4d65ef1a77bd5ab003e60fb4ee441b (patch)
tree496855d7dd53c6756dcca28395023c936b50c8c0 /textproc/icu
parent942d966769135035d22ba9008817d764e73432d0 (diff)
downloadpkgsrc-4856eea5cb4d65ef1a77bd5ab003e60fb4ee441b.tar.gz
Add NetBSD MI atomic_ops support.
Based on PR pkg/48608 by Izumi Tsutsui.
Diffstat (limited to 'textproc/icu')
-rw-r--r--textproc/icu/distinfo6
-rw-r--r--textproc/icu/patches/patch-common_umutex.h41
-rw-r--r--textproc/icu/patches/patch-configure28
-rw-r--r--textproc/icu/patches/patch-configure.ac36
4 files changed, 107 insertions, 4 deletions
diff --git a/textproc/icu/distinfo b/textproc/icu/distinfo
index f96b71fcb27..6d84c64e232 100644
--- a/textproc/icu/distinfo
+++ b/textproc/icu/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.43 2013/12/04 21:02:23 richard Exp $
+$NetBSD: distinfo,v 1.44 2014/03/04 12:07:16 obache Exp $
SHA1 (icu4c-52_1-src.tgz) = 6de440b71668f1a65a9344cdaf7a437291416781
RMD160 (icu4c-52_1-src.tgz) = cbfbb18c3991ba55ebb50c607d5208cbfeb9fce3
@@ -11,12 +11,14 @@ SHA1 (patch-ad) = 8189e81e9c624e3b7a42f9af65a4b2f334747284
SHA1 (patch-af) = dcfbaf16844292a9ae57536ae2fb62fd1659d067
SHA1 (patch-common_Makefile.in) = 20fa472bd0e5e5fac15153774a58a8ce034d1996
SHA1 (patch-common_putilimp.h) = a68faa97c2bffeecaca1586e26f5bbe48e71b262
+SHA1 (patch-common_umutex.h) = 096d3e15ef7b84533456af4570ed70747a4ef70c
SHA1 (patch-common_unicode_platform.h) = 82786dff790782eb07cdc527061de33e771ec63c
SHA1 (patch-common_uposixdefs.h) = abe1989ea4312702e5d0172b662409957b3e2d91
SHA1 (patch-config_icu-config-bottom) = 168b89ee9180d4ae545125866ee91eb004010501
SHA1 (patch-config_mh-cygwin) = e3aa7a926244b448ce12ab2f89156348a02c0659
SHA1 (patch-config_mh-solaris-gcc) = f81fec8f0d232b9125c7ea7ec334b78872aa2025
-SHA1 (patch-configure) = f8151a2b51cdfd1d6a1d9d8cf316a52c5eae7050
+SHA1 (patch-configure) = bea560028b869defa7b5eab8c148aaf6f0e8f3ee
+SHA1 (patch-configure.ac) = d90bf98e97cb2051dd64b847b97092440c1c03f8
SHA1 (patch-data_Makefile.in) = a5dcfe848a0444f0a1c036b7f4e343468bf3b3d1
SHA1 (patch-i18n_Makefile.in) = 935965c0418994271d844a4c908cd9e1fe8279fd
SHA1 (patch-io_Makefile.in) = f5f5eabb31ea7120130d13c397fab1feddd30447
diff --git a/textproc/icu/patches/patch-common_umutex.h b/textproc/icu/patches/patch-common_umutex.h
new file mode 100644
index 00000000000..7b928fadccd
--- /dev/null
+++ b/textproc/icu/patches/patch-common_umutex.h
@@ -0,0 +1,41 @@
+$NetBSD: patch-common_umutex.h,v 1.1 2014/03/04 12:07:16 obache Exp $
+
+* Add NetBSD MI atomic_ops(3) support
+
+--- common/umutex.h.orig 2013-10-04 20:49:16.000000000 +0000
++++ common/umutex.h
+@@ -117,6 +117,34 @@ inline int32_t umtx_atomic_dec(u_atomic_
+ U_NAMESPACE_END
+
+
++#elif U_HAVE_NETBSD_ATOMIC_OPS
++/*
++ * NetBSD MI atomic_ops(3)
++ */
++
++U_NAMESPACE_BEGIN
++#include <sys/atomic.h>
++typedef volatile uint32_t u_atomic_int32_t;
++#define ATOMIC_INT32_T_INITIALIZER(val) val
++
++inline int32_t umtx_loadAcquire(u_atomic_int32_t &var) {
++ return atomic_cas_32(&var, 0, 0);
++}
++
++inline void umtx_storeRelease(u_atomic_int32_t &var, int32_t val) {
++ atomic_swap_32(&var, val);
++}
++
++inline int32_t umtx_atomic_inc(u_atomic_int32_t *p) {
++ return atomic_inc_32_nv(p);
++}
++
++inline int32_t umtx_atomic_dec(u_atomic_int32_t *p) {
++ return atomic_dec_32_nv(p);
++}
++U_NAMESPACE_END
++
++
+ #elif U_HAVE_GCC_ATOMICS
+ /*
+ * gcc atomic ops. These are available on several other compilers as well.
diff --git a/textproc/icu/patches/patch-configure b/textproc/icu/patches/patch-configure
index ea817036328..f2bd91b814e 100644
--- a/textproc/icu/patches/patch-configure
+++ b/textproc/icu/patches/patch-configure
@@ -1,4 +1,4 @@
-$NetBSD: patch-configure,v 1.2 2013/12/04 21:02:23 richard Exp $
+$NetBSD: patch-configure,v 1.3 2014/03/04 12:07:16 obache Exp $
Portability fix.
Solaris seems to need -std=c99 with recent pkgsrc so keep it
@@ -25,7 +25,31 @@ and at the same time fix a typo involving CXXFLAGS.
# 2. try xarch=v9 [deprecated]
## TODO: cross compile: the following won't work.
SPARCV9=`isainfo -n 2>&1 | grep sparcv9`
-@@ -7442,13 +7439,13 @@ fi
+@@ -5452,6 +5449,23 @@ if test "x$ac_cv_header_elf_h" = "xyes";
+ CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_HAVE_ELF_H=1";
+ fi
+
++# check if sys/atomic.h is present.
++for ac_header in sys/atomic.h
++do :
++ ac_fn_c_check_header_mongrel "$LINENO" "sys/atomic.h" "ac_cv_header_sys_atomic_h" "$ac_includes_default"
++if test "x$ac_cv_header_sys_atomic_h" = xyes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_SYS_ATOMIC_H 1
++_ACEOF
++
++fi
++
++done
++
++if test "x$ac_cv_header_sys_atomic_h" = "xyes"; then
++ CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_HAVE_NETBSD_ATOMIC_OPS=1";
++fi
++
+ U_ENABLE_DYLOAD=1
+ enable=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable dynamic loading of plugins" >&5
+@@ -7442,13 +7456,13 @@ fi
# Now that we're done using CPPFLAGS etc. for tests, we can change it
# for build.
diff --git a/textproc/icu/patches/patch-configure.ac b/textproc/icu/patches/patch-configure.ac
new file mode 100644
index 00000000000..428f186f47f
--- /dev/null
+++ b/textproc/icu/patches/patch-configure.ac
@@ -0,0 +1,36 @@
+$NetBSD: patch-configure.ac,v 1.1 2014/03/04 12:07:16 obache Exp $
+
+* Detect NetBSD libatomic
+* test(1) portability fix
+
+--- configure.ac.orig 2013-10-04 20:54:58.000000000 +0000
++++ configure.ac
+@@ -407,6 +407,12 @@ if test "x$ac_cv_header_elf_h" = "xyes";
+ CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_HAVE_ELF_H=1";
+ fi
+
++# check if sys/atomic.h is present.
++AC_CHECK_HEADERS([sys/atomic.h])
++if test "x$ac_cv_header_sys_atomic_h" = "xyes"; then
++ CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_HAVE_NETBSD_ATOMIC_OPS=1";
++fi
++
+ U_ENABLE_DYLOAD=1
+ enable=yes
+ AC_MSG_CHECKING([whether to enable dynamic loading of plugins])
+@@ -1249,13 +1255,13 @@ fi
+ # Now that we're done using CPPFLAGS etc. for tests, we can change it
+ # for build.
+
+-if test "${CC}" == "clang"; then
++if test "${CC}" = "clang"; then
+ CLANGCFLAGS="-Qunused-arguments -Wno-parentheses-equality"
+ else
+ CLANGCFLAGS=""
+ fi
+
+-if test "${CXX}" == "clang++"; then
++if test "${CXX}" = "clang++"; then
+ CLANGCXXFLAGS="-Qunused-arguments -Wno-parentheses-equality"
+ else
+ CLANGCXXFLAGS=""