summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/MesaLib/buildlink3.mk126
-rw-r--r--graphics/MesaLib/builtin.mk87
-rw-r--r--graphics/freetype2/buildlink3.mk105
-rw-r--r--graphics/freetype2/builtin.mk66
-rw-r--r--graphics/glu/buildlink3.mk98
-rw-r--r--graphics/glu/builtin.mk61
-rw-r--r--graphics/xpm/buildlink3.mk92
-rw-r--r--graphics/xpm/builtin.mk72
8 files changed, 321 insertions, 386 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
diff --git a/graphics/freetype2/buildlink3.mk b/graphics/freetype2/buildlink3.mk
index 87a506b7c7a..9c2a3435a74 100644
--- a/graphics/freetype2/buildlink3.mk
+++ b/graphics/freetype2/buildlink3.mk
@@ -1,110 +1,23 @@
-# $NetBSD: buildlink3.mk,v 1.20 2004/02/29 00:22:43 recht Exp $
+# $NetBSD: buildlink3.mk,v 1.21 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
FREETYPE2_BUILDLINK3_MK:= ${FREETYPE2_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
-
-.if !empty(FREETYPE2_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= freetype2
-BUILDLINK_DEPENDS.freetype2+= freetype2>=2.1.3
-BUILDLINK_PKGSRCDIR.freetype2?= ../../graphics/freetype2
-BUILDLINK_INCDIRS.freetype2?= include/freetype2
-.endif # FREETYPE2_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.freetype2?= NO
-
-_FREETYPE2_FREETYPE_H= ${X11BASE}/include/freetype2/freetype/freetype.h
-_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
-
-.if !defined(BUILDLINK_IS_BUILTIN.freetype2)
-BUILDLINK_IS_BUILTIN.freetype2= NO
-. if exists(${_FREETYPE2_FREETYPE_H}) && exists(${_X11_TMPL})
-_IS_BUILTIN.freetype2!= \
- if ${GREP} -q BuildFreetype2Library ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-BUILDLINK_IS_BUILTIN.freetype2= ${_IS_BUILTIN.freetype2}
-. if !empty(BUILDLINK_CHECK_BUILTIN.freetype2:M[nN][oO]) && \
- !empty(_IS_BUILTIN.freetype2:M[yY][eE][sS])
-#
-# Create an appropriate package name for the built-in freetype2 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.
-#
-_FREETYPE2_MAJOR!= \
- ${AWK} '/\#define[ ]*FREETYPE_MAJOR/ { print $$3 }' ${_FREETYPE2_FREETYPE_H}
-_FREETYPE2_MINOR!= \
- ${AWK} '/\#define[ ]*FREETYPE_MINOR/ { print "."$$3 }' ${_FREETYPE2_FREETYPE_H}
-_FREETYPE2_PATCH!= \
- ${AWK} 'BEGIN { patch=0; } /\#define[ ]*FREETYPE_PATCH/ { patch=$$3; } END { print "."patch; }' ${_FREETYPE2_FREETYPE_H}
-_FREETYPE2_VERSION= ${_FREETYPE2_MAJOR}${_FREETYPE2_MINOR}${_FREETYPE2_PATCH}
-_FREETYPE2_PKG= freetype2-${_FREETYPE2_VERSION}
-BUILDLINK_IS_BUILTIN.freetype2?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.freetype2}
-. if !empty(BUILDLINK_IS_BUILTIN.freetype2:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.freetype2!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_FREETYPE2_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.freetype2=${BUILDLINK_IS_BUILTIN.freetype2}
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= freetype2
.endif
-.if !empty(BUILDLINK_CHECK_BUILTIN.freetype2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.freetype2= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.freetype2)
-. if !empty(BUILDLINK_IS_BUILTIN.freetype2:M[yY][eE][sS]I)
-BUILDLINK_USE_BUILTIN.freetype2= YES
-. else
-BUILDLINK_USE_BUILTIN.freetype2= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.freetype2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.freetype2= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.freetype2= NO
-. endif
-. if !empty(PREFER_NATIVE:Mfreetype2) && \
- !empty(BUILDLINK_IS_BUILTIN.freetype2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.freetype2= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mfreetype2)
-BUILDLINK_USE_BUILTIN.freetype2= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.freetype2:M[nN][oO])
-#
-# If we depend on the package, depend on the latest version with a library
-# major number bump.
-#
-BUILDLINK_DEPENDS.freetype2+= freetype2>=2.1.3
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= freetype2
-. endif
-.endif
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nfreetype2}
+BUILDLINK_PACKAGES+= freetype2
.if !empty(FREETYPE2_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.freetype2:M[yY][eE][sS])
-BUILDLINK_PREFIX.freetype2= ${X11BASE}
-USE_X11= yes
-. endif
+BUILDLINK_DEPENDS.freetype2+= freetype2>=2.1.0
+BUILDLINK_PKGSRCDIR.freetype2?= ../../graphics/freetype2
+BUILDLINK_INCDIRS.freetype2?= include/freetype2
FREETYPE_CONFIG?= ${BUILDLINK_PREFIX.freetype2}/bin/freetype-config
CONFIGURE_ENV+= FREETYPE_CONFIG="${FREETYPE_CONFIG}"
+
.endif # FREETYPE2_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/graphics/freetype2/builtin.mk b/graphics/freetype2/builtin.mk
new file mode 100644
index 00000000000..10ab50c29ce
--- /dev/null
+++ b/graphics/freetype2/builtin.mk
@@ -0,0 +1,66 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+_FREETYPE2_FREETYPE_H= ${X11BASE}/include/freetype2/freetype/freetype.h
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.freetype2)
+IS_BUILTIN.freetype2= no
+. if exists(${_FREETYPE2_FREETYPE_H}) && exists(${_X11_TMPL})
+IS_BUILTIN.freetype2!= \
+ if ${GREP} -q BuildFreetype2Library ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !empty(IS_BUILTIN.freetype2:M[yY][eE][sS])
+#
+# Create an appropriate package name for the built-in freetype2 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.
+#
+_FREETYPE2_MAJOR!= \
+ ${AWK} '/\#define[ ]*FREETYPE_MAJOR/ { print $$3 }' ${_FREETYPE2_FREETYPE_H}
+_FREETYPE2_MINOR!= \
+ ${AWK} '/\#define[ ]*FREETYPE_MINOR/ { print "."$$3 }' ${_FREETYPE2_FREETYPE_H}
+_FREETYPE2_PATCH!= \
+ ${AWK} 'BEGIN { patch=0; } /\#define[ ]*FREETYPE_PATCH/ { patch=$$3; } END { print "."patch; }' ${_FREETYPE2_FREETYPE_H}
+_FREETYPE2_VERSION= ${_FREETYPE2_MAJOR}${_FREETYPE2_MINOR}${_FREETYPE2_PATCH}
+BUILTIN_PKG.freetype2= freetype2-${_FREETYPE2_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.freetype2=${BUILTIN_PKG.freetype2}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.freetype2=${IS_BUILTIN.freetype2}
+.endif
+
+CHECK_BUILTIN.freetype2?= no
+.if !empty(CHECK_BUILTIN.freetype2:M[yY][eE][sS])
+USE_BUILTIN.freetype2= yes
+.endif
+
+.if !defined(USE_BUILTIN.freetype2)
+USE_BUILTIN.freetype2?= ${IS_BUILTIN.freetype2}
+
+. if defined(BUILTIN_PKG.freetype2)
+USE_BUILTIN.freetype2= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.freetype2}
+. if !empty(USE_BUILTIN.freetype2:M[yY][eE][sS])
+USE_BUILTIN.freetype2!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.freetype2}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.freetype2
+
+.if !empty(USE_BUILTIN.freetype2:M[nN][oO])
+BUILDLINK_DEPENDS.freetype2+= freetype2>=2.1.3
+.endif
+
+.if !empty(USE_BUILTIN.freetype2:M[yY][eE][sS])
+BUILDLINK_PREFIX.freetype2= ${X11BASE}
+USE_X11= yes
+.endif
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
diff --git a/graphics/xpm/buildlink3.mk b/graphics/xpm/buildlink3.mk
index e556f1fcd2c..9d4e6e41549 100644
--- a/graphics/xpm/buildlink3.mk
+++ b/graphics/xpm/buildlink3.mk
@@ -1,95 +1,21 @@
-# $NetBSD: buildlink3.mk,v 1.14 2004/02/06 19:04:25 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.15 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
XPM_BUILDLINK3_MK:= ${XPM_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= xpm
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nxpm}
+BUILDLINK_PACKAGES+= xpm
.if !empty(XPM_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= xpm
BUILDLINK_DEPENDS.xpm+= xpm>=3.4k
BUILDLINK_PKGSRCDIR.xpm?= ../../graphics/xpm
-.endif # XPM_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.xpm?= NO
-
-_X11_XPM_H= ${X11BASE}/include/X11/xpm.h
-_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
-
-.if !defined(BUILDLINK_IS_BUILTIN.xpm)
-BUILDLINK_IS_BUILTIN.xpm= NO
-. if exists(${_X11_XPM_H})
-. if !empty(X11BASE:M*openwin)
-BUILDLINK_IS_BUILTIN.xpm!= \
- if /usr/sbin/pkgchk -l SUNWxwinc | ${GREP} -q xpm.h; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. elif ${OPSYS} == "IRIX"
-BUILDLINK_IS_BUILTIN.xpm= YES
-. elif exists(${_X11_TMPL})
-BUILDLINK_IS_BUILTIN.xpm!= \
- if ${GREP} -q NormalLibXpm ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. else
-BUILDLINK_IS_BUILTIN.xpm= NO
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.xpm=${BUILDLINK_IS_BUILTIN.xpm}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.xpm:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.xpm= YES
-.endif
-.if !defined(BUILDLINK_USE_BUILTIN.xpm)
-. if !empty(BUILDLINK_IS_BUILTIN.xpm:M[nN][oO])
-BUILDLINK_USE_BUILTIN.xpm= NO
-. else
-#
-# Create an appropriate package name for the built-in xpm 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.
-#
-_XPM_MAJOR!= \
- ${AWK} '/\#define[ ]*XpmFormat/ { print $$3 }' ${_X11_XPM_H}
-_XPM_MINOR!= \
- ${AWK} '/\#define[ ]*XpmVersion/ { print "."$$3 }' ${_X11_XPM_H}
-_XPM_PATCH!= \
- ${AWK} 'BEGIN { split("abcdefghijklmnopqrstuvwxyz", alpha, "") } /\#define[ ]*XpmRevision/ { print alpha[$$3] }' ${_X11_XPM_H}
-_XPM_VERSION= ${_XPM_MAJOR}${_XPM_MINOR}${_XPM_PATCH}
-_XPM_PKG= xpm-${_XPM_VERSION}
-BUILDLINK_USE_BUILTIN.xpm?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.xpm}
-. if !empty(BUILDLINK_USE_BUILTIN.xpm:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.xpm!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_XPM_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-MAKEFLAGS+= BUILDLINK_USE_BUILTIN.xpm=${BUILDLINK_USE_BUILTIN.xpm}
-.endif # BUILDLINK_USE_BUILTIN.xpm
+USE_X11= yes
-.if !empty(BUILDLINK_USE_BUILTIN.xpm:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= xpm
-. endif
-.endif
-
-.if !empty(XPM_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.xpm:M[yY][eE][sS])
-BUILDLINK_PREFIX.xpm= ${X11BASE}
-. endif
-USE_X11= yes
.endif # XPM_BUILDLINK3_MK
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/graphics/xpm/builtin.mk b/graphics/xpm/builtin.mk
new file mode 100644
index 00000000000..1a2c59b7166
--- /dev/null
+++ b/graphics/xpm/builtin.mk
@@ -0,0 +1,72 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+.include "../../mk/bsd.prefs.mk"
+
+_X11_XPM_H= ${X11BASE}/include/X11/xpm.h
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.xpm)
+IS_BUILTIN.xpm= no
+. if exists(${_X11_XPM_H})
+. if !empty(X11BASE:M*openwin)
+IS_BUILTIN.xpm!= \
+ if /usr/sbin/pkgchk -l SUNWxwinc | ${GREP} -q xpm.h; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. elif ${OPSYS} == "IRIX"
+IS_BUILTIN.xpm= yes
+. elif exists(${_X11_TMPL})
+IS_BUILTIN.xpm!= \
+ if ${GREP} -q NormalLibXpm ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. else
+IS_BUILTIN.xpm= no
+. endif
+. endif
+. if !empty(IS_BUILTIN.xpm:M[yY][eE][sS])
+#
+# Create an appropriate package name for the built-in xpm 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.
+#
+_XPM_MAJOR!= \
+ ${AWK} '/\#define[ ]*XpmFormat/ { print $$3 }' ${_X11_XPM_H}
+_XPM_MINOR!= \
+ ${AWK} '/\#define[ ]*XpmVersion/ { print "."$$3 }' ${_X11_XPM_H}
+_XPM_PATCH!= \
+ ${AWK} 'BEGIN { split("abcdefghijklmnopqrstuvwxyz", alpha, "") } /\#define[ ]*XpmRevision/ { print alpha[$$3] }' ${_X11_XPM_H}
+_XPM_VERSION= ${_XPM_MAJOR}${_XPM_MINOR}${_XPM_PATCH}
+BUILTIN_PKG.xpm= xpm-${_XPM_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.xpm=${BUILTIN_PKG.xpm}
+. endif
+MAKEFLAGS+= IS_BUILTIN.xpm=${IS_BUILTIN.xpm}
+.endif # USE_BUILTIN.xpm
+
+CHECK_BUILTIN.xpm?= no
+.if !empty(CHECK_BUILTIN.xpm:M[yY][eE][sS])
+USE_BUILTIN.xpm= yes
+.endif
+
+.if !defined(USE_BUILTIN.xpm)
+USE_BUILTIN.xpm?= ${IS_BUILTIN.xpm}
+
+. if defined(BUILTIN_PKG.xpm)
+USE_BUILTIN.xpm= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.xpm}
+. if !empty(USE_BUILTIN.xpm:M[yY][eE][sS])
+USE_BUILTIN.xpm!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.xpm}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.xpm