Move the definitions of MESA_REQD and _MESA_REQD to Mesa/version.mk and

modify {MesaLib,glu}/{buildlink3,builtin}.mk accordingly.  Also add the
dependency on {MesaLib,glu}>=${_MESA_REQD} to the builtin.mk files so
that we correctly check the built-in Mesa version against the dependency
requirements.
This commit is contained in:
jlam 2004-03-15 17:38:10 +00:00
parent b2796b86d2
commit f63d66e56a
5 changed files with 57 additions and 56 deletions

View file

@ -1,10 +1,9 @@
# $NetBSD: version.mk,v 1.7 2004/01/23 19:37:18 jlam Exp $
# $NetBSD: version.mk,v 1.8 2004/03/15 17:38:10 jlam 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 buildlink*.mk
# files.
# NOTE: This file should only be used by the Mesa-related builtin.mk files.
#
.if !defined(MESA_VERSION_MK)
MESA_VERSION_MK= # defined
@ -14,15 +13,17 @@ MESA_VERSION_MK= # defined
_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 !exists(${_GL_GL_H})
_MESA_GL_VERSION_${_glvers_}= NO
. else
. if !defined(_MESA_GL_VERSION_${_glvers_})
_MESA_GL_VERSION_${_glvers_}?= no
. if exists(${_GL_GL_H})
_MESA_GL_VERSION_${_glvers_}!= \
if ${EGREP} -q "\#define[ ]*GL_VERSION_${_glvers_:S/./_/}[ ]*1" ${_GL_GL_H}; then \
${ECHO} YES; \
${ECHO} "yes"; \
else \
${ECHO} NO; \
${ECHO} "no"; \
fi
. endif
MAKEFLAGS+= _MESA_GL_VERSION_${_glvers_}=${_MESA_GL_VERSION_${_glvers_}}
. endif
.endfor
#
@ -33,16 +34,44 @@ _MESA_GL_VERSION_${_glvers_}!= \
# Mesa-4.0.4 implements OpenGL 1.3,
# Mesa-3.4.2 implements OpenGL 1.2.
#
.if ${_MESA_GL_VERSION_1.5} == "YES"
.if !empty(_MESA_GL_VERSION_1.5:M[yY][eE][sS])
_MESA_VERSION?= 6.0
.elif ${_MESA_GL_VERSION_1.4} == "YES"
.elif !empty(_MESA_GL_VERSION_1.4:M[yY][eE][sS])
_MESA_VERSION?= 5.0
.elif ${_MESA_GL_VERSION_1.3} == "YES"
.elif !empty(_MESA_GL_VERSION_1.3:M[yY][eE][sS])
_MESA_VERSION?= 4.0.4
.elif ${_MESA_GL_VERSION_1.2} == "YES"
.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

View file

@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.26 2004/03/10 17:57:14 jlam Exp $
# $NetBSD: buildlink3.mk,v 1.27 2004/03/15 17:38:10 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
MESALIB_BUILDLINK3_MK:= ${MESALIB_BUILDLINK3_MK}+
@ -11,9 +11,7 @@ BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:NMesaLib}
BUILDLINK_PACKAGES+= MesaLib
.if !empty(MESALIB_BUILDLINK3_MK:M+)
MESA_REQD+= 3.4.2
BUILDLINK_DEPENDS.MesaLib+= MesaLib>=${_MESA_REQD}
BUILDLINK_DEPENDS.MesaLib+= MesaLib>=3.4.2
BUILDLINK_PKGSRCDIR.MesaLib?= ../../graphics/MesaLib
.if !defined(BUILDING_MESA)

View file

@ -1,33 +1,10 @@
# $NetBSD: builtin.mk,v 1.2 2004/03/15 16:48:18 jlam Exp $
# $NetBSD: builtin.mk,v 1.3 2004/03/15 17:38:10 jlam Exp $
_GL_GLX_H= ${X11BASE}/include/GL/glx.h
_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
# 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 MesaLib-${_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 'MesaLib>=${_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}
.include "../../graphics/Mesa/version.mk"
BUILDLINK_DEPENDS.MesaLib+= MesaLib>=${_MESA_REQD}
.if !defined(IS_BUILTIN.MesaLib)
IS_BUILTIN.MesaLib= no
@ -40,12 +17,9 @@ IS_BUILTIN.MesaLib!= \
fi
. if !empty(IS_BUILTIN.MesaLib:M[yY][eE][sS])
#
# Create an appropriate package name for the built-in Mesa/GLX distributed
# with the system. This package name can be used to check against
# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
# or if the built-in one is sufficient.
# _MESA_VERSION is defined by Mesa/version.mk to be the version of the
# Mesa software distributed with the built-in XFree86.
#
. include "../../graphics/Mesa/version.mk"
BUILTIN_PKG.MesaLib= MesaLib-${_MESA_VERSION}
MAKEFLAGS+= BUILTIN_PKG.MesaLib=${BUILTIN_PKG.MesaLib}
. endif
@ -62,7 +36,7 @@ USE_BUILTIN.MesaLib= yes
USE_BUILTIN.MesaLib?= ${IS_BUILTIN.MesaLib}
. if defined(BUILTIN_PKG.MesaLib)
USE_BUILTIN.MesaLib= yes
USE_BUILTIN.MesaLib= yes
. for _depend_ in ${BUILDLINK_DEPENDS.MesaLib}
. if !empty(USE_BUILTIN.MesaLib:M[yY][eE][sS])
USE_BUILTIN.MesaLib!= \

View file

@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.23 2004/03/10 17:57:14 jlam Exp $
# $NetBSD: buildlink3.mk,v 1.24 2004/03/15 17:38:10 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
GLU_BUILDLINK3_MK:= ${GLU_BUILDLINK3_MK}+
@ -11,7 +11,7 @@ BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nglu}
BUILDLINK_PACKAGES+= glu
.if !empty(GLU_BUILDLINK3_MK:M+)
BUILDLINK_DEPENDS.glu+= glu>=${_MESA_REQD}
BUILDLINK_DEPENDS.glu+= glu>=3.4.2
BUILDLINK_PKGSRCDIR.glu?= ../../graphics/glu
.include "../../graphics/MesaLib/buildlink3.mk"

View file

@ -1,8 +1,11 @@
# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
# $NetBSD: builtin.mk,v 1.2 2004/03/15 17:38:10 jlam Exp $
_GL_GLU_H= ${X11BASE}/include/GL/glu.h
_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
.include "../../graphics/Mesa/version.mk"
BUILDLINK_DEPENDS.glu+= glu>=${_MESA_REQD}
.if !defined(IS_BUILTIN.glu)
IS_BUILTIN.glu= no
. if exists(${_GL_GLU_H}) && exists(${_X11_TMPL})
@ -14,12 +17,9 @@ IS_BUILTIN.glu!= \
fi
. if !empty(IS_BUILTIN.glu:M[yY][eE][sS])
#
# Create an appropriate package name for the built-in Mesa/GLU distributed
# with the system. This package name can be used to check against
# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
# or if the built-in one is sufficient.
# _MESA_VERSION is defined by Mesa/version.mk to be the version of the
# Mesa software distributed with the built-in XFree86.
#
. include "../../graphics/Mesa/version.mk"
BUILTIN_PKG.glu= glu-${_MESA_VERSION}
MAKEFLAGS+= BUILTIN_PKG.glu=${BUILTIN_PKG.glu}
. endif