diff options
author | jlam <jlam@pkgsrc.org> | 2004-02-17 15:57:55 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-02-17 15:57:55 +0000 |
commit | 6b1c1ab605e553514e26963c948915c9b3b33bfa (patch) | |
tree | 45f73121ff1b7250e2e69846290d7ac36934115c /devel/readline | |
parent | 530953a61b5bb7c555093eab27b9a6e3b0161832 (diff) | |
download | pkgsrc-6b1c1ab605e553514e26963c948915c9b3b33bfa.tar.gz |
Deal with built-in readline actually being GNU readline.
Diffstat (limited to 'devel/readline')
-rw-r--r-- | devel/readline/buildlink3.mk | 97 |
1 files changed, 76 insertions, 21 deletions
diff --git a/devel/readline/buildlink3.mk b/devel/readline/buildlink3.mk index b16b90e848b..973f7714165 100644 --- a/devel/readline/buildlink3.mk +++ b/devel/readline/buildlink3.mk @@ -1,9 +1,4 @@ -# $NetBSD: buildlink3.mk,v 1.13 2004/02/12 02:35:06 jlam Exp $ -# -# Optionally define USE_GNU_READLINE to force use of GNU readline. -# -# NOTE: You may need to do some more work to get libedit recognized over -# libreadline, especially by GNU configure scripts. +# $NetBSD: buildlink3.mk,v 1.14 2004/02/17 15:57:55 jlam Exp $ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ READLINE_BUILDLINK3_MK:= ${READLINE_BUILDLINK3_MK}+ @@ -18,17 +13,81 @@ BUILDLINK_PKGSRCDIR.readline?= ../../devel/readline BUILDLINK_CHECK_BUILTIN.readline?= NO +.if !defined(_BLNK_LIBREADLINE_FOUND) +_BLNK_LIBREADLINE_FOUND!= \ + if [ "`${ECHO} /usr/lib/libreadline.*`" = "/usr/lib/libreadline.*" ]; then \ + ${ECHO} "NO"; \ + else \ + ${ECHO} "YES"; \ + fi +MAKEFLAGS+= _BLNK_LIBREADLINE_FOUND=${_BLNK_LIBREADLINE_FOUND} +.endif + +.if !defined(_BLNK_LIBEDIT_FOUND) +_BLNK_LIBEDIT_FOUND!= \ + if [ "`${ECHO} /usr/lib/libedit.*`" = "/usr/lib/libedit.*" ]; then \ + ${ECHO} "NO"; \ + else \ + ${ECHO} "YES"; \ + fi +MAKEFLAGS+= _BLNK_LIBEDIT_FOUND=${_BLNK_LIBEDIT_FOUND} +.endif + +_READLINE_H= /usr/include/readline.h +_READLINE_READLINE_H= /usr/include/readline/readline.h + .if !defined(BUILDLINK_IS_BUILTIN.readline) BUILDLINK_IS_BUILTIN.readline= NO -. if exists(/usr/include/readline.h) || \ - exists(/usr/include/readline/readline.h) +. if !empty(_BLNK_LIBREADLINE_FOUND:M[yY][eE][sS]) BUILDLINK_IS_BUILTIN.readline= YES +. elif exists(${_READLINE_H}) || exists(${_READLINE_READLINE_H}) +. if exists(${_READLINE_H}) +_READLINE_HEADER= ${_READLINE_H} +. else +_READLINE_HEADER= ${_READLINE_READLINE_H} +. endif +_IS_BUILTIN.readline!= \ + if ${GREP} -q "\#define[ ]*RL_VERSION_MAJOR" ${_READLINE_HEADER}; then \ + ${ECHO} "YES"; \ + else \ + ${ECHO} "NO"; \ + fi +BUILDLINK_IS_BUILTIN.readline= ${_IS_BUILTIN.readline} +. if !empty(BUILDLINK_CHECK_BUILTIN.readline:M[nN][oO]) && \ + !empty(_IS_BUILTIN.readline:M[yY][eE][sS]) +# +# Create an appropriate name for the built-in package 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. +# +_READLINE_MAJOR!= \ + ${AWK} '/\#define[ ]*RL_VERSION_MAJOR/ { print $$3 }' \ + ${_READLINE_HEADER} +_READLINE_MINOR!= \ + ${AWK} '/\#define[ ]*RL_VERSION_MINOR/ { print $$3 }' \ + ${_READLINE_HEADER} +_READLINE_VERSION= ${_READLINE_MAJOR}.${_READLINE_MINOR} +_READLINE_PKG= readline-${_READLINE_VERSION} +BUILDLINK_IS_BUILTIN.readline= YES +. for _depend_ in ${BUILDLINK_DEPENDS.readline} +. if !empty(BUILDLINK_IS_BUILTIN.readline:M[yY][eE][sS]) +BUILDLINK_IS_BUILTIN.readline!= \ + if ${PKG_ADMIN} pmatch '${_depend_}' ${_READLINE_PKG}; then \ + ${ECHO} "YES"; \ + else \ + ${ECHO} "NO"; \ + fi +. endif +. endfor +. endif . 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. +# XXX By default, assume that the native editline library supports readline. # +. if !empty(_BLNK_LIBREADLINE_FOUND:M[nN][oO]) && \ + !empty(_BLNK_LIBEDIT_FOUND:M[yY][eE][sS]) +BUILDLINK_IS_BUILTIN.readline= YES _INCOMPAT_READLINE?= SunOS-*-* . for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE} . if !empty(MACHINE_PLATFORM:M${_pattern_}) @@ -61,7 +120,11 @@ BUILDLINK_USE_BUILTIN.readline= NO .endif .if defined(USE_GNU_READLINE) +. if !empty(BUILDLINK_IS_BUILTIN.readline:M[yY][eE][sS]) && \ + !empty(_BLNK_LIBREADLINE_FOUND:M[nN][oO]) && \ + !empty(_BLNK_LIBEDIT_FOUND:M[yY][eE][sS]) BUILDLINK_USE_BUILTIN.readline= NO +. endif .endif .if !empty(BUILDLINK_CHECK_BUILTIN.readline:M[yY][eE][sS]) @@ -76,16 +139,8 @@ BUILDLINK_DEPENDS+= readline .if !empty(READLINE_BUILDLINK3_MK:M+) . if !empty(BUILDLINK_USE_BUILTIN.readline:M[yY][eE][sS]) -. if !defined(_BLNK_LIBEDIT_FOUND) -_BLNK_LIBEDIT_FOUND!= \ - if [ "`${ECHO} /usr/lib/libedit.*`" = "/usr/lib/libedit.*" ]; then \ - ${ECHO} "NO"; \ - else \ - ${ECHO} "YES"; \ - fi -MAKEFLAGS+= _BLNK_LIBEDIT_FOUND=${_BLNK_LIBEDIT_FOUND} -. endif -. if ${_BLNK_LIBEDIT_FOUND} == "YES" +. if !empty(_BLNK_LIBREADLINE_FOUND:M[nN][oO]) && \ + !empty(_BLNK_LIBEDIT_FOUND:M[yY][eE][sS]) BUILDLINK_TRANSFORM+= l:history:edit BUILDLINK_TRANSFORM+= l:readline:edit:termcap . endif |