summaryrefslogtreecommitdiff
path: root/graphics/glu
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-03-10 17:57:14 +0000
committerjlam <jlam@pkgsrc.org>2004-03-10 17:57:14 +0000
commitd68193d4743931877544a7e52ed44171707b858d (patch)
tree1226d07b8f66083168895189decc88848b70903f /graphics/glu
parent55bd3391bd2b274e284613fb1e70cd0190dd4ed8 (diff)
downloadpkgsrc-d68193d4743931877544a7e52ed44171707b858d.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/glu')
-rw-r--r--graphics/glu/buildlink3.mk98
-rw-r--r--graphics/glu/builtin.mk61
2 files changed, 69 insertions, 90 deletions
diff --git a/graphics/glu/buildlink3.mk b/graphics/glu/buildlink3.mk
index 90739f0c13a..68c38bb242d 100644
--- a/graphics/glu/buildlink3.mk
+++ b/graphics/glu/buildlink3.mk
@@ -1,103 +1,21 @@
-# $NetBSD: buildlink3.mk,v 1.22 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.23 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
GLU_BUILDLINK3_MK:= ${GLU_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= glu
+.endif
-.if !empty(GLU_BUILDLINK3_MK:M+)
-. include "../../graphics/MesaLib/buildlink3.mk"
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nglu}
+BUILDLINK_PACKAGES+= glu
-BUILDLINK_PACKAGES+= glu
+.if !empty(GLU_BUILDLINK3_MK:M+)
BUILDLINK_DEPENDS.glu+= glu>=${_MESA_REQD}
BUILDLINK_PKGSRCDIR.glu?= ../../graphics/glu
-.endif # GLU_BUILDLINK3_MK
-BUILDLINK_CHECK_BUILTIN.glu?= NO
+.include "../../graphics/MesaLib/buildlink3.mk"
-_GL_GLU_H= ${X11BASE}/include/GL/glu.h
-_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
-
-.if !defined(BUILDLINK_IS_BUILTIN.glu)
-BUILDLINK_IS_BUILTIN.glu= NO
-. if exists(${_GL_GLU_H}) && exists(${_X11_TMPL})
-_IS_BUILTIN.glu!= \
- if ${GREP} -q BuildGLULibrary ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-BUILDLINK_IS_BUILTIN.glu= ${_IS_BUILTIN.glu}
-. if !empty(BUILDLINK_CHECK_BUILTIN.glu:M[nN][oO]) && \
- !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.
-#
-. include "../../graphics/Mesa/version.mk"
-_GLU_PKG= glu-${_MESA_VERSION}
-BUILDLINK_IS_BUILTIN.glu?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.glu}
-. if !empty(BUILDLINK_IS_BUILTIN.glu:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.glu!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_GLU_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.glu=${BUILDLINK_IS_BUILTIN.glu}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.glu:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.glu= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.glu)
-. if !empty(BUILDLINK_IS_BUILTIN.glu:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.glu= YES
-. else
-BUILDLINK_USE_BUILTIN.glu= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.glu:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.glu= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.glu= NO
-. endif
-. if !empty(PREFER_NATIVE:Mglu) && \
- !empty(BUILDLINK_IS_BUILTIN.glu:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.glu= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mglu)
-BUILDLINK_USE_BUILTIN.glu= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.glu:M[nN][oO])
-#
-# If we depend on the package, depend on the latest version with a library
-# major number bump.
-#
-BUILDLINK_DEPENDS.glu+= glu>=6.0
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= glu
-. endif
-.endif
-
-.if !empty(GLU_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.glu:M[yY][eE][sS])
-BUILDLINK_PREFIX.glu= ${X11BASE}
-USE_X11= yes
-_MESA_REQD= ${_MESA_VERSION}
-. endif
.endif # GLU_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/graphics/glu/builtin.mk b/graphics/glu/builtin.mk
new file mode 100644
index 00000000000..160b4c41d95
--- /dev/null
+++ b/graphics/glu/builtin.mk
@@ -0,0 +1,61 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+_GL_GLU_H= ${X11BASE}/include/GL/glu.h
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.glu)
+IS_BUILTIN.glu= no
+. if exists(${_GL_GLU_H}) && exists(${_X11_TMPL})
+IS_BUILTIN.glu!= \
+ if ${GREP} -q BuildGLULibrary ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ 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.
+#
+. include "../../graphics/Mesa/version.mk"
+BUILTIN_PKG.glu= glu-${_MESA_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.glu=${BUILTIN_PKG.glu}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.glu=${IS_BUILTIN.glu}
+.endif
+
+CHECK_BUILTIN.glu?= no
+.if !empty(CHECK_BUILTIN.glu:M[yY][eE][sS])
+USE_BUILTIN.glu= yes
+.endif
+
+.if !defined(USE_BUILTIN.glu)
+USE_BUILTIN.glu?= ${IS_BUILTIN.glu}
+
+. if defined(BUILTIN_PKG.glu)
+USE_BUILTIN.glu= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.glu}
+. if !empty(USE_BUILTIN.glu:M[yY][eE][sS])
+USE_BUILTIN.glu!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.glu}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.glu
+
+.if !empty(USE_BUILTIN.glu:M[nN][oO])
+BUILDLINK_DEPENDS.glu+= glu>=6.0
+.endif
+
+.if !empty(USE_BUILTIN.glu:M[yY][eE][sS])
+BUILDLINK_PREFIX.glu= ${X11BASE}
+USE_X11= yes
+_MESA_REQD= ${_MESA_VERSION}
+.endif