--- Mk/Uses/readline.mk (revision 360543) +++ Mk/Uses/readline.mk (working copy) @@ -6,6 +6,10 @@ # Usage: USES=readline # Valid ARGS: port # +# User-specified readline wish: +# Usage: READLINE_FLAVOR=ARG +# Valid ARG: base (default), edit, port +# # MAINTAINER: portmgr@FreeBSD.org .if !defined(_INCLUDE_USES_READLINE_MK) @@ -12,9 +16,22 @@ _INCLUDE_USES_READLINE_MK= yes .if !exists(/usr/lib/libreadline.so) +. if exists(/usr/include/edit/readline/readline.h) +readline_ARGS= edit +. else readline_ARGS= port +. endif .endif +.if defined(READLINE_FLAVOR) +readline_ARGS= ${READLINE_FLAVOR} +.endif + +.if defined(readline_ARGS) && ${readline_ARGS} == edit +CPPFLAGS+= -I/usr/include/edit +LDFLAGS+= -ledit +.endif + .if defined(readline_ARGS) && ${readline_ARGS} == port LIB_DEPENDS+= libreadline.so.6:${PORTSDIR}/devel/readline CPPFLAGS+= -I${LOCALBASE}/include