Update sysutils/cfengine36 to version 3.6.1_1,1
[dports.git] / graphics / dri / Makefile
1 # Created by: Eric Anholt <anholt@FreeBSD.org>
2 # $FreeBSD$
3
4 PORTNAME=       dri
5 PORTVERSION=    ${MESAVERSION}
6 PORTREVISION=   5
7 PORTEPOCH=      2
8 CATEGORIES=     graphics
9
10 COMMENT=        OpenGL hardware acceleration drivers for the DRI
11
12 LIB_DEPENDS=    libdrm.so:${PORTSDIR}/graphics/libdrm \
13                 libexpat.so:${PORTSDIR}/textproc/expat2
14
15 USES+=          gettext:build
16 USE_XORG=       glproto x11 xext xxf86vm xdamage xfixes dri2proto
17
18 .include <bsd.port.options.mk>
19
20 # gcc from base can't handle some code in mesa 9.1+
21 # We only care for 9.x and 8.x, not for old pre-clang default current.
22 # This is for 0b0000 binary which gcc 4.3+ understands and is in the i965 driver.
23 .if defined(WITH_NEW_XORG)
24 . if (${OSVERSION} >= 901500 && ${OSVERSION} < 1000000) \
25                 && ${ARCH} == x86_64
26 CC=clang
27 CXX=clang++
28 CPP=clang-cpp
29 . elif ${OSVERSION} < 901500
30 USE_GCC=yes
31 . endif
32 .endif
33
34 ALL_DRI_DRIVERS=I915 I965 R200 RADEON SWRAST
35
36 .if !defined(WITH_NEW_XORG)
37 ALL_DRI_DRIVERS+=I810 MACH64 MGA R128 R300 R600 SAVAGE SIS TDFX UNICHROME
38 .endif
39
40 .include "${.CURDIR}/../../graphics/libGL/bsd.mesalib.mk"
41
42 PLIST_SUB+=     VERSION=${MESADISTVERSION}
43
44 .if ${ARCH} == x86_64 || ${ARCH} == i386 || ${ARCH} == ia64
45 DRI_DRIVERS=    ${ALL_DRI_DRIVERS}
46 .endif
47
48 .if defined(WITH_NEW_XORG)
49 . if !defined(WITHOUT_GALLIUM) && (${ARCH} == i386 || ${ARCH} == x86_64)
50 BUILD_DEPENDS+= llvm-config33:${PORTSDIR}/devel/llvm33
51 CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config33
52
53 CONFIGURE_ARGS+=--enable-gallium-llvm --disable-gallium-egl
54
55 CONFIGURE_ARGS+=--with-gallium-drivers=r300,r600,radeonsi,svga,swrast
56 PLIST_SUB+=     GALLIUM=""
57 . else
58 CONFIGURE_ARGS+=--enable-gallium-llvm=no --without-gallium-drivers
59 PLIST_SUB+=     GALLIUM="@comment "
60 . endif
61 . if ${ARCH} == powerpc || ${ARCH} == powerpc64
62 DRI_DRIVERS=    RADEON SWRAST
63 . endif
64 . if ${ARCH} == sparc64 || ${ARCH} == armv6
65 DRI_DRIVERS=    SWRAST
66 . endif
67 .else # !defined(WITH_NEW_XORG)
68 . if ${ARCH} == powerpc || ${ARCH} == powerpc64
69 DRI_DRIVERS=    MACH64 RADEON SWRAST TDFX
70 . elif ${ARCH} == sparc64
71 DRI_DRIVERS=    MACH64 RADEON SWRAST
72 . endif
73 .endif # defined(WITH_NEW_XORG)
74
75 # empty for unsupported arches
76 DRI_DRIVERS+=
77
78 .for _d in ${ALL_DRI_DRIVERS}
79 .if ${DRI_DRIVERS:M${_d}}
80 PLIST_SUB+=     ${_d}_DRIVER=""
81 .else
82 PLIST_SUB+=     ${_d}_DRIVER="@comment "
83 .endif
84 .endfor
85
86 .if !(${ARCH} == x86_64 || ${ARCH} == i386)
87 CONFIGURE_ARGS+=--disable-gallium-intel
88 .endif
89 CONFIGURE_ARGS+=--with-dri-drivers="${DRI_DRIVERS:tl}"
90
91 .if defined(WITH_NEW_XORG) && !defined(WITH_GALLIUM) \
92         && (${ARCH} == i386 || ${ARCH} == x86_64)
93 pre-everything::
94         @${ECHO_MSG} ""
95         @${ECHO_MSG} "For r300, r600, radeonsi and swrast gallium based drivers."
96         @${ECHO_MSG} "Please define WITH_GALLIUM in /etc/make.conf"
97         @${ECHO_MSG} "Note that gallium support is highly experimental."
98         @${ECHO_MSG} ""
99 .endif
100
101 post-install:
102 .if defined(WITH_NEW_XORG)
103         @${RM} -f ${STAGEDIR}${PREFIX}/include/GL/*.h
104         @${RM} ${STAGEDIR}${PREFIX}/lib/libGL.*
105         @${RM} ${STAGEDIR}${PREFIX}/lib/libglapi.*
106         @${RM} -f ${STAGEDIR}${PREFIX}/libdata/pkgconfig/gl.pc  
107 .else
108         @${RM} -f ${STAGEDIR}${PREFIX}/include/GL/*.h
109         @${RM} -rf ${STAGEDIR}${PREFIX}/lib/.libGL
110         @${RM} -f ${STAGEDIR}${PREFIX}/libdata/pkgconfig/gl.pc  
111 .endif
112
113 .include <bsd.port.mk>