Merge from vendor branch TNF:
[pkgsrcv2.git] / devel / bison / hacks.mk
1 # $NetBSD: hacks.mk,v 1.2 2007/02/22 19:26:20 wiz Exp $
2
3 .if !defined(BISON_HACKS_MK)
4 BISON_HACKS_MK= defined
5
6 .include "../../mk/compiler.mk"
7
8 ### [Tue Nov  2 17:30:48 GMT 2004 : sketch]
9 ### bison's quotearg_buffer_restyled() has issues with certain compilers
10 ### (in particular, SunPro on Solaris/sparc) using optimisation flags.
11 ### The resulting bison with optimisation breaks on at least net/libIDL.
12 ###
13 .if !empty(PKGSRC_COMPILER:Msunpro)
14 PKG_HACKS+=             optimisation
15 BUILDLINK_TRANSFORM+=   rm:-O[0-9]*
16 .endif
17
18 ### gcc-4.5.3 in NetBSD/arm 5.99.59 also breaks bison in net/libIDL.
19 ### -O seems enough for workaround in this case.
20 .if !empty(MACHINE_PLATFORM:MNetBSD-*-arm) && !empty(CC_VERSION:Mgcc-4.5.*)
21 PKG_HACKS+=             optimisation
22 BUILDLINK_TRANSFORM+=   rename:-O[0-9]*:-O
23 .endif
24
25 .endif  # BISON_HACKS_MK