1 # $NetBSD: hacks.mk,v 1.5 2012/06/14 19:53:07 bsiegert Exp $
3 .if
!defined
(CAIRO_HACKS_MK
)
4 CAIRO_HACKS_MK
= defined
7 ### A workaround for MacPorts Ticket #31469
8 ### https://trac.macports.org/ticket/31469
10 .if
${OPSYS} == "Darwin" && !empty
(PKGSRC_COMPILER
:Mgcc
)
11 _BAD_GCC_BUILD
!= ${CC} --version |
(${GREP} -c
'i686-apple-darwin11-llvm-gcc-4\.2\ .*build\ 5658' ||
${TRUE})
12 . if
${_BAD_GCC_BUILD} == "1"
13 PKG_HACKS
+= llvm-lto-hack
14 BUILDLINK_TRANSFORM
+= rm:-flto
18 # Workaround so that pthread is found on MirBSD
19 .if
${OPSYS} == "MirBSD"
20 PTHREAD_CFLAGS
=-fhonour-copts
24 # Workaround for "the pixman problem" with netbsd-5 native X. The
25 # problem is that if the order of rpath options isn't right when
26 # linking client programs (right being /usr/pkg before /usr/X11R7),
27 # the native pixman library gets pulled in instead of the pkgsrc one,
28 # and then the link fails with undefined symbols from cairo; these are
29 # symbols that are present only in the newer pkgsrc pixman. The
30 # problem with rpath options and ordering is complicated by there
31 # being multiple ways of writing them (-R, -Wl,-rpath, etc.) and as
32 # many packages just blat out flags from various sources they don't
33 # necessarily match or come out in the right order.
35 # Some cases of "the pixman problem" were solved with one set of
36 # changes a month ago or so, but other packages still fail for the
37 # reasons cited. In the absence of a wrappers-based general solution
38 # to keep the order correct, most or all remaining instances can be
39 # solved by explicitly adding the necessary pixman lib to the link
40 # line instead of pulling it in via cairo's dependency on it. Or at
41 # least, this fixes the build. It should also make the right things
42 # happen during library search (I think) but that's less clear. I hate
45 # The best way to explicitly add pixman to the link line is to hack it
46 # into cairo's .pc file. This is what we do here.
48 # Note that this hack is also required for 5.99 earlier than whatever
49 # point the necessary updates to X were applied. I'm assuming this is
50 # old enough that nobody's going to care.
52 .if
!empty
(MACHINE_PLATFORM
:MNetBSD-5.
*) && \
53 empty
(MACHINE_PLATFORM
:MNetBSD-5.99.
*) && \
54 ${X11_TYPE} == "native"
55 SUBST_CLASSES
+= pixman
56 SUBST_STAGE.pixman
= post-build
57 SUBST_MESSAGE.pixman
= Hacking pixman into cairo.
pc for the
"pixman problem".
58 SUBST_FILES.pixman
= src
/cairo.
pc
59 SUBST_SED.pixman
= -e
'/^Libs:/s/-lcairo/-lcairo -lpixman-1/'
62 .
endif # CAIRO_HACKS_MK