diff options
Diffstat (limited to 'graphics/Mesa/version.mk')
-rw-r--r-- | graphics/Mesa/version.mk | 75 |
1 files changed, 14 insertions, 61 deletions
diff --git a/graphics/Mesa/version.mk b/graphics/Mesa/version.mk index ee9c85049e2..4ec62dfb63a 100644 --- a/graphics/Mesa/version.mk +++ b/graphics/Mesa/version.mk @@ -1,31 +1,16 @@ -# $NetBSD: version.mk,v 1.10 2005/04/30 02:16:12 jlam Exp $ +# $NetBSD: version.mk,v 1.11 2005/06/01 18:02:54 jlam Exp $ # # This file computes the version number of the Mesa distributed with -# XFree86 and stores it in ${_MESA_VERSION}. +# XFree86 and stores it in ${BUILTIN_VERSION.Mesa}. # # 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" +BUILTIN_FILES_VAR:= H_MESA +BUILTIN_FILES.H_MESA= ${X11BASE}/include/GL/gl.h +.include "../../mk/buildlink3/find-files.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 ${GREP} "\#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 +.if !defined(BUILTIN_VERSION.Mesa) && exists(${H_MESA}) # # According to the Mesa documentation, for stable releases: # @@ -34,44 +19,12 @@ MAKEFLAGS+= _MESA_GL_VERSION_${_glvers_}=${_MESA_GL_VERSION_${_glvers_}} # 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 +BUILTIN_VERSION.Mesa!= \ + ${AWK} '/\#define[ ]*GL_VERSION_1_2/ { v = "3.4.2" } \ + /\#define[ ]*GL_VERSION_1_3/ { v = "4.0.4" } \ + /\#define[ ]*GL_VERSION_1_4/ { v = "5.0" } \ + /\#define[ ]*GL_VERSION_1_5/ { v = "6.0" } \ + END { printf "%s\n", v }' \ + ${H_MESA} .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 +MAKEVARS+= BUILTIN_VERSION.Mesa |