diff options
author | pho <pho@pkgsrc.org> | 2014-05-10 04:09:41 +0000 |
---|---|---|
committer | pho <pho@pkgsrc.org> | 2014-05-10 04:09:41 +0000 |
commit | fd0f494c884549f6f3a6d8f98b60ec58937c9e23 (patch) | |
tree | bf70ef9308380c87fed8aa5cd375efc23ca153e3 /textproc/json-c | |
parent | ec99dc503bc6e6b4ffda40342fbd3d1daf6ab278 (diff) | |
download | pkgsrc-fd0f494c884549f6f3a6d8f98b60ec58937c9e23.tar.gz |
Fix build errors on GCC < 4.2
Diffstat (limited to 'textproc/json-c')
-rw-r--r-- | textproc/json-c/Makefile | 7 | ||||
-rw-r--r-- | textproc/json-c/distinfo | 3 | ||||
-rw-r--r-- | textproc/json-c/patches/patch-linkhash.c | 17 |
3 files changed, 25 insertions, 2 deletions
diff --git a/textproc/json-c/Makefile b/textproc/json-c/Makefile index f0c831cce58..34061c3e116 100644 --- a/textproc/json-c/Makefile +++ b/textproc/json-c/Makefile @@ -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 @@ CONFIGURE_ARGS+= --disable-oldname-compat 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 --git a/textproc/json-c/distinfo b/textproc/json-c/distinfo index 386fd8cee1c..408343abdae 100644 --- a/textproc/json-c/distinfo +++ b/textproc/json-c/distinfo @@ -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 --git a/textproc/json-c/patches/patch-linkhash.c b/textproc/json-c/patches/patch-linkhash.c new file mode 100644 index 00000000000..279cbdf56bd --- /dev/null +++ b/textproc/json-c/patches/patch-linkhash.c @@ -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); |