2004-02-10 23:42:56 +01:00
|
|
|
# $NetBSD: buildlink3.mk,v 1.20 2004/02/10 22:42:56 jlam Exp $
|
2003-09-02 09:12:16 +02:00
|
|
|
|
|
|
|
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
|
2003-09-30 12:18:57 +02:00
|
|
|
MESALIB_BUILDLINK3_MK:= ${MESALIB_BUILDLINK3_MK}+
|
2003-09-02 09:12:16 +02:00
|
|
|
|
2004-01-05 10:31:31 +01:00
|
|
|
.include "../../mk/bsd.prefs.mk"
|
2003-09-02 09:12:16 +02:00
|
|
|
|
2004-01-05 10:31:31 +01:00
|
|
|
.if !empty(MESALIB_BUILDLINK3_MK:M+)
|
2004-02-10 23:23:40 +01:00
|
|
|
_MESA_REQD?= 3.4.2
|
2003-09-02 09:12:16 +02:00
|
|
|
|
2004-01-05 10:31:31 +01:00
|
|
|
BUILDLINK_PACKAGES+= MesaLib
|
2004-02-10 23:23:40 +01:00
|
|
|
BUILDLINK_DEPENDS.MesaLib+= MesaLib>=${_MESA_REQD}
|
2003-09-02 09:12:16 +02:00
|
|
|
BUILDLINK_PKGSRCDIR.MesaLib?= ../../graphics/MesaLib
|
2003-09-30 02:42:32 +02:00
|
|
|
.endif # MESALIB_BUILDLINK3_MK
|
2003-09-02 09:12:16 +02:00
|
|
|
|
|
|
|
BUILDLINK_CHECK_BUILTIN.MesaLib?= NO
|
|
|
|
|
|
|
|
_GL_GLX_H= ${X11BASE}/include/GL/glx.h
|
|
|
|
_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
|
|
|
|
|
|
|
|
.if !defined(BUILDLINK_IS_BUILTIN.MesaLib)
|
|
|
|
BUILDLINK_IS_BUILTIN.MesaLib= NO
|
|
|
|
. if exists(${_GL_GLX_H}) && exists(${_X11_TMPL})
|
|
|
|
BUILDLINK_IS_BUILTIN.MesaLib!= \
|
|
|
|
if ${GREP} -q BuildGLXLibrary ${_X11_TMPL}; then \
|
2004-01-05 10:31:31 +01:00
|
|
|
${ECHO} "YES"; \
|
2003-09-02 09:12:16 +02:00
|
|
|
else \
|
2004-01-05 10:31:31 +01:00
|
|
|
${ECHO} "NO"; \
|
2003-09-02 09:12:16 +02:00
|
|
|
fi
|
|
|
|
. endif
|
2004-02-06 20:04:24 +01:00
|
|
|
MAKEFLAGS+= BUILDLINK_IS_BUILTIN.MesaLib=${BUILDLINK_IS_BUILTIN.MesaLib}
|
2003-09-02 09:12:16 +02:00
|
|
|
.endif
|
|
|
|
|
2004-02-05 08:17:14 +01:00
|
|
|
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
|
|
|
|
!empty(PREFER_PKGSRC:MMesaLib)
|
2004-02-05 07:58:02 +01:00
|
|
|
BUILDLINK_USE_BUILTIN.MesaLib= NO
|
|
|
|
.endif
|
|
|
|
|
2003-09-30 02:42:32 +02:00
|
|
|
.if !empty(BUILDLINK_CHECK_BUILTIN.MesaLib:M[yY][eE][sS])
|
2004-01-05 10:31:31 +01:00
|
|
|
BUILDLINK_USE_BUILTIN.MesaLib= YES
|
2003-09-30 02:42:32 +02:00
|
|
|
.endif
|
|
|
|
|
2004-01-05 10:31:31 +01:00
|
|
|
.if !defined(BUILDLINK_USE_BUILTIN.MesaLib)
|
2003-09-02 09:12:16 +02:00
|
|
|
. if !empty(BUILDLINK_IS_BUILTIN.MesaLib:M[nN][oO])
|
2004-01-05 10:31:31 +01:00
|
|
|
BUILDLINK_USE_BUILTIN.MesaLib= NO
|
2003-09-02 09:12:16 +02:00
|
|
|
. else
|
|
|
|
#
|
2003-09-07 21:36:26 +02:00
|
|
|
# Create an appropriate package name for the built-in Mesa/GLX distributed
|
2003-09-02 09:12:16 +02:00
|
|
|
# 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.
|
|
|
|
#
|
2003-09-30 02:42:32 +02:00
|
|
|
. include "../../graphics/Mesa/version.mk"
|
2003-09-02 09:12:16 +02:00
|
|
|
_MESALIB_PKG= MesaLib-${_MESA_VERSION}
|
2004-01-24 04:12:31 +01:00
|
|
|
BUILDLINK_USE_BUILTIN.MesaLib?= YES
|
|
|
|
. for _depend_ in ${BUILDLINK_DEPENDS.MesaLib}
|
|
|
|
. if !empty(BUILDLINK_USE_BUILTIN.MesaLib:M[yY][eE][sS])
|
2004-01-05 10:31:31 +01:00
|
|
|
BUILDLINK_USE_BUILTIN.MesaLib!= \
|
2004-01-24 04:12:31 +01:00
|
|
|
if ${PKG_ADMIN} pmatch '${_depend_}' ${_MESALIB_PKG}; then \
|
2003-09-02 09:12:16 +02:00
|
|
|
${ECHO} "YES"; \
|
2004-01-05 10:31:31 +01:00
|
|
|
else \
|
|
|
|
${ECHO} "NO"; \
|
2003-09-02 09:12:16 +02:00
|
|
|
fi
|
2004-01-24 04:12:31 +01:00
|
|
|
. endif
|
|
|
|
. endfor
|
2003-09-02 09:12:16 +02:00
|
|
|
. endif
|
2004-01-05 10:31:31 +01:00
|
|
|
MAKEFLAGS+= \
|
2004-02-06 20:04:24 +01:00
|
|
|
BUILDLINK_USE_BUILTIN.MesaLib=${BUILDLINK_USE_BUILTIN.MesaLib}
|
2004-01-05 10:31:31 +01:00
|
|
|
.endif # BUILDLINK_USE_BUILTIN.MesaLib
|
2003-09-28 14:54:52 +02:00
|
|
|
|
2004-01-05 10:31:31 +01:00
|
|
|
.if !empty(BUILDLINK_USE_BUILTIN.MesaLib:M[nN][oO])
|
2003-09-02 09:12:16 +02:00
|
|
|
#
|
|
|
|
# If we depend on the package, depend on the latest version with a library
|
|
|
|
# major number bump.
|
|
|
|
#
|
2004-02-10 23:22:05 +01:00
|
|
|
BUILDLINK_DEPENDS.MesaLib+= MesaLib>=6.0
|
2004-01-05 00:34:04 +01:00
|
|
|
. if !empty(BUILDLINK_DEPTH:M+)
|
2003-09-02 09:12:16 +02:00
|
|
|
BUILDLINK_DEPENDS+= MesaLib
|
|
|
|
. endif
|
2003-09-30 02:42:32 +02:00
|
|
|
.endif
|
|
|
|
|
2004-01-05 00:34:04 +01:00
|
|
|
.if !empty(MESALIB_BUILDLINK3_MK:M+)
|
2004-01-05 10:31:31 +01:00
|
|
|
. if !empty(BUILDLINK_USE_BUILTIN.MesaLib:M[yY][eE][sS])
|
2003-09-14 03:47:51 +02:00
|
|
|
BUILDLINK_PREFIX.MesaLib= ${X11BASE}
|
2004-01-24 02:53:00 +01:00
|
|
|
USE_X11= yes
|
2004-02-10 23:42:56 +01:00
|
|
|
_MESA_REQD= ${_MESA_VERSION}
|
2004-01-05 10:31:31 +01:00
|
|
|
. else
|
|
|
|
BUILDLINK_CPPFLAGS.MesaLib= -DGLX_GLXEXT_LEGACY
|
2003-09-30 02:42:32 +02:00
|
|
|
. endif
|
|
|
|
.endif # MESALIB_BUILDLINK3_MK
|
2003-09-02 09:12:16 +02:00
|
|
|
|
2004-01-05 12:05:44 +01:00
|
|
|
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
|