pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/textproc/json-c Fix build errors on GCC < 4.2
details: https://anonhg.NetBSD.org/pkgsrc/rev/e433216ea9e4
branches: trunk
changeset: 634158:e433216ea9e4
user: pho <pho%pkgsrc.org@localhost>
date: Sat May 10 04:09:41 2014 +0000
description:
Fix build errors on GCC < 4.2
diffstat:
textproc/json-c/Makefile | 7 ++++++-
textproc/json-c/distinfo | 3 ++-
textproc/json-c/patches/patch-linkhash.c | 17 +++++++++++++++++
3 files changed, 25 insertions(+), 2 deletions(-)
diffs (52 lines):
diff -r 418b6473fc89 -r e433216ea9e4 textproc/json-c/Makefile
--- a/textproc/json-c/Makefile Sat May 10 00:00:05 2014 +0000
+++ b/textproc/json-c/Makefile Sat May 10 04:09:41 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2014/04/20 00:26:15 ryoon Exp $
+# $NetBSD: Makefile,v 1.9 2014/05/10 04:09:41 pho Exp $
DISTNAME= json-c-0.12
PKGREVISION= 1
@@ -25,4 +25,9 @@
CFLAGS+= -Wno-tautological-compare -Wno-unused-value
.endif
+# gcc < 4.2 does not have -Wno-error= option.
+.if !empty(CC_VERSION:Mgcc-3*) || !empty(CC_VERSION:Mgcc-4.[01]*)
+BUILDLINK_TRANSFORM+= rm:-Werror rm:-Wno-error=deprecated-declarations
+.endif
+
.include "../../mk/bsd.pkg.mk"
diff -r 418b6473fc89 -r e433216ea9e4 textproc/json-c/distinfo
--- a/textproc/json-c/distinfo Sat May 10 00:00:05 2014 +0000
+++ b/textproc/json-c/distinfo Sat May 10 04:09:41 2014 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.4 2014/04/20 00:26:15 ryoon Exp $
+$NetBSD: distinfo,v 1.5 2014/05/10 04:09:41 pho Exp $
SHA1 (json-c-0.12.tar.gz) = 5580aad884076c219d41160cbd8bc12213d12c37
RMD160 (json-c-0.12.tar.gz) = dd6b6560185dddca9b072a3d07af7899bd64cc45
Size (json-c-0.12.tar.gz) = 501419 bytes
SHA1 (patch-json__tokener.c) = 9f32a54060d7569f70c6892209e749cfea5b512d
+SHA1 (patch-linkhash.c) = cb56e1f6eaaa58170e26a9cfb4c87dfe73730c4c
diff -r 418b6473fc89 -r e433216ea9e4 textproc/json-c/patches/patch-linkhash.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/json-c/patches/patch-linkhash.c Sat May 10 04:09:41 2014 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-linkhash.c,v 1.1 2014/05/10 04:09:41 pho Exp $
+
+GCC < 4.1 does not have atomic builtins.
+
+TODO: This check should really be moved to configure.ac.
+
+--- linkhash.c.orig 2014-05-10 03:58:56.000000000 +0000
++++ linkhash.c
+@@ -405,7 +405,7 @@ unsigned long lh_char_hash(const void *k
+ int seed;
+ /* we can't use -1 as it is the unitialized sentinel */
+ while ((seed = json_c_get_random_seed()) == -1);
+-#if defined __GNUC__
++#if defined __GNUC__ && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1
+ __sync_val_compare_and_swap(&random_seed, -1, seed);
+ #elif defined _MSC_VER
+ InterlockedCompareExchange(&random_seed, seed, -1);
Home |
Main Index |
Thread Index |
Old Index