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 /devel/readline | |
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 'devel/readline')
-rw-r--r-- | devel/readline/buildlink2.mk | 37 | ||||
-rw-r--r-- | devel/readline/buildlink3.mk | 27 |
2 files changed, 34 insertions, 30 deletions
diff --git a/devel/readline/buildlink2.mk b/devel/readline/buildlink2.mk index b1b01d8dc5f..f395cbe82c7 100644 --- a/devel/readline/buildlink2.mk +++ b/devel/readline/buildlink2.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink2.mk,v 1.6 2004/02/05 07:17:14 jlam Exp $ +# $NetBSD: buildlink2.mk,v 1.7 2004/02/12 01:59:38 jlam Exp $ # # Optionally define USE_GNU_READLINE to force use of GNU readline. # @@ -13,27 +13,28 @@ READLINE_BUILDLINK2_MK= # defined BUILDLINK_DEPENDS.readline?= readline>=2.2 BUILDLINK_PKGSRCDIR.readline?= ../../devel/readline -.if defined(USE_GNU_READLINE) -_NEED_GNU_READLINE= YES +.if exists(/usr/include/readline.h) || \ + exists(/usr/include/readline/readline.h) +_BUILTIN_READLINE= YES .else -. if exists(/usr/include/readline.h) || \ - exists(/usr/include/readline/readline.h) -_NEED_GNU_READLINE= NO -. else -_NEED_GNU_READLINE= YES -. endif +_BUILTIN_READLINE= NO +.endif # # This catch-all for SunOS is probably too broad, but better to err on # the safe side. We can narrow down the match when we have better # information. # _INCOMPAT_READLINE= SunOS-*-* -INCOMPAT_READLINE?= # empty -. for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE} -. if !empty(MACHINE_PLATFORM:M${_pattern_}) +.for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE} +. if !empty(MACHINE_PLATFORM:M${_pattern_}) +_BUILTIN_READLINE= NO +. endif +.endfor + +.if ${_BUILTIN_READLINE} == "YES" +_NEED_GNU_READLINE= NO +.else _NEED_GNU_READLINE= YES -. endif -. endfor .endif .if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \ @@ -41,14 +42,18 @@ _NEED_GNU_READLINE= YES _NEED_GNU_READLINE= YES .endif +.if defined(USE_GNU_READLINE) +_NEED_GNU_READLINE= YES +.endif + .if ${_NEED_GNU_READLINE} == "YES" BUILDLINK_PACKAGES+= readline EVAL_PREFIX+= BUILDLINK_PREFIX.readline=readline BUILDLINK_PREFIX.readline_DEFAULT= ${LOCALBASE} .else -BUILDLINK_PREFIX.readline= /usr +BUILDLINK_PREFIX.readline= /usr .endif -BUILDLINK_PREFIX.history= ${BUILDLINK_PREFIX.readline} +BUILDLINK_PREFIX.history= ${BUILDLINK_PREFIX.readline} BUILDLINK_FILES.readline= include/readline.h BUILDLINK_FILES.readline+= include/readline/* diff --git a/devel/readline/buildlink3.mk b/devel/readline/buildlink3.mk index d65025a8a43..f64d39b6e48 100644 --- a/devel/readline/buildlink3.mk +++ b/devel/readline/buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink3.mk,v 1.11 2004/02/11 11:30:50 jlam Exp $ +# $NetBSD: buildlink3.mk,v 1.12 2004/02/12 01:59:38 jlam Exp $ # # Optionally define USE_GNU_READLINE to force use of GNU readline. # @@ -24,19 +24,27 @@ BUILDLINK_IS_BUILTIN.readline= NO exists(/usr/include/readline/readline.h) BUILDLINK_IS_BUILTIN.readline= YES . endif +. if !empty(BUILDLINK_CHECK_BUILTIN.readline:M[nN][oO]) # # These catch-alls are probably too broad, but better to err on the safe # side. We can narrow down the match when we have better information. # _INCOMPAT_READLINE?= SunOS-*-* -. for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE} -. if !empty(MACHINE_PLATFORM:M${_pattern_}) +. for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE} +. if !empty(MACHINE_PLATFORM:M${_pattern_}) BUILDLINK_IS_BUILTIN.readline= NO -. endif -. endfor +. endif +. endfor +. endif MAKEFLAGS+= BUILDLINK_IS_BUILTIN.readline=${BUILDLINK_IS_BUILTIN.readline} .endif +.if !empty(BUILDLINK_IS_BUILTIN.readline:M[yY][eE][sS]) +BUILDLINK_USE_BUILTIN.readline= YES +.else +BUILDLINK_USE_BUILTIN.readline= NO +.endif + .if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \ !empty(PREFER_PKGSRC:Mreadline) BUILDLINK_USE_BUILTIN.readline= NO @@ -50,15 +58,6 @@ BUILDLINK_USE_BUILTIN.readline= NO BUILDLINK_USE_BUILTIN.readline= YES .endif -.if !defined(BUILDLINK_USE_BUILTIN.readline) -. if !empty(BUILDLINK_IS_BUILTIN.readline:M[nN][oO]) -BUILDLINK_USE_BUILTIN.readline= NO -. else -BUILDLINK_USE_BUILTIN.readline= YES -. endif -MAKEFLAGS+= BUILDLINK_USE_BUILTIN.readline=${BUILDLINK_USE_BUILTIN.readline} -.endif - .if !empty(BUILDLINK_USE_BUILTIN.readline:M[nN][oO]) . if !empty(BUILDLINK_DEPTH:M+) BUILDLINK_DEPENDS+= readline |