pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk Add buildlink/builtin mechanism for devel/editline ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/9fcecf44a91f
branches: trunk
changeset: 621706:9fcecf44a91f
user: ryoon <ryoon%pkgsrc.org@localhost>
date: Mon Jul 15 01:54:25 2013 +0000
description:
Add buildlink/builtin mechanism for devel/editline and devel/readline.
With this change, .include "../../devel/readline/buildlink3.mk" with
USE_GNU_READLINE=yes should be replaced with
.include "../../devel/readline/buildlink3.mk",
and .include "../../devel/readline/buildlink3.mk" without USE_GNU_READLINE
should be replaced .include "../../mk/readline.buildlink3.mk".
USE_GNU_READLINE is removed.
diffstat:
devel/readline/builtin.mk | 34 +-----------------
mk/readline.buildlink3.mk | 84 +++++++++++++++++++++++++++++++++++++++++++++++
mk/readline.builtin.mk | 49 +++++++++++++++++++++++++++
3 files changed, 135 insertions(+), 32 deletions(-)
diffs (207 lines):
diff -r 795691ef8af4 -r 9fcecf44a91f devel/readline/builtin.mk
--- a/devel/readline/builtin.mk Mon Jul 15 01:43:55 2013 +0000
+++ b/devel/readline/builtin.mk Mon Jul 15 01:54:25 2013 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: builtin.mk,v 1.17 2008/02/29 22:41:13 jlam Exp $
+# $NetBSD: builtin.mk,v 1.18 2013/07/15 01:54:25 ryoon Exp $
BUILTIN_PKG:= readline
-BUILTIN_FIND_LIBS:= edit readline history
+BUILTIN_FIND_LIBS:= readline history
BUILTIN_FIND_FILES_VAR:= H_READLINE _BLTN_H_READLINE
BUILTIN_FIND_FILES.H_READLINE= /usr/include/readline/readline.h \
/usr/include/readline.h
@@ -66,16 +66,6 @@
. endif
. endfor
. endif
-# XXX
-# XXX By default, assume that the native editline library is good enough
-# XXX to replace GNU readline if it provides the readline-compatibility
-# XXX headers.
-# XXX
-. if !empty(BUILTIN_LIB_FOUND.readline:M[nN][oO]) && \
- !empty(BUILTIN_LIB_FOUND.edit:M[yY][eE][sS]) && \
- empty(_BLTN_H_READLINE:M__nonexistent__)
-USE_BUILTIN.readline= yes
-. endif
#
# Some platforms don't have a readline/editline implementation that can
# replace GNU readline.
@@ -90,15 +80,6 @@
.endif
MAKEVARS+= USE_BUILTIN.readline
-# If USE_GNU_READLINE is defined, then force the use of a GNU readline
-# implementation.
-#
-.if defined(USE_GNU_READLINE)
-. if !empty(IS_BUILTIN.readline:M[nN][oO])
-USE_BUILTIN.readline= no
-. endif
-.endif
-
###
### The section below only applies if we are not including this file
### solely to determine whether a built-in implementation exists.
@@ -107,18 +88,7 @@
.if !empty(CHECK_BUILTIN.readline:M[nN][oO])
. if !empty(USE_BUILTIN.readline:M[yY][eE][sS])
-. if !empty(BUILTIN_LIB_FOUND.history:M[Nn][Oo]) && \
- !empty(BUILTIN_LIB_FOUND.readline:M[Yy][Ee][Ss])
BUILDLINK_TRANSFORM+= l:history:readline:${BUILTIN_LIBNAME.termcap}
-. endif
-. if !empty(BUILTIN_LIB_FOUND.history:M[nN][oO]) && \
- !empty(BUILTIN_LIB_FOUND.edit:M[yY][eE][sS])
-BUILDLINK_TRANSFORM+= l:history:edit:${BUILTIN_LIBNAME.termcap}
-. endif
-. if !empty(BUILTIN_LIB_FOUND.readline:M[nN][oO]) && \
- !empty(BUILTIN_LIB_FOUND.edit:M[yY][eE][sS])
-BUILDLINK_TRANSFORM+= l:readline:edit:${BUILTIN_LIBNAME.termcap}
-. endif
. endif
.endif # CHECK_BUILTIN.readline
diff -r 795691ef8af4 -r 9fcecf44a91f mk/readline.buildlink3.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/readline.buildlink3.mk Mon Jul 15 01:54:25 2013 +0000
@@ -0,0 +1,84 @@
+# $NetBSD: readline.buildlink3.mk,v 1.1 2013/07/15 01:54:25 ryoon Exp $
+#
+# This Makefile fragment is meant to be included by packages that require
+# any readline implementation instead of one particular one. The available
+# readline/editline implementations are "editline" and "readline".
+#
+# If a package genuinely requires editline or readline, then it should
+# directly include the appropriate buildlink3.mk instead of this file in
+# the package Makefile.
+#
+# === User-settable variables ===
+#
+# READLINE_DEFAULT
+# This value represents the type of readline we wish to use on the
+# system. Setting this to "editline" means that the system libedit
+# implementation is fine or pkgsrc "editline" should be used.
+#
+# Possible: editline readline
+# Default: (depends)
+#
+# === Variables set by this file ===
+#
+# READLINE_TYPE
+# The name of the selected readline implementation, editline or
+# readline.
+
+EDITLINEREADLINE_BUILDLINK3_MK:= ${EDITLINEREADLINE_BUILDLINK3_MK}+
+.include "bsd.fast.prefs.mk"
+
+.if !empty(EDITLINEREADLINE_BUILDLINK3_MK:M+)
+
+# _READLINE_PKGS is an exhaustive list of all of the readline implementations
+# that may be used with readline.buildlink3.mk.
+#
+_READLINE_PKGS?= editline readline
+
+CHECK_BUILTIN.editlinereadline:= yes
+.include "readline.builtin.mk"
+CHECK_BUILTIN.editlinereadline:= no
+
+# Set the value of READLINE_DEFAULT depending on the platform and what's
+# available in the base system.
+#
+READLINE_DEFAULT?= editline
+
+_READLINE_ACCEPTED= # empty
+.if defined(USE_BUILTIN.editlinereadline) && \
+ !empty(USE_BUILTIN.editlinereadline:M[yY][eE][sS])
+_READLINE_ACCEPTED+= editline # system editline exists or pkgsrc editline
+.endif
+_READLINE_ACCEPTED+= readline # pkgsrc readline
+
+_READLINE_TYPE= ${READLINE_DEFAULT}
+. if !empty(_READLINE_ACCEPTED:M${_READLINE_TYPE})
+READLINE_TYPE= ${_READLINE_TYPE}
+. else
+READLINE_TYPE= none
+. endif
+
+BUILD_DEFS+= READLINE_DEFAULT
+BUILD_DEFS_EFFECTS+= READLINE_TYPE
+
+# _PKG_USE_READLINE is a flag for use by the readline packages' buildlink3.mk
+# files to indicate that the headers and libraries should be usable as
+# <readline.h> etc. and -lreadline etc.
+#
+_PKG_USE_READLINE= yes
+
+.endif # EDITLINEREADLINE_BUILDLINK3_MK
+
+.if ${READLINE_TYPE} == "none"
+PKG_FAIL_REASON= \
+ "${_READLINE_TYPE} is not an acceptable readline type for ${PKGNAME}."
+.elif ${READLINE_TYPE} == "editline"
+. include "../../devel/editline/buildlink3.mk"
+BUILDLINK_PREFIX.editlinereadline?= ${BUILDLINK_PREFIX.editline}
+BUILDLINK_LIBNAME.editlinereadline?= ${BUILDLINK_LIBNAME.editline}
+BUILDLINK_LDADD.editlinereadline?= ${BUILDLINK_LDADD.editline}
+.elif ${READLINE_TYPE} == "readline"
+. include "../../devel/readline/buildlink3.mk"
+BUILDLINK_PREFIX.editlinereadline?= ${BUILDLINK_PREFIX.readline}
+BUILDLINK_LIBNAME.editlinereadline?= ${BUILDLINK_LIBNAME.readline}
+BUILDLINK_LDADD.editlinereadline?= ${BUILDLINK_LDADD.readline}
+.endif
diff -r 795691ef8af4 -r 9fcecf44a91f mk/readline.builtin.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/readline.builtin.mk Mon Jul 15 01:54:25 2013 +0000
@@ -0,0 +1,49 @@
+# $NetBSD: readline.builtin.mk,v 1.1 2013/07/15 01:54:25 ryoon Exp $
+#
+
+BUILTIN_PKG:= editlinereadline
+
+BUILTIN_FIND_LIBS:= edit readline history
+BUILTIN_FIND_FILES_VAR:= H_READLINE _BLTN_H_READLINE
+BUILTIN_FIND_FILES.H_READLINE= /usr/include/readline/readline.h \
+ /usr/include/readline.h
+BUILTIN_FIND_FILES._BLTN_H_READLINE= \
+ /usr/include/readline/readline.h \
+ /usr/include/readline.h
+BUILTIN_FIND_GREP.H_READLINE= \#define[ ]*RL_VERSION_MAJOR
+
+.include "../../mk/buildlink3/bsd.builtin.mk"
+
+.if !defined(IS_BUILTIN.editlinereadline)
+IS_BUILTIN.readline= no
+. if empty(H_READLINE:M__nonexistent__) && \
+ empty(H_READLINE:M${LOCALBASE}/*) && \
+ !empty(BUILTIN_LIB_FOUND.readline:M[yY][eE][sS])
+IS_BUILTIN.editlinereadline= yes
+. else if empty(_BLTN_H_READLINE:M__nonexistent__) && \
+ !empty(BUILTIN_LIB_FOUND.readline:M[nN][oO]) && \
+ !empty(BUILTIN_LIB_FOUND.edit:M[yY][eE][sS])
+IS_BUILTIN.editlinereadline= yes
+. endif
+.endif
+
+.if !defined(USE_BUILTIN.editlinereadline)
+. if ${PREFER.editlinereadline} == "pkgsrc"
+USE_BUILTIN.editlinereadline= no
+. else
+USE_BUILTIN.editlinereadline= ${IS_BUILTIN.editlinereadline}
+. endif
+.endif
+
+CHECK_BUILTIN.editlinereadline= no
+.if empty(CHECK_BUILTIN.editlinereadline:M[Nn][Oo])
+. if !empty(USE_BUILTIN.editlinereadline:M[Yy][Ee][Ss])
+. if !empty(_READLINE_TYPE:Meditline)
+. include "../../devel/editline/builtin.mk"
+IS_BUILTIN.editlinereadline= ${USE_BUILTIN.editline}
+. else if !empty(_READLINE_TYPE:Mreadline)
+. include "../../devel/readline/builtin.mk"
+IS_BUILTIN.editlinereadline= ${USE_BUILTIN.readline}
+. endif
+. endif
+.endif
Home |
Main Index |
Thread Index |
Old Index