version 1.1, 2004/03/10 17:57:14 |
version 1.23, 2019/08/30 19:06:34 |
|
|
# $NetBSD$ |
# $NetBSD$ |
|
|
_GL_GLX_H= ${X11BASE}/include/GL/glx.h |
BUILTIN_PKG:= MesaLib |
_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 gcc-${_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 'gcc>=${_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} |
|
|
|
|
BUILTIN_FIND_FILES_VAR:= H_MESALIB PC_GL |
|
BUILTIN_FIND_FILES.H_MESALIB= ${X11BASE}/include/GL/glx.h |
|
BUILTIN_FIND_FILES.PC_GL= ${X11BASE}/lib/pkgconfig/gl.pc |
|
BUILTIN_FIND_FILES.PC_GL+= ${X11BASE}/lib${LIBABISUFFIX}/pkgconfig/gl.pc |
|
|
|
.include "../../mk/buildlink3/bsd.builtin.mk" |
|
|
|
### |
|
### Determine if there is a built-in implementation of the package and |
|
### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). |
|
### |
.if !defined(IS_BUILTIN.MesaLib) |
.if !defined(IS_BUILTIN.MesaLib) |
|
. if empty(PC_GL:M__nonexistent__) |
|
IS_BUILTIN.MesaLib= yes |
|
. elif empty(H_MESALIB:M__nonexistent__) |
|
IS_BUILTIN.MesaLib= yes |
|
. else |
IS_BUILTIN.MesaLib= no |
IS_BUILTIN.MesaLib= no |
. if exists(${_GL_GLX_H}) && exists(${_X11_TMPL}) |
|
IS_BUILTIN.MesaLib!= \ |
|
if ${GREP} -q BuildGLXLibrary ${_X11_TMPL}; then \ |
|
${ECHO} "yes"; \ |
|
else \ |
|
${ECHO} "no"; \ |
|
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. |
|
# |
|
. include "../../graphics/Mesa/version.mk" |
|
BUILTIN_PKG.MesaLib= MesaLib-${_MESA_VERSION} |
|
MAKEFLAGS+= BUILTIN_PKG.MesaLib=${BUILTIN_PKG.MesaLib} |
|
. endif |
|
. endif |
. endif |
MAKEFLAGS+= IS_BUILTIN.MesaLib=${IS_BUILTIN.MesaLib} |
|
.endif |
.endif |
|
|
CHECK_BUILTIN.MesaLib?= no |
MAKEVARS+= IS_BUILTIN.MesaLib |
.if !empty(CHECK_BUILTIN.MesaLib:M[yY][eE][sS]) |
|
USE_BUILTIN.MesaLib= yes |
### |
|
### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to |
|
### a package name to represent the built-in package. |
|
### |
|
.if !defined(BUILTIN_PKG.MesaLib) && \ |
|
!empty(IS_BUILTIN.MesaLib:M[yY][eE][sS]) |
|
. if empty(PC_GL:M__nonexistent__) |
|
BUILTIN_VERSION.Mesa!= ${SED} -n -e 's/Version: //p' ${PC_GL} |
|
. elif empty(H_MESALIB:M__nonexistent__) |
|
. include "version.mk" |
|
. else # ? |
|
BUILTIN_VERSION.Mesa:= 0.something-weird-happened |
|
. endif |
|
BUILTIN_PKG.MesaLib= MesaLib-${BUILTIN_VERSION.Mesa} |
|
MAKEVARS+= BUILTIN_VERSION.Mesa |
.endif |
.endif |
|
MAKEVARS+= BUILTIN_PKG.MesaLib |
|
|
|
### |
|
### Determine whether we should use the built-in implementation if it |
|
### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no"). |
|
### |
.if !defined(USE_BUILTIN.MesaLib) |
.if !defined(USE_BUILTIN.MesaLib) |
USE_BUILTIN.MesaLib?= ${IS_BUILTIN.MesaLib} |
. if ${PREFER.MesaLib} == "pkgsrc" |
|
USE_BUILTIN.MesaLib= no |
. if defined(BUILTIN_PKG.MesaLib) |
. else |
|
USE_BUILTIN.MesaLib= ${IS_BUILTIN.MesaLib} |
|
. if defined(BUILTIN_PKG.MesaLib) && \ |
|
!empty(IS_BUILTIN.MesaLib:M[yY][eE][sS]) |
USE_BUILTIN.MesaLib= yes |
USE_BUILTIN.MesaLib= yes |
. for _depend_ in ${BUILDLINK_DEPENDS.MesaLib} |
. for dep in ${BUILDLINK_API_DEPENDS.MesaLib} |
. if !empty(USE_BUILTIN.MesaLib:M[yY][eE][sS]) |
. if !empty(USE_BUILTIN.MesaLib:M[yY][eE][sS]) |
USE_BUILTIN.MesaLib!= \ |
USE_BUILTIN.MesaLib!= \ |
if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.MesaLib}; then \ |
if ${PKG_ADMIN} pmatch ${dep:Q} ${BUILTIN_PKG.MesaLib}; then \ |
${ECHO} "yes"; \ |
${ECHO} yes; \ |
else \ |
else \ |
${ECHO} "no"; \ |
${ECHO} no; \ |
fi |
fi |
. endif |
. endif |
. endfor |
. endfor |
|
. endif |
|
. endif # PREFER.MesaLib |
|
.endif |
|
|
|
MAKEVARS+= USE_BUILTIN.MesaLib |
|
|
|
### |
|
### The section below only applies if we are not including this file |
|
### solely to determine whether a built-in implementation exists. |
|
### |
|
CHECK_BUILTIN.MesaLib?= no |
|
.if !empty(CHECK_BUILTIN.MesaLib:M[nN][oO]) |
|
|
|
. if !empty(USE_BUILTIN.MesaLib:M[nN][oO]) |
|
. include "../../mk/pthread.buildlink3.mk" |
|
. include "../../mk/pthread.builtin.mk" |
|
BUILTIN_PKG:= MesaLib |
. endif |
. endif |
.endif # USE_BUILTIN.MesaLib |
|
|
|
.if !empty(USE_BUILTIN.MesaLib:M[nN][oO]) |
. include "../../mk/x11.builtin.mk" |
BUILDLINK_DEPENDS.MesaLib+= MesaLib>=6.0 |
|
.endif |
|
|
|
.if !empty(USE_BUILTIN.MesaLib:M[yY][eE][sS]) |
.endif # CHECK_BUILTIN.MesaLib |
BUILDLINK_PREFIX.MesaLib= ${X11BASE} |
|
USE_X11= yes |
|
_MESA_REQD= ${_MESA_VERSION} |
|
.endif |
|