summaryrefslogtreecommitdiff
path: root/graphics/Mesa/version.mk
blob: e65b21fb8e2b90c3ef3e3abbb466f2a8dc368e56 (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
# $NetBSD: version.mk,v 1.9 2004/04/11 19:26:01 jschauma Exp $
#
# This file computes the version number of the Mesa distributed with
# XFree86 and stores it in ${_MESA_VERSION}.
#
# NOTE: This file should only be used by the Mesa-related builtin.mk files.
#
.if !defined(MESA_VERSION_MK)
MESA_VERSION_MK=	# defined

.include "../../mk/bsd.prefs.mk"

_GL_GL_H=		${X11BASE}/include/GL/gl.h
_MESA_GL_VERSIONS=	1.2 1.3 1.4 1.5
.for _glvers_ in ${_MESA_GL_VERSIONS}
.  if !defined(_MESA_GL_VERSION_${_glvers_})
_MESA_GL_VERSION_${_glvers_}?=	no
.    if exists(${_GL_GL_H})
_MESA_GL_VERSION_${_glvers_}!= \
	if ${EGREP} "\#define[ 	]*GL_VERSION_${_glvers_:S/./_/}[ 	]*1" ${_GL_GL_H} >/dev/null 2>&1; then \
		${ECHO} "yes";						\
	else								\
		${ECHO} "no";						\
	fi
.    endif
MAKEFLAGS+=	_MESA_GL_VERSION_${_glvers_}=${_MESA_GL_VERSION_${_glvers_}}
.  endif
.endfor
#
# According to the Mesa documentation, for stable releases:
#
#	Mesa-6.0 implements OpenGL 1.5,
#	Mesa-5.0 implements OpenGL 1.4,
#	Mesa-4.0.4 implements OpenGL 1.3,
#	Mesa-3.4.2 implements OpenGL 1.2.
#
.if !empty(_MESA_GL_VERSION_1.5:M[yY][eE][sS])
_MESA_VERSION?=		6.0
.elif !empty(_MESA_GL_VERSION_1.4:M[yY][eE][sS])
_MESA_VERSION?=		5.0
.elif !empty(_MESA_GL_VERSION_1.3:M[yY][eE][sS])
_MESA_VERSION?=		4.0.4
.elif !empty(_MESA_GL_VERSION_1.2:M[yY][eE][sS])
_MESA_VERSION?=		3.4.2
.else
_MESA_VERSION?=		0
.endif

MESA_REQD?=		3.4.2

# Distill the MESA_REQD list into a single _MESA_REQD value that is the
# highest version of Mesa required.
#
_MESA_STRICTEST_REQD?=	none
.  for _version_ in ${MESA_REQD}
.    for _pkg_ in Mesa-${_version_}
.      if ${_MESA_STRICTEST_REQD} == "none"
_MESA_PKG_SATISFIES_DEP=	yes
.        for _vers_ in ${MESA_REQD}
.          if !empty(_MESA_PKG_SATISFIES_DEP:M[yY][eE][sS])
_MESA_PKG_SATISFIES_DEP!=	\
	if ${PKG_ADMIN} pmatch 'Mesa>=${_vers_}' ${_pkg_}; then	\
		${ECHO} "yes";						\
	else								\
		${ECHO} "no";						\
	fi
.          endif
.        endfor
.        if !empty(_MESA_PKG_SATISFIES_DEP:M[yY][eE][sS])
_MESA_STRICTEST_REQD=	${_version_}
.        endif
.      endif
.    endfor
.  endfor
_MESA_REQD=	${_MESA_STRICTEST_REQD}

.endif	# MESA_VERSION_MK