diff options
author | jlam <jlam@pkgsrc.org> | 2004-02-12 01:59:37 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-02-12 01:59:37 +0000 |
commit | 2dd4c91aa324bb3d53a65569311b184a500842ba (patch) | |
tree | f36bdf155011b2521ad9dfd8a23373398462d265 /x11/Xrender | |
parent | 673a1b7cc2bc6821a611934197768830adb9581e (diff) | |
download | pkgsrc-2dd4c91aa324bb3d53a65569311b184a500842ba.tar.gz |
Reorganize code so that any dependencies are checked as part of deciding
whether the software is built-in or not. This facilitates implementing
the forthcoming PKGSRC_NATIVE variable.
Diffstat (limited to 'x11/Xrender')
-rw-r--r-- | x11/Xrender/buildlink2.mk | 42 | ||||
-rw-r--r-- | x11/Xrender/buildlink3.mk | 57 |
2 files changed, 53 insertions, 46 deletions
diff --git a/x11/Xrender/buildlink2.mk b/x11/Xrender/buildlink2.mk index 33a26e85e16..d20401f7c15 100644 --- a/x11/Xrender/buildlink2.mk +++ b/x11/Xrender/buildlink2.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink2.mk,v 1.8 2004/02/05 07:17:14 jlam Exp $ +# $NetBSD: buildlink2.mk,v 1.9 2004/02/12 01:59:38 jlam Exp $ .if !defined(XRENDER_BUILDLINK2_MK) XRENDER_BUILDLINK2_MK= # defined @@ -15,19 +15,10 @@ _REQUIRE_BUILTIN_XRENDER?= NO _RENDER_H= ${X11BASE}/include/X11/extensions/render.h _X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl -.if exists(${_RENDER_H}) && exists(${_X11_TMPL}) -_IS_BUILTIN_XRENDER!= ${GREP} -c BuildRenderLibrary ${_X11_TMPL} || ${TRUE} -.else -_IS_BUILTIN_XRENDER= 0 -.endif -.if !empty(_REQUIRE_BUILTIN_XRENDER:M[yY][eE][sS]) -_NEED_XRENDER= NO -.else -. if ${_IS_BUILTIN_XRENDER} == "0" -_NEED_XRENDER= YES -. else -# +.if !defined(_BUILTIN_XRENDER) +_BUILTIN_XRENDER= NO +. if exists(${_RENDER_H}) && exists(${_X11_TMPL}) # Create an appropriate Xrender package name for the built-in Xrender # distributed with XFree86 4.x. This package name can be used to check # against BUILDLINK_DEPENDS.Xrender to see if we need to install the @@ -40,23 +31,38 @@ _XRENDER_MINOR!= \ _XRENDER_VERSION= ${_XRENDER_MAJOR}${_XRENDER_MINOR} _XRENDER_PKG= Xrender-${_XRENDER_VERSION} _XRENDER_DEPENDS= ${BUILDLINK_DEPENDS.Xrender} -_NEED_XRENDER!= \ +_BUILTIN_XRENDER!= \ if ${PKG_ADMIN} pmatch '${_XRENDER_DEPENDS}' ${_XRENDER_PKG}; then \ - ${ECHO} "NO"; \ + if ${GREP} -q BuildRenderLibrary ${_X11_TMPL}; then \ + ${ECHO} "YES"; \ + else \ + ${ECHO} "NO"; \ + fi; \ else \ - ${ECHO} "YES"; \ + ${ECHO} "NO"; \ fi . endif +MAKEFLAGS+= _BUILTIN_XRENDER=${_BUILTIN_XRENDER} .endif -BUILDLINK_FILES.Xrender= include/X11/extensions/Xrender.h -BUILDLINK_FILES.Xrender+= lib/libXrender.* +.if !empty(_BUILTIN_XRENDER:M[yY][eE][sS]) +_NEED_XRENDER= NO +.else +_NEED_XRENDER= YES +.endif .if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \ !empty(PREFER_PKGSRC:MXrender) _NEED_XRENDER= YES .endif +.if !empty(_REQUIRE_BUILTIN_XRENDER:M[yY][eE][sS]) +_NEED_XRENDER= NO +.endif + +BUILDLINK_FILES.Xrender= include/X11/extensions/Xrender.h +BUILDLINK_FILES.Xrender+= lib/libXrender.* + .if ${_NEED_XRENDER} == "YES" BUILDLINK_PACKAGES+= Xrender EVAL_PREFIX+= BUILDLINK_PREFIX.Xrender=Xrender diff --git a/x11/Xrender/buildlink3.mk b/x11/Xrender/buildlink3.mk index e0408eb1281..14249369e16 100644 --- a/x11/Xrender/buildlink3.mk +++ b/x11/Xrender/buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink3.mk,v 1.17 2004/02/06 19:04:25 jlam Exp $ +# $NetBSD: buildlink3.mk,v 1.18 2004/02/12 01:59:38 jlam Exp $ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ XRENDER_BUILDLINK3_MK:= ${XRENDER_BUILDLINK3_MK}+ @@ -19,29 +19,15 @@ _X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl .if !defined(BUILDLINK_IS_BUILTIN.Xrender) BUILDLINK_IS_BUILTIN.Xrender= NO . if exists(${_X11_EXTENSIONS_RENDER_H}) && exists(${_X11_TMPL}) -BUILDLINK_IS_BUILTIN.Xrender!= \ +_IS_BUILTIN.Xrender!= \ if ${GREP} -q BuildRenderLibrary ${_X11_TMPL}; then \ ${ECHO} "YES"; \ else \ ${ECHO} "NO"; \ fi -. endif -MAKEFLAGS+= BUILDLINK_IS_BUILTIN.Xrender=${BUILDLINK_IS_BUILTIN.Xrender} -.endif - -.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \ - !empty(PREFER_PKGSRC:MXrender) -BUILDLINK_USE_BUILTIN.Xrender= NO -.endif - -.if !empty(BUILDLINK_CHECK_BUILTIN.Xrender:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.Xrender= YES -.endif - -.if !defined(BUILDLINK_USE_BUILTIN.Xrender) -. if !empty(BUILDLINK_IS_BUILTIN.Xrender:M[nN][oO]) -BUILDLINK_USE_BUILTIN.Xrender= NO -. else +BUILDLINK_IS_BUILTIN.Xrender= ${_IS_BUILTIN.Xrender} +. if !empty(BUILDLINK_CHECK_BUILTIN.Xrender:M[nN][oO]) && \ + !empty(_IS_BUILTIN.Xrender:M[yY][eE][sS]) # # Create an appropriate package name for the built-in Xrender distributed # with the system. This package name can be used to check against @@ -54,21 +40,36 @@ _XRENDER_MINOR!= \ ${AWK} '/\#define[ ]*RENDER_MINOR/ { print "."$$3 }' ${_X11_EXTENSIONS_RENDER_H} _XRENDER_VERSION= ${_XRENDER_MAJOR}${_XRENDER_MINOR} _XRENDER_PKG= Xrender-${_XRENDER_VERSION} -BUILDLINK_USE_BUILTIN.Xrender?= YES -. for _depend_ in ${BUILDLINK_DEPENDS.Xrender} -. if !empty(BUILDLINK_USE_BUILTIN.Xrender:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.Xrender!= \ +BUILDLINK_IS_BUILTIN.Xrender?= YES +. for _depend_ in ${BUILDLINK_DEPENDS.Xrender} +. if !empty(BUILDLINK_IS_BUILTIN.Xrender:M[yY][eE][sS]) +BUILDLINK_IS_BUILTIN.Xrender!= \ if ${PKG_ADMIN} pmatch '${_depend_}' ${_XRENDER_PKG}; then \ ${ECHO} "YES"; \ else \ ${ECHO} "NO"; \ fi -. endif -. endfor +. endif +. endfor +. endif . endif -MAKEFLAGS+= \ - BUILDLINK_USE_BUILTIN.Xrender=${BUILDLINK_USE_BUILTIN.Xrender} -.endif # BUILDLINK_USE_BUILTIN.Xrender +MAKEFLAGS+= BUILDLINK_IS_BUILTIN.Xrender=${BUILDLINK_IS_BUILTIN.Xrender} +.endif + +.if !empty(BUILDLINK_IS_BUILTIN.Xrender:M[yY][eE][sS]) +BUILDLINK_USE_BUILTIN.Xrender= YES +.else +BUILDLINK_USE_BUILTIN.Xrender= NO +.endif + +.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \ + !empty(PREFER_PKGSRC:MXrender) +BUILDLINK_USE_BUILTIN.Xrender= NO +.endif + +.if !empty(BUILDLINK_CHECK_BUILTIN.Xrender:M[yY][eE][sS]) +BUILDLINK_USE_BUILTIN.Xrender= YES +.endif .if !empty(BUILDLINK_USE_BUILTIN.Xrender:M[nN][oO]) # |