summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fonts/Xft2/builtin-imake.mk12
-rw-r--r--fonts/Xft2/builtin.mk17
-rw-r--r--fonts/fontconfig/builtin-imake.mk12
-rw-r--r--fonts/fontconfig/builtin.mk17
-rw-r--r--graphics/MesaLib/builtin-imake.mk12
-rw-r--r--graphics/MesaLib/builtin.mk17
-rw-r--r--graphics/freetype2/builtin-imake.mk12
-rw-r--r--graphics/freetype2/builtin.mk17
-rw-r--r--graphics/glu/builtin-imake.mk12
-rw-r--r--graphics/glu/builtin.mk17
-rw-r--r--graphics/xpm/builtin-imake.mk12
-rw-r--r--graphics/xpm/builtin.mk17
-rwxr-xr-xmk/buildlink3/imake-check88
-rw-r--r--mk/buildlink3/imake-check.mk79
-rw-r--r--textproc/expat/builtin-imake.mk12
-rw-r--r--textproc/expat/builtin.mk17
-rw-r--r--x11/Xcomposite/builtin-imake.mk12
-rw-r--r--x11/Xcomposite/builtin.mk17
-rw-r--r--x11/Xfixes/builtin-imake.mk12
-rw-r--r--x11/Xfixes/builtin.mk17
-rw-r--r--x11/Xrandr-mixedcase/builtin-imake.mk12
-rw-r--r--x11/Xrandr-mixedcase/builtin.mk17
-rw-r--r--x11/Xrender/builtin-imake.mk12
-rw-r--r--x11/Xrender/builtin.mk17
-rw-r--r--x11/xcursor/builtin-imake.mk12
-rw-r--r--x11/xcursor/builtin.mk17
26 files changed, 215 insertions, 300 deletions
diff --git a/fonts/Xft2/builtin-imake.mk b/fonts/Xft2/builtin-imake.mk
deleted file mode 100644
index 173c5fbd0a4..00000000000
--- a/fonts/Xft2/builtin-imake.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-XCOMM $NetBSD: builtin-imake.mk,v 1.1 2005/06/01 18:02:48 jlam Exp $
-
-/*
- * Check the value of BuildXftLibrary for the presence of
- * Xft2 in the X11 distribution.
- */
-builtin-test:
-#if BuildXftLibrary
- @echo yes
-#else
- @echo no
-#endif
diff --git a/fonts/Xft2/builtin.mk b/fonts/Xft2/builtin.mk
index 0fefe090f74..6a91387cfe5 100644
--- a/fonts/Xft2/builtin.mk
+++ b/fonts/Xft2/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.10 2005/06/03 17:02:36 jlam Exp $
+# $NetBSD: builtin.mk,v 1.11 2005/06/03 19:12:49 jlam Exp $
BUILTIN_PKG:= Xft2
@@ -14,18 +14,9 @@ BUILTIN_FIND_FILES.H_XFT2= ${X11BASE}/include/X11/Xft.h
.if !defined(IS_BUILTIN.Xft2)
IS_BUILTIN.Xft2= no
. if exists(${H_XFT2})
-PKGSRC_USE_TOOLS+= imake # XXX
-IMAKE?= ${X11BASE}/bin/imake # XXX
-_BUILTIN_IMAKE_CMD= ${IMAKE:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
-. if exists(${_BUILTIN_IMAKE_CMD})
-IS_BUILTIN.Xft2!= \
- dir=`cd ${BUILDLINK_PKGSRCDIR.Xft2} && ${PWD_CMD}`; \
- cd ${TMPDIR:U/tmp:Q} && \
- ${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config \
- -f $$dir/builtin-imake.mk -C builtin-imake.$$$$.c \
- -s - | \
- ${IMAKE_MAKE} -f - builtin-test
-. endif
+BUILTIN_IMAKE_CHECK:= Xft2:BuildXftLibrary
+. include "../../mk/buildlink3/imake-check.mk"
+IS_BUILTIN.Xft2= ${BUILTIN_IMAKE_CHECK.Xft2}
. endif
.endif
MAKEVARS+= IS_BUILTIN.Xft2
diff --git a/fonts/fontconfig/builtin-imake.mk b/fonts/fontconfig/builtin-imake.mk
deleted file mode 100644
index 0698c062e62..00000000000
--- a/fonts/fontconfig/builtin-imake.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-XCOMM $NetBSD: builtin-imake.mk,v 1.1 2005/06/01 18:02:48 jlam Exp $
-
-/*
- * Check the value of BuildFontconfigLibrary for the presence of
- * fontconfig in the X11 distribution.
- */
-builtin-test:
-#if BuildFontconfigLibrary
- @echo yes
-#else
- @echo no
-#endif
diff --git a/fonts/fontconfig/builtin.mk b/fonts/fontconfig/builtin.mk
index 3fdac8407a1..c8103f6429c 100644
--- a/fonts/fontconfig/builtin.mk
+++ b/fonts/fontconfig/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.6 2005/06/03 17:02:36 jlam Exp $
+# $NetBSD: builtin.mk,v 1.7 2005/06/03 19:12:49 jlam Exp $
BUILTIN_PKG:= fontconfig
@@ -15,18 +15,9 @@ BUILTIN_FIND_FILES.H_FONTCONFIG= \
.if !defined(IS_BUILTIN.fontconfig)
IS_BUILTIN.fontconfig= no
. if exists(${H_FONTCONFIG})
-PKGSRC_USE_TOOLS+= imake # XXX
-IMAKE?= ${X11BASE}/bin/imake # XXX
-_BUILTIN_IMAKE_CMD= ${IMAKE:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
-. if exists(${_BUILTIN_IMAKE_CMD})
-IS_BUILTIN.fontconfig!= \
- dir=`cd ${BUILDLINK_PKGSRCDIR.fontconfig} && ${PWD_CMD}`; \
- cd ${TMPDIR:U/tmp:Q} && \
- ${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config \
- -f $$dir/builtin-imake.mk -C builtin-imake.$$$$.c \
- -s - | \
- ${IMAKE_MAKE} -f - builtin-test
-. endif
+BUILTIN_IMAKE_CHECK:= fontconfig:BuildFontconfigLibrary
+. include "../../mk/buildlink3/imake-check.mk"
+IS_BUILTIN.fontconfig= ${BUILTIN_IMAKE_CHECK.fontconfig}
. endif
.endif
MAKEVARS+= IS_BUILTIN.fontconfig
diff --git a/graphics/MesaLib/builtin-imake.mk b/graphics/MesaLib/builtin-imake.mk
deleted file mode 100644
index 43855010f0a..00000000000
--- a/graphics/MesaLib/builtin-imake.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-XCOMM $NetBSD: builtin-imake.mk,v 1.1 2005/06/01 18:02:54 jlam Exp $
-
-/*
- * Check the value of BuildGLXLibrary for the presence of
- * MesaLib in the X11 distribution.
- */
-builtin-test:
-#if BuildGLXLibrary
- @echo yes
-#else
- @echo no
-#endif
diff --git a/graphics/MesaLib/builtin.mk b/graphics/MesaLib/builtin.mk
index 576b9edd3ee..b9f9bfd30f1 100644
--- a/graphics/MesaLib/builtin.mk
+++ b/graphics/MesaLib/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.8 2005/06/03 17:02:36 jlam Exp $
+# $NetBSD: builtin.mk,v 1.9 2005/06/03 19:12:49 jlam Exp $
BUILTIN_PKG:= MesaLib
@@ -14,18 +14,9 @@ BUILTIN_FIND_FILES.H_MESALIB= ${X11BASE}/include/GL/glx.h
.if !defined(IS_BUILTIN.MesaLib)
IS_BUILTIN.MesaLib= no
. if exists(${H_MESALIB})
-PKGSRC_USE_TOOLS+= imake # XXX
-IMAKE?= ${X11BASE}/bin/imake # XXX
-_BUILTIN_IMAKE_CMD= ${IMAKE:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
-. if exists(${_BUILTIN_IMAKE_CMD})
-IS_BUILTIN.MesaLib!= \
- dir=`cd ${BUILDLINK_PKGSRCDIR.MesaLib} && ${PWD_CMD}`; \
- cd ${TMPDIR:U/tmp:Q} && \
- ${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config \
- -f $$dir/builtin-imake.mk -C builtin-imake.$$$$.c \
- -s - | \
- ${IMAKE_MAKE} -f - builtin-test
-. endif
+BUILTIN_IMAKE_CHECK:= MesaLib:BuildGLXLibrary
+. include "../../mk/buildlink3/imake-check.mk"
+IS_BUILTIN.MesaLib= ${BUILTIN_IMAKE_CHECK.MesaLib}
. endif
.endif
MAKEVARS+= IS_BUILTIN.MesaLib
diff --git a/graphics/freetype2/builtin-imake.mk b/graphics/freetype2/builtin-imake.mk
deleted file mode 100644
index cf72049efe4..00000000000
--- a/graphics/freetype2/builtin-imake.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-XCOMM $NetBSD: builtin-imake.mk,v 1.1 2005/06/01 18:02:55 jlam Exp $
-
-/*
- * Check the value of BuildFreetype2Library for the presence of
- * freetype2 in the X11 distribution.
- */
-builtin-test:
-#if BuildFreetype2Library
- @echo yes
-#else
- @echo no
-#endif
diff --git a/graphics/freetype2/builtin.mk b/graphics/freetype2/builtin.mk
index ed3e4d22211..d6c21b54c28 100644
--- a/graphics/freetype2/builtin.mk
+++ b/graphics/freetype2/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.6 2005/06/03 17:02:36 jlam Exp $
+# $NetBSD: builtin.mk,v 1.7 2005/06/03 19:12:49 jlam Exp $
BUILTIN_PKG:= freetype2
@@ -14,18 +14,9 @@ BUILTIN_FIND_FILES.H_FREETYPE2= ${X11BASE}/include/freetype2/freetype/freetype.h
.if !defined(IS_BUILTIN.freetype2)
IS_BUILTIN.freetype2= no
. if exists(${H_FREETYPE2})
-PKGSRC_USE_TOOLS+= imake # XXX
-IMAKE?= ${X11BASE}/bin/imake # XXX
-_BUILTIN_IMAKE_CMD= ${IMAKE:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
-. if exists(${_BUILTIN_IMAKE_CMD})
-IS_BUILTIN.freetype2!= \
- dir=`cd ${BUILDLINK_PKGSRCDIR.freetype2} && ${PWD_CMD}`; \
- cd ${TMPDIR:U/tmp:Q} && \
- ${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config \
- -f $$dir/builtin-imake.mk -C builtin-imake.$$$$.c \
- -s - | \
- ${IMAKE_MAKE} -f - builtin-test
-. endif
+BUILTIN_IMAKE_CHECK:= freetype2:BuildFreetype2Library
+. include "../../mk/buildlink3/imake-check.mk"
+IS_BUILTIN.freetype2= ${BUILTIN_IMAKE_CHECK.freetype2}
. endif
.endif
MAKEVARS+= IS_BUILTIN.freetype2
diff --git a/graphics/glu/builtin-imake.mk b/graphics/glu/builtin-imake.mk
deleted file mode 100644
index d4a66cae37c..00000000000
--- a/graphics/glu/builtin-imake.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-XCOMM $NetBSD: builtin-imake.mk,v 1.1 2005/06/01 18:02:56 jlam Exp $
-
-/*
- * Check the value of BuildGLULibrary for the presence of
- * glu in the X11 distribution.
- */
-builtin-test:
-#if BuildGLULibrary
- @echo yes
-#else
- @echo no
-#endif
diff --git a/graphics/glu/builtin.mk b/graphics/glu/builtin.mk
index a0fc6575364..18f3916117e 100644
--- a/graphics/glu/builtin.mk
+++ b/graphics/glu/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.7 2005/06/03 17:02:36 jlam Exp $
+# $NetBSD: builtin.mk,v 1.8 2005/06/03 19:12:49 jlam Exp $
BUILTIN_PKG:= glu
@@ -14,18 +14,9 @@ BUILTIN_FIND_FILES.H_GLU= ${X11BASE}/include/GL/glu.h
.if !defined(IS_BUILTIN.glu)
IS_BUILTIN.glu= no
. if exists(${H_GLU})
-PKGSRC_USE_TOOLS+= imake # XXX
-IMAKE?= ${X11BASE}/bin/imake # XXX
-_BUILTIN_IMAKE_CMD= ${IMAKE:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
-. if exists(${_BUILTIN_IMAKE_CMD})
-IS_BUILTIN.glu!= \
- dir=`cd ${BUILDLINK_PKGSRCDIR.glu} && ${PWD_CMD}`; \
- cd ${TMPDIR:U/tmp:Q} && \
- ${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config \
- -f $$dir/builtin-imake.mk -C builtin-imake.$$$$.c \
- -s - | \
- ${IMAKE_MAKE} -f - builtin-test
-. endif
+BUILTIN_IMAKE_CHECK:= glu:BuildGLULibrary
+. include "../../mk/buildlink3/imake-check.mk"
+IS_BUILTIN.glu= ${BUILTIN_IMAKE_CHECK.glu}
. endif
.endif
MAKEVARS+= IS_BUILTIN.glu
diff --git a/graphics/xpm/builtin-imake.mk b/graphics/xpm/builtin-imake.mk
deleted file mode 100644
index b4ac4fdec4c..00000000000
--- a/graphics/xpm/builtin-imake.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-XCOMM $NetBSD: builtin-imake.mk,v 1.1 2005/06/01 18:02:58 jlam Exp $
-
-/*
- * Check the value of NormalLibXpm for the presence of Xpm
- * in the X11 distribution.
- */
-builtin-test:
-#if NormalLibXpm
- @echo yes
-#else
- @echo no
-#endif
diff --git a/graphics/xpm/builtin.mk b/graphics/xpm/builtin.mk
index cdf9d3d0ccd..277e9727234 100644
--- a/graphics/xpm/builtin.mk
+++ b/graphics/xpm/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.9 2005/06/03 17:02:36 jlam Exp $
+# $NetBSD: builtin.mk,v 1.10 2005/06/03 19:12:49 jlam Exp $
BUILTIN_PKG:= xpm
@@ -24,18 +24,9 @@ IS_BUILTIN.xpm!= \
. elif ${OPSYS} == "IRIX"
IS_BUILTIN.xpm= yes
. else
-PKGSRC_USE_TOOLS+= imake # XXX
-IMAKE?= ${X11BASE}/bin/imake # XXX
-_BUILTIN_IMAKE_CMD= ${IMAKE:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
-. if exists(${_BUILTIN_IMAKE_CMD})
-IS_BUILTIN.xpm!= \
- dir=`cd ${BUILDLINK_PKGSRCDIR.xpm} && ${PWD_CMD}`; \
- cd ${TMPDIR:U/tmp:Q} && \
- ${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config \
- -f $$dir/builtin-imake.mk -C builtin-imake.$$$$.c \
- -s - | \
- ${IMAKE_MAKE} -f - builtin-test
-. endif
+BUILTIN_IMAKE_CHECK:= xpm:NormalLibXpm
+. include "../../mk/buildlink3/imake-check.mk"
+IS_BUILTIN.xpm= ${BUILTIN_IMAKE_CHECK.xpm}
. endif
. endif
.endif
diff --git a/mk/buildlink3/imake-check b/mk/buildlink3/imake-check
new file mode 100755
index 00000000000..f30f7718e6f
--- /dev/null
+++ b/mk/buildlink3/imake-check
@@ -0,0 +1,88 @@
+#! /bin/sh
+#
+# Copyright (c) 2005 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Johnny C. Lam.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the NetBSD
+# Foundation, Inc. and its contributors.
+# 4. Neither the name of The NetBSD Foundation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+# This is the symbol whose value we want to test in the imake config
+# files, e.g. NormalLibXpm, BuildXftLibrary, etc.
+#
+imake_symbol="$1"
+
+: ${X11BASE:=/usr/X11R6}
+: ${IMAKE:=${X11BASE}/bin/imake}
+
+: ${CAT:=cat}
+: ${ECHO:=echo}
+: ${GREP:=grep}
+: ${IMAKE_MAKE:=make}
+: ${MKDIR:=mkdir}
+: ${RM:=rm}
+: ${TEST:=test}
+
+# Extract the first word of ${IMAKE}.
+for i in ${IMAKE}; do
+ imake_cmd="$i"; break
+done
+${TEST} -f "$imake_cmd" || exit 1
+
+# Create a secure temporary directory.
+: ${TMPDIR:=/tmp}
+tmpdir="${TMPDIR}/imake-check.$$"
+umask 077
+${MKDIR} "$tmpdir" || exit 1
+
+# Construct an Imakefile that will show whether $imake_symbol is
+# true or false.
+#
+cd "$tmpdir"
+${CAT} > Imakefile << EOF
+builtin-test:
+#if $imake_symbol
+ @${ECHO} yes
+#else
+ @${ECHO} no
+#endif
+EOF
+
+# Run imake to process the Imakefile.
+${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config -s - |
+ ${IMAKE_MAKE} -f - builtin-test |
+ ${GREP} -q yes
+exitcode="$?"
+
+# Clean up after ourselves.
+cd "${TMPDIR}"
+${RM} -rf "$tmpdir"
+exit "$exitcode"
diff --git a/mk/buildlink3/imake-check.mk b/mk/buildlink3/imake-check.mk
new file mode 100644
index 00000000000..af7d3cafbce
--- /dev/null
+++ b/mk/buildlink3/imake-check.mk
@@ -0,0 +1,79 @@
+# $NetBSD: imake-check.mk,v 1.1 2005/06/03 19:12:49 jlam Exp $
+#
+# Copyright (c) 2005 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Johnny C. Lam.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the NetBSD
+# Foundation, Inc. and its contributors.
+# 4. Neither the name of The NetBSD Foundation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# This is a "subroutine" that can be included to detect whether the
+# X11 distribution we are using with pkgsrc has certain X11 components
+# built-in to the distribution.
+#
+# The following variables must be defined before including this file:
+#
+# BUILTIN_IMAKE_CHECK is a list of <pkg>:<symbol> pairs, where <pkg>
+# is the package to check for, and <symbol> is the imake symbol
+# to check in the imake config files.
+#
+# After including this file, the following variables are defined:
+#
+# BUILTIN_IMAKE_CHECK.<pkg> is "yes" or "no" depending on whether the
+# specified imake symbol is "true" in the imake config files.
+#
+# An example use is:
+#
+# BUILTIN_IMAKE_CHECK:= Xft2:BuildXftLibrary
+# .include "../../mk/buildlink3/imake-check.mk"
+#
+
+.for _pair_ in ${BUILTIN_IMAKE_CHECK}
+PKGSRC_USE_TOOLS+= cat echo grep imake mkdir rm # XXX
+IMAKE?= ${X11BASE}/bin/imake # XXX
+
+. if !defined(BUILTIN_IMAKE_CHECK.${_pair_:C/\:[^:]*$//})
+BUILTIN_IMAKE_CHECK.${_pair_:C/\:[^:]*$//}!= \
+ if ${SETENV} CAT=${CAT:Q} ECHO=${ECHO:Q} GREP=${GREP:Q} \
+ IMAKE=${IMAKE:Q} IMAKE_MAKE=${IMAKE_MAKE:Q} \
+ MKDIR=${MKDIR:Q} RM=${RM:Q} TEST=${TEST:Q} \
+ X11BASE=${X11BASE:Q} \
+ ${SH} ${.CURDIR}/../../mk/buildlink3/imake-check \
+ ${_pair_:C/^[^:]*\://}; \
+ then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+. endif
+MAKEVARS+= BUILTIN_IMAKE_CHECK.${_pair_:C/\:[^:]*$//}
+.endfor
diff --git a/textproc/expat/builtin-imake.mk b/textproc/expat/builtin-imake.mk
deleted file mode 100644
index 77f5d4aa43d..00000000000
--- a/textproc/expat/builtin-imake.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-XCOMM $NetBSD: builtin-imake.mk,v 1.1 2005/06/01 18:03:23 jlam Exp $
-
-/*
- * Check the value of BuildExpatLibrary for the presence of
- * expat in the X11 distribution.
- */
-builtin-test:
-#if BuildExpatLibrary
- @echo yes
-#else
- @echo no
-#endif
diff --git a/textproc/expat/builtin.mk b/textproc/expat/builtin.mk
index f4d17b96462..4f5677823c3 100644
--- a/textproc/expat/builtin.mk
+++ b/textproc/expat/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.6 2005/06/03 17:02:36 jlam Exp $
+# $NetBSD: builtin.mk,v 1.7 2005/06/03 19:12:49 jlam Exp $
BUILTIN_PKG:= expat
@@ -14,18 +14,9 @@ BUILTIN_FIND_FILES.H_EXPAT= ${X11BASE}/include/expat.h
.if !defined(IS_BUILTIN.expat)
IS_BUILTIN.expat= no
. if exists(${H_EXPAT})
-PKGSRC_USE_TOOLS+= imake # XXX
-IMAKE?= ${X11BASE}/bin/imake # XXX
-_BUILTIN_IMAKE_CMD= ${IMAKE:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
-. if exists(${_BUILTIN_IMAKE_CMD})
-IS_BUILTIN.expat!= \
- dir=`cd ${BUILDLINK_PKGSRCDIR.expat} && ${PWD_CMD}`; \
- cd ${TMPDIR:U/tmp:Q} && \
- ${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config \
- -f $$dir/builtin-imake.mk -C builtin-imake.$$$$.c \
- -s - | \
- ${IMAKE_MAKE} -f - builtin-test
-. endif
+BUILTIN_IMAKE_CHECK:= expat:BuildExpatLibrary
+. include "../../mk/buildlink3/imake-check.mk"
+IS_BUILTIN.expat= ${BUILTIN_IMAKE_CHECK.expat}
. endif
.endif
MAKEVARS+= IS_BUILTIN.expat
diff --git a/x11/Xcomposite/builtin-imake.mk b/x11/Xcomposite/builtin-imake.mk
deleted file mode 100644
index 30158e304ca..00000000000
--- a/x11/Xcomposite/builtin-imake.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-XCOMM $NetBSD: builtin-imake.mk,v 1.1 2005/06/01 18:03:27 jlam Exp $
-
-/*
- * Check the value of BuildCompositeLibrary for the presence of
- * Xcomposite in the X11 distribution.
- */
-builtin-test:
-#if BuildCompositeLibrary
- @echo yes
-#else
- @echo no
-#endif
diff --git a/x11/Xcomposite/builtin.mk b/x11/Xcomposite/builtin.mk
index 24087d80b12..53c51ee2e04 100644
--- a/x11/Xcomposite/builtin.mk
+++ b/x11/Xcomposite/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.8 2005/06/03 17:02:36 jlam Exp $
+# $NetBSD: builtin.mk,v 1.9 2005/06/03 19:12:49 jlam Exp $
BUILTIN_PKG:= Xcomposite
@@ -15,18 +15,9 @@ BUILTIN_FIND_FILES.H_XCOMPOSITE= \
.if !defined(IS_BUILTIN.Xcomposite)
IS_BUILTIN.Xcomposite= no
. if exists(${H_XCOMPOSITE})
-PKGSRC_USE_TOOLS+= imake # XXX
-IMAKE?= ${X11BASE}/bin/imake # XXX
-_BUILTIN_IMAKE_CMD= ${IMAKE:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
-. if exists(${_BUILTIN_IMAKE_CMD})
-IS_BUILTIN.Xcomposite!= \
- dir=`cd ${BUILDLINK_PKGSRCDIR.Xcomposite} && ${PWD_CMD}`; \
- cd ${TMPDIR:U/tmp:Q} && \
- ${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config \
- -f $$dir/builtin-imake.mk -C builtin-imake.$$$$.c \
- -s - | \
- ${IMAKE_MAKE} -f - builtin-test
-. endif
+BUILTIN_IMAKE_CHECK:= Xcomposite:BuildCompositeLibrary
+. include "../../mk/buildlink3/imake-check.mk"
+IS_BUILTIN.Xcomposite= ${BUILTIN_IMAKE_CHECK.Xcomposite}
. endif
.endif
MAKEVARS+= IS_BUILTIN.Xcomposite
diff --git a/x11/Xfixes/builtin-imake.mk b/x11/Xfixes/builtin-imake.mk
deleted file mode 100644
index 7963f807be3..00000000000
--- a/x11/Xfixes/builtin-imake.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-XCOMM $NetBSD: builtin-imake.mk,v 1.1 2005/06/01 18:03:27 jlam Exp $
-
-/*
- * Check the value of BuildXfixesLibrary for the presence of
- * Xfixes in the X11 distribution.
- */
-builtin-test:
-#if BuildXfixesLibrary
- @echo yes
-#else
- @echo no
-#endif
diff --git a/x11/Xfixes/builtin.mk b/x11/Xfixes/builtin.mk
index 2485408df11..59d68dac2ac 100644
--- a/x11/Xfixes/builtin.mk
+++ b/x11/Xfixes/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.7 2005/06/03 17:02:36 jlam Exp $
+# $NetBSD: builtin.mk,v 1.8 2005/06/03 19:12:49 jlam Exp $
BUILTIN_PKG:= Xfixes
@@ -14,18 +14,9 @@ BUILTIN_FIND_FILES.H_XFIXES= ${X11BASE}/include/X11/extensions/Xfixes.h
.if !defined(IS_BUILTIN.Xfixes)
IS_BUILTIN.Xfixes= no
. if exists(${H_XFIXES})
-PKGSRC_USE_TOOLS+= imake # XXX
-IMAKE?= ${X11BASE}/bin/imake # XXX
-_BUILTIN_IMAKE_CMD= ${IMAKE:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
-. if exists(${_BUILTIN_IMAKE_CMD})
-IS_BUILTIN.Xfixes!= \
- dir=`cd ${BUILDLINK_PKGSRCDIR.Xfixes} && ${PWD_CMD}`; \
- cd ${TMPDIR:U/tmp:Q} && \
- ${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config \
- -f $$dir/builtin-imake.mk -C builtin-imake.$$$$.c \
- -s - | \
- ${IMAKE_MAKE} -f - builtin-test
-. endif
+BUILTIN_IMAKE_CHECK:= Xfixes:BuildXfixesLibrary
+. include "../../mk/buildlink3/imake-check.mk"
+IS_BUILTIN.Xfixes= ${BUILTIN_IMAKE_CHECK.Xfixes}
. endif
.endif
MAKEVARS+= IS_BUILTIN.Xfixes
diff --git a/x11/Xrandr-mixedcase/builtin-imake.mk b/x11/Xrandr-mixedcase/builtin-imake.mk
deleted file mode 100644
index 7474999aba3..00000000000
--- a/x11/Xrandr-mixedcase/builtin-imake.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-XCOMM $NetBSD: builtin-imake.mk,v 1.1 2005/06/01 18:03:27 jlam Exp $
-
-/*
- * Check the value of BuildRandRLibrary for the presence of
- * Xrandr in the X11 distribution.
- */
-builtin-test:
-#if BuildRandRLibrary
- @echo yes
-#else
- @echo no
-#endif
diff --git a/x11/Xrandr-mixedcase/builtin.mk b/x11/Xrandr-mixedcase/builtin.mk
index b162c179896..7a94c705b59 100644
--- a/x11/Xrandr-mixedcase/builtin.mk
+++ b/x11/Xrandr-mixedcase/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.11 2005/06/03 17:02:36 jlam Exp $
+# $NetBSD: builtin.mk,v 1.12 2005/06/03 19:12:49 jlam Exp $
BUILTIN_PKG:= Xrandr
@@ -14,18 +14,9 @@ BUILTIN_FIND_FILES.H_XRANDR= ${X11BASE}/include/X11/extensions/Xrandr.h
.if !defined(IS_BUILTIN.Xrandr)
IS_BUILTIN.Xrandr= no
. if exists(${H_XRANDR})
-PKGSRC_USE_TOOLS+= imake # XXX
-IMAKE?= ${X11BASE}/bin/imake # XXX
-_BUILTIN_IMAKE_CMD= ${IMAKE:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
-. if exists(${_BUILTIN_IMAKE_CMD})
-IS_BUILTIN.Xrandr!= \
- dir=`cd ${BUILDLINK_PKGSRCDIR.Xrandr} && ${PWD_CMD}`; \
- cd ${TMPDIR:U/tmp:Q} && \
- ${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config \
- -f $$dir/builtin-imake.mk -C builtin-imake.$$$$.c \
- -s - | \
- ${IMAKE_MAKE} -f - builtin-test
-. endif
+BUILTIN_IMAKE_CHECK:= Xrandr:BuildRandRLibrary
+. include "../../mk/buildlink3/imake-check.mk"
+IS_BUILTIN.Xrandr= ${BUILTIN_IMAKE_CHECK.Xrandr}
. endif
.endif
MAKEVARS+= IS_BUILTIN.Xrandr
diff --git a/x11/Xrender/builtin-imake.mk b/x11/Xrender/builtin-imake.mk
deleted file mode 100644
index 0e225d1d135..00000000000
--- a/x11/Xrender/builtin-imake.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-XCOMM $NetBSD: builtin-imake.mk,v 1.1 2005/06/01 18:03:27 jlam Exp $
-
-/*
- * Check the value of BuildRenderLibrary for the presence of
- * Xrender in the X11 distribution.
- */
-builtin-test:
-#if BuildRenderLibrary
- @echo yes
-#else
- @echo no
-#endif
diff --git a/x11/Xrender/builtin.mk b/x11/Xrender/builtin.mk
index 69aae99d4e4..e107e21c9bf 100644
--- a/x11/Xrender/builtin.mk
+++ b/x11/Xrender/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.10 2005/06/03 17:02:36 jlam Exp $
+# $NetBSD: builtin.mk,v 1.11 2005/06/03 19:12:50 jlam Exp $
BUILTIN_PKG:= Xrender
@@ -14,18 +14,9 @@ BUILTIN_FIND_FILES.H_XRENDER= ${X11BASE}/include/X11/extensions/Xrender.h
.if !defined(IS_BUILTIN.Xrender)
IS_BUILTIN.Xrender= no
. if exists(${H_XRENDER})
-PKGSRC_USE_TOOLS+= imake # XXX
-IMAKE?= ${X11BASE}/bin/imake # XXX
-_BUILTIN_IMAKE_CMD= ${IMAKE:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
-. if exists(${_BUILTIN_IMAKE_CMD})
-IS_BUILTIN.Xrender!= \
- dir=`cd ${BUILDLINK_PKGSRCDIR.Xrender} && ${PWD_CMD}`; \
- cd ${TMPDIR:U/tmp:Q} && \
- ${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config \
- -f $$dir/builtin-imake.mk -C builtin-imake.$$$$.c \
- -s - | \
- ${IMAKE_MAKE} -f - builtin-test
-. endif
+BUILTIN_IMAKE_CHECK:= Xrender:BuildRenderLibrary
+. include "../../mk/buildlink3/imake-check.mk"
+IS_BUILTIN.Xrender= ${BUILTIN_IMAKE_CHECK.Xrender}
. endif
.endif
MAKEVARS+= IS_BUILTIN.Xrender
diff --git a/x11/xcursor/builtin-imake.mk b/x11/xcursor/builtin-imake.mk
deleted file mode 100644
index 0d398fd827a..00000000000
--- a/x11/xcursor/builtin-imake.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-XCOMM $NetBSD: builtin-imake.mk,v 1.1 2005/06/01 18:03:32 jlam Exp $
-
-/*
- * Check the value of BuildXcursorLibrary for the presence of
- * Xcursor in the X11 distribution.
- */
-builtin-test:
-#if BuildXcursorLibrary
- @echo yes
-#else
- @echo no
-#endif
diff --git a/x11/xcursor/builtin.mk b/x11/xcursor/builtin.mk
index 4d4fc7d8ac4..8647e24523d 100644
--- a/x11/xcursor/builtin.mk
+++ b/x11/xcursor/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.8 2005/06/03 17:02:36 jlam Exp $
+# $NetBSD: builtin.mk,v 1.9 2005/06/03 19:12:50 jlam Exp $
BUILTIN_PKG:= xcursor
@@ -14,18 +14,9 @@ BUILTIN_FIND_FILES.H_XCURSOR= ${X11BASE}/include/X11/Xcursor/Xcursor.h
.if !defined(IS_BUILTIN.xcursor)
IS_BUILTIN.xcursor= no
. if exists(${H_XCURSOR})
-PKGSRC_USE_TOOLS+= imake # XXX
-IMAKE?= ${X11BASE}/bin/imake # XXX
-_BUILTIN_IMAKE_CMD= ${IMAKE:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
-. if exists(${_BUILTIN_IMAKE_CMD})
-IS_BUILTIN.xcursor!= \
- dir=`cd ${BUILDLINK_PKGSRCDIR.xcursor} && ${PWD_CMD}`; \
- cd ${TMPDIR:U/tmp:Q} && \
- ${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config \
- -f $$dir/builtin-imake.mk -C builtin-imake.$$$$.c \
- -s - | \
- ${IMAKE_MAKE} -f - builtin-test
-. endif
+BUILTIN_IMAKE_CHECK:= xcursor:BuildXcursorLibrary
+. include "../../mk/buildlink3/imake-check.mk"
+IS_BUILTIN.Xcursor= ${BUILTIN_IMAKE_CHECK.Xcursor}
. endif
.endif
MAKEVARS+= IS_BUILTIN.xcursor