summaryrefslogtreecommitdiff
path: root/graphics/MesaLib
diff options
context:
space:
mode:
authorjlam <jlam>2004-03-10 17:57:14 +0000
committerjlam <jlam>2004-03-10 17:57:14 +0000
commita4a404710484a43484fac5e3044019381d4494a9 (patch)
tree1226d07b8f66083168895189decc88848b70903f /graphics/MesaLib
parentfde46d1aaca113dcdf8fc5effa3c04ddd5cd37a5 (diff)
downloadpkgsrc-a4a404710484a43484fac5e3044019381d4494a9.tar.gz
Split out the code that deals with checking whether the software is
built-in or not into a separate builtin.mk file. The code to deal checking for built-in software is much simpler to deal with in pkgsrc. The buildlink3.mk file for a package will be of the usual format regardless of the package, which makes it simpler for packagers to update a package. The builtin.mk file for a package must define a single yes/no variable USE_BUILTIN.<pkg> that is used by bsd.buildlink3.mk to decide whether to use the built-in software or to use the pkgsrc software.
Diffstat (limited to 'graphics/MesaLib')
-rw-r--r--graphics/MesaLib/buildlink3.mk126
-rw-r--r--graphics/MesaLib/builtin.mk87
2 files changed, 96 insertions, 117 deletions
diff --git a/graphics/MesaLib/buildlink3.mk b/graphics/MesaLib/buildlink3.mk
index d26c3e04bab..a6331c09a49 100644
--- a/graphics/MesaLib/buildlink3.mk
+++ b/graphics/MesaLib/buildlink3.mk
@@ -1,133 +1,25 @@
-# $NetBSD: buildlink3.mk,v 1.25 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.26 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
MESALIB_BUILDLINK3_MK:= ${MESALIB_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= MesaLib
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:NMesaLib}
+BUILDLINK_PACKAGES+= MesaLib
.if !empty(MESALIB_BUILDLINK3_MK:M+)
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 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}
-
-BUILDLINK_PACKAGES+= MesaLib
BUILDLINK_DEPENDS.MesaLib+= MesaLib>=${_MESA_REQD}
BUILDLINK_PKGSRCDIR.MesaLib?= ../../graphics/MesaLib
-.endif # MESALIB_BUILDLINK3_MK
-
-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})
-_IS_BUILTIN.MesaLib!= \
- if ${GREP} -q BuildGLXLibrary ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-BUILDLINK_IS_BUILTIN.MesaLib= ${_IS_BUILTIN.MesaLib}
-. if !empty(BUILDLINK_CHECK_BUILTIN.MesaLib:M[nN][oO]) && \
- !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"
-_MESALIB_PKG= MesaLib-${_MESA_VERSION}
-BUILDLINK_IS_BUILTIN.MesaLib?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.MesaLib}
-. if !empty(BUILDLINK_IS_BUILTIN.MesaLib:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.MesaLib!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_MESALIB_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.MesaLib=${BUILDLINK_IS_BUILTIN.MesaLib}
-.endif
-.if !empty(BUILDLINK_CHECK_BUILTIN.MesaLib:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.MesaLib= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.MesaLib)
-. if !empty(BUILDLINK_IS_BUILTIN.MesaLib:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.MesaLib= YES
-. else
-BUILDLINK_USE_BUILTIN.MesaLib= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.MesaLib:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.MesaLib= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.MesaLib= NO
-. endif
-. if !empty(PREFER_NATIVE:MMesaLib) && \
- !empty(BUILDLINK_IS_BUILTIN.MesaLib:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.MesaLib= YES
-. endif
-. if !empty(PREFER_PKGSRC:MMesaLib)
-BUILDLINK_USE_BUILTIN.MesaLib= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.MesaLib:M[nN][oO])
-#
-# If we depend on the package, depend on the latest version with a library
-# major number bump.
-#
-BUILDLINK_DEPENDS.MesaLib+= MesaLib>=6.0
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= MesaLib
-. endif
+.if !defined(BUILDING_MESA)
+BUILDLINK_CPPFLAGS.MesaLib= -DGLX_GLXEXT_LEGACY
.endif
-.if !empty(MESALIB_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.MesaLib:M[yY][eE][sS])
-BUILDLINK_PREFIX.MesaLib= ${X11BASE}
-USE_X11= yes
-_MESA_REQD= ${_MESA_VERSION}
-. else
-. if !defined(BUILDING_MESA)
-BUILDLINK_CPPFLAGS.MesaLib= -DGLX_GLXEXT_LEGACY
-. endif
-. endif
.endif # MESALIB_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/graphics/MesaLib/builtin.mk b/graphics/MesaLib/builtin.mk
new file mode 100644
index 00000000000..8be4d7ff5e4
--- /dev/null
+++ b/graphics/MesaLib/builtin.mk
@@ -0,0 +1,87 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 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 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}
+
+.if !defined(IS_BUILTIN.MesaLib)
+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
+MAKEFLAGS+= IS_BUILTIN.MesaLib=${IS_BUILTIN.MesaLib}
+.endif
+
+CHECK_BUILTIN.MesaLib?= no
+.if !empty(CHECK_BUILTIN.MesaLib:M[yY][eE][sS])
+USE_BUILTIN.MesaLib= yes
+.endif
+
+.if !defined(USE_BUILTIN.MesaLib)
+USE_BUILTIN.MesaLib?= ${IS_BUILTIN.MesaLib}
+
+. if defined(BUILTIN_PKG.MesaLib)
+USE_BUILTIN.MesaLib= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.MesaLib}
+. if !empty(USE_BUILTIN.MesaLib:M[yY][eE][sS])
+USE_BUILTIN.MesaLib!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.MesaLib}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.MesaLib
+
+.if !empty(USE_BUILTIN.MesaLib:M[nN][oO])
+BUILDLINK_DEPENDS.MesaLib+= MesaLib>=6.0
+.endif
+
+.if !empty(USE_BUILTIN.MesaLib:M[yY][eE][sS])
+BUILDLINK_PREFIX.MesaLib= ${X11BASE}
+USE_X11= yes
+_MESA_REQD= ${_MESA_VERSION}
+.endif