summaryrefslogtreecommitdiff
path: root/devel/readline
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-01-03 23:06:43 +0000
committerjlam <jlam@pkgsrc.org>2004-01-03 23:06:43 +0000
commit978d1b1f63e52f44789818d9ee110342d88579a3 (patch)
tree7815453a8a5d5cc91288c15c8c52893726b1e2bc /devel/readline
parent3018d0705370c673d17797f0844b1c9941458717 (diff)
downloadpkgsrc-978d1b1f63e52f44789818d9ee110342d88579a3.tar.gz
Initial sprinkling of work-in-progress buildlink3.mk files for using the
buildlink3 framework.
Diffstat (limited to 'devel/readline')
-rw-r--r--devel/readline/buildlink3.mk88
1 files changed, 88 insertions, 0 deletions
diff --git a/devel/readline/buildlink3.mk b/devel/readline/buildlink3.mk
new file mode 100644
index 00000000000..9a8b28c10bd
--- /dev/null
+++ b/devel/readline/buildlink3.mk
@@ -0,0 +1,88 @@
+# $NetBSD: buildlink3.mk,v 1.1 2004/01/03 23:06:44 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.
+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
+READLINE_BUILDLINK3_MK:= ${READLINE_BUILDLINK3_MK}+
+
+.if !empty(READLINE_BUILDLINK3_MK:M\+)
+. include "../../mk/bsd.prefs.mk"
+BUILDLINK_PACKAGES+= readline
+BUILDLINK_DEPENDS.readline?= readline>=2.2
+BUILDLINK_PKGSRCDIR.readline?= ../../devel/readline
+.endif # READLINE_BUILDLINK3_MK
+
+BUILDLINK_CHECK_BUILTIN.readline?= NO
+
+.if !defined(BUILDLINK_IS_BUILTIN.readline)
+BUILDLINK_IS_BUILTIN.readline= NO
+. if exists(/usr/include/readline.h) || \
+ exists(/usr/include/readline/readline.h)
+BUILDLINK_IS_BUILTIN.readline= YES
+. endif
+.endif
+
+.if defined(USE_GNU_READLINE)
+BUILDLINK_USE_BUILTIN.readline= NO
+.endif
+
+.if !empty(BUILDLINK_CHECK_BUILTIN.readline:M[yY][eE][sS])
+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
+#
+# 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-*-*
+INCOMPAT_READLINE?= # empty
+. for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+BUILDLINK_USE_BUILTIN.readline= NO
+. endif
+. endfor
+. endif
+MAKEFLAGS+= \
+ BUILDLINK_USE_BUILTIN.readline="${BUILDLINK_USE_BUILTIN.readline}"
+.endif
+
+.if ${BUILDLINK_USE_BUILTIN.readline} == "NO"
+. if !empty(BUILDLINK_DEPTH:M\+)
+BUILDLINK_DEPENDS+= readline
+. endif
+.endif
+
+.if !empty(READLINE_BUILDLINK3_MK:M\+)
+. if ${BUILDLINK_USE_BUILTIN.readline} == "YES"
+BUILDLINK_PREFIX.readline= /usr
+. 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"
+BUILDLINK_TRANSFORM+= l:history:edit
+BUILDLINK_TRANSFORM+= l:readline:edit:termcap
+. endif
+. endif
+
+BUILDLINK_FILES.readline= include/history.h
+BUILDLINK_FILES.readline+= include/readline.h
+BUILDLINK_TRANSFORM.readline= \
+ -e "s|include/history.h|include/readline/history.h|g" \
+ -e "s|include/readline.h|include/readline/readline.h|g"
+.endif # READLINE_BUILDLINK3_MK
+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:C/\+$//}