Subject: Re: pkg/33403: Can't build perl module written by C++
To: None <jlam@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,>
From: Johnny C. Lam <jlam@pkgsrc.org>
List: pkgsrc-bugs
Date: 05/01/2006 17:15:04
The following reply was made to PR pkg/33403; it has been noted by GNATS.
From: "Johnny C. Lam" <jlam@pkgsrc.org>
To: obata@lins.jp
Cc: gnats-bugs@NetBSD.org
Subject: Re: pkg/33403: Can't build perl module written by C++
Date: Mon, 1 May 2006 17:14:44 +0000
--J/dobhs11T7y2rNN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Mon, May 01, 2006 at 12:45:00PM +0000,
> ===> Building for p5-mecab-0.91
> cp MeCab.pm blib/lib/MeCab.pm
> c++ -c -I/usr/pkg/include -fno-strict-aliasing -pipe -I/usr/pkg/include -O2 -I/usr/pkg/include -I/usr/include -I/usr/pkg/include -I/usr/include -DVERSION=\"0.91\" -DXS_VERSION=\"0.91\" -DPIC -fPIC "-I/usr/pkg/lib/perl5/5.8.0/i386-netbsd-thread-multi/CORE" MeCab_wrap.cxx
> In file included from MeCab_wrap.cxx:708:
> /usr/pkgsrc/wip/p5-mecab/work/.buildlink/lib/perl5/5.8.0/i386-netbsd-thread-multi/CORE/perl.h:2700: error: parse
> error before `__attribute__'
Could you please try the attached patch? I believe it is more in the
spirit of how the Perl developers are currently trying to handle GCC
__attribute__ expressions in the Perl codebase. Please let me know if
this works for you.
Thanks,
-- Johnny Lam <jlam@pkgsrc.org>
--J/dobhs11T7y2rNN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="perl.diff"
$NetBSD$
--- perl.h.orig 2006-01-13 13:17:12.000000000 -0500
+++ perl.h
@@ -2375,7 +2375,11 @@ typedef struct clone_params CLONE_PARAMS
# define HASATTRIBUTE_PURE
# endif
# if __GNUC__ >= 3 /* gcc 3.0 -> */ /* XXX Verify this version */
-# define HASATTRIBUTE_UNUSED
+# if !defined(__cplusplus)
+# define HASATTRIBUTE_UNUSED
+# elif (__GNUC__ == 3 && __GNUC_MINOR >= 4 || __GNUC__ > 3) /* g++ 3.4 -> */
+# define HASATTRIBUTE_UNUSED
+# endif
# endif
# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 /* 3.4 -> */
# define HASATTRIBUTE_WARN_UNUSED_RESULT
--J/dobhs11T7y2rNN--