summaryrefslogtreecommitdiff
path: root/lib/libEGL/Makefile
blob: f7604c79e60e5be314bf55f98401ea857a0acfa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# $OpenBSD: Makefile,v 1.6 2014/01/19 03:20:40 jsg Exp $
.include <bsd.xconf.mk>

LIB=	EGL

MESA=	${.CURDIR}/../../dist/Mesa/src/mesa
EGL=	${.CURDIR}/../../dist/Mesa/src/egl
MESA_INCLUDE=	${.CURDIR}/../../dist/Mesa/include

MESA_MAJOR=	9
MESA_MINOR=	2
MESA_TINY=	5

DRI_DRIVER_INSTALL_DIR=	${X11BASE}/lib/modules/dri
EGL_DRIVER_SEARCH_DIR=	${X11BASE}/lib/modules/egl


INCSDIR=	${X11BASE}/include/EGL
KHRINCSDIR=	${X11BASE}/include/KHR

INCS= \
	eglext.h \
	egl.h \
	eglmesaext.h \
	eglplatform.h

KHRINCS= \
	khrplatform.h

EGL_SOURCES= \
	eglapi.c \
	eglarray.c \
	eglconfig.c \
	eglcontext.c \
	eglcurrent.c \
	egldisplay.c \
	egldriver.c \
	eglfallbacks.c \
	eglglobals.c \
	eglimage.c \
	egllog.c \
	eglmisc.c \
	eglmode.c \
	eglscreen.c \
	eglstring.c \
	eglsurface.c \
	eglsync.c \
	eglcompiler.h \
	eglconfig.h \
	eglcontext.h \
	eglcurrent.h \
	egldefines.h \
	egldisplay.h \
	egldriver.h \
	eglglobals.h \
	eglimage.h \
	egllog.h \
	eglmisc.h \
	eglmode.h \
	eglmutex.h \
	eglscreen.h \
	eglstring.h \
	eglsurface.h \
	eglsync.h

DRI2_SOURCES= \
	egl_dri2.c \
	common.c \
	platform_x11.c

GLX_SOURCES= \
	egl_glx.c

CFLAGS+= -std=c99

CPPFLAGS+= \
	-I${MESA_INCLUDE} \
	-I${EGL}/main \
	-I${X11BASE}/include \
	-I/usr/include/dev/pci/drm \
	-DHAVE_PTHREAD \
	-DHAVE_X11_PLATFORM \
	-D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11 \
	-D_EGL_BUILT_IN_DRIVER_GLX \
	-D_EGL_OS_UNIX=1 \
	-DHAVE_SHARED_GLAPI \
	-D_EGL_DRIVER_SEARCH_DIR=\"${EGL_DRIVER_SEARCH_DIR}\" \
	-DDEFAULT_DRIVER_DIR=\"${DRI_DRIVER_INSTALL_DIR}\"

SRCS= \
	${EGL_SOURCES} \
	${GLX_SOURCES}

.if ${XENOCARA_BUILD_DRI:L} == "yes"
SRCS+=	${DRI2_SOURCES}
CPPFLAGS+=	-D_EGL_BUILT_IN_DRIVER_DRI2 -DHAVE_XCB_DRI2
LDADD=	-L${X11BASE}/lib -lX11-xcb -lX11 -lxcb-dri2 -lxcb-xfixes -lxcb-render \
	-lxcb-shape -lxcb -lpthread -ldrm
.else
LDADD=	-L${X11BASE}/lib -lX11-xcb -lX11 -lxcb-xfixes -lxcb-render \
	-lxcb-shape -lxcb -lpthread
.endif

includes: _SUBDIRUSE
	cd ${MESA_INCLUDE}/EGL; for i in ${INCS}; do \
	    j="cmp -s $$i ${DESTDIR}${INCSDIR}/EGL/$$i || \
		${INSTALL_DATA}	$$i ${DESTDIR}${INCSDIR}/EGL"; \
		echo "\tinstalling $$i"; \
		eval "$$j"; \
	done
	cd ${MESA_INCLUDE}/KHR; for i in ${KHRINCS}; do \
	    j="cmp -s $$i ${DESTDIR}${INCSDIR}/KHR/$$i || \
		${INSTALL_DATA}	$$i ${DESTDIR}${INCSDIR}/KHR"; \
		echo "\tinstalling $$i"; \
		eval "$$j"; \
	done

NOPROFILE=

obj: _xenocara_obj

.include <bsd.lib.mk>
.include <bsd.xorg.mk>

egl.pc: ${EGL}/main/egl.pc.in Makefile
	sed -e 's,@prefix@,$(X11BASE),' \
	    -e 's,@libdir@,${LIBDIR},' \
	    -e 's,@includedir@,${INCSDIR},' \
	    -e 's,@GL_PC_REQ_PRIV@,libdrm >= 2.4.24 x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8 xxf86vm,' \
	    -e 's,@GL_PC_LIB_PRIV@,-m -lpthread,' \
	    -e 's,@GL_PC_CFLAGS@,,' \
	    -e 's,@GL_LIB@,GL,' \
	    -e 's,@PACKAGE_VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
	    -e 's,@GLX_TLS@,no,' \
	< ${EGL}/main/egl.pc.in > egl.pc

afterinstall: egl.pc
	$(INSTALL) -c -m 644 -o root -g wheel egl.pc \
		${DESTDIR}${LIBDIR}/pkgconfig

CLEANFILES+= egl.pc

.PATH: ${EGL}
.PATH: ${EGL}/main
.PATH: ${EGL}/drivers/dri2
.PATH: ${EGL}/drivers/glx