Sat Mar 31 20:17:13 2012 UTC ()
Make CFLAGS.SunOS specific to gcc>=4.6

On SunOS, gcc 4.6 and later enable c99 and XPG6 features for c++, but
the configure check for iconv uses plain c and gets a pre-XPG6 prototype
for iconv(). This inconsistency then leads to failure when building
preconv.


(hans)
diff -r1.62 -r1.63 pkgsrc/textproc/groff/Makefile

cvs diff -r1.62 -r1.63 pkgsrc/textproc/groff/Makefile (expand / switch to context diff)
--- pkgsrc/textproc/groff/Makefile 2012/02/29 13:34:24 1.62
+++ pkgsrc/textproc/groff/Makefile 2012/03/31 20:17:13 1.63
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.62 2012/02/29 13:34:24 hans Exp $
+# $NetBSD: Makefile,v 1.63 2012/03/31 20:17:13 hans Exp $
 #
 
 DISTNAME=	groff-1.20.1
@@ -22,8 +22,6 @@
 USE_TOOLS+=		perl:run sed:run awk:run
 USE_FEATURES=		getopt_long
 
-CFLAGS.SunOS+=		-std=c99 -D_XOPEN_SOURCE=600
-
 INFO_FILES=		YES
 
 REPLACE_AWK+=		font/devlj4/generate/special.awk
@@ -56,6 +54,11 @@
 BUILD_DEFS+=	PAPERSIZE
 .if defined(PAPERSIZE)
 CONFIGURE_ENV+=	PAGE=${PAPERSIZE:Q}
+.endif
+
+.include "../../mk/compiler.mk"
+.if !empty(CC_VERSION:Mgcc-4.[6-9].*)
+CFLAGS.SunOS+=		-std=c99 -D_XOPEN_SOURCE=600
 .endif
 
 # Usually the mdoc.local "volume-operating-system" definition is for