diff options
Diffstat (limited to 'textproc/expat/builtin.mk')
-rw-r--r-- | textproc/expat/builtin.mk | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/textproc/expat/builtin.mk b/textproc/expat/builtin.mk new file mode 100644 index 00000000000..affa0e49395 --- /dev/null +++ b/textproc/expat/builtin.mk @@ -0,0 +1,69 @@ +# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $ + +_EXPAT_H= ${X11BASE}/include/expat.h +_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl + +.if !defined(IS_BUILTIN.expat) +IS_BUILTIN.expat= no +. if exists(${_X11_TMPL}) && exists(${_EXPAT_H}) +IS_BUILTIN.expat!= \ + if ${GREP} -q BuildExpatLibrary ${_X11_TMPL}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. if !empty(IS_BUILTIN.expat:M[yY][eE][sS]) +# +# Create an appropriate package name for the built-in expat 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. +# +_EXPAT_MAJOR!= \ + ${AWK} '/\#define[ ]*XML_MAJOR_VERSION/ { print $$3 }' \ + ${_EXPAT_H} +_EXPAT_MINOR!= \ + ${AWK} '/\#define[ ]*XML_MINOR_VERSION/ { print $$3 }' \ + ${_EXPAT_H} +_EXPAT_MICRO!= \ + ${AWK} '/\#define[ ]*XML_MICRO_VERSION/ { print $$3 }' \ + ${_EXPAT_H} +_EXPAT_VERSION= ${_EXPAT_MAJOR}.${_EXPAT_MINOR}.${_EXPAT_MICRO} +BUILTIN_PKG.expat= expat-${_EXPAT_VERSION} +MAKEFLAGS+= BUILTIN_PKG.expat=${BUILTIN_PKG.expat} +. endif +. endif +MAKEFLAGS+= IS_BUILTIN.expat=${IS_BUILTIN.expat} +.endif + +CHECK_BUILTIN.expat?= no +.if !empty(CHECK_BUILTIN.expat:M[yY][eE][sS]) +USE_BUILTIN.expat= yes +.endif + +.if !defined(USE_BUILTIN.expat) +USE_BUILTIN.expat?= ${IS_BUILTIN.expat} + +. if defined(BUILTIN_PKG.expat) +USE_BUILTIN.expat= yes +. for _depend_ in ${BUILDLINK_DEPENDS.expat} +. if !empty(USE_BUILTIN.expat:M[yY][eE][sS]) +USE_BUILTIN.expat!= \ + if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.expat}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. endif +. endfor +. endif +.endif # USE_BUILTIN.expat + +.if !empty(USE_BUILTIN.expat:M[nN][oO]) +BUILDLINK_DEPENDS.expat+= expat>=1.95.4 +.endif + +.if !empty(USE_BUILTIN.expat:M[yY][eE][sS]) +BUILDLINK_PREFIX.expat= ${X11BASE} +USE_X11= yes +.endif |