pkgsrc/devel/readline/buildlink3.mk
joerg 2d1ba244e9 Simply and speed up buildlink3.mk files and processing.
This changes the buildlink3.mk files to use an include guard for the
recursive include. The use of BUILDLINK_DEPTH, BUILDLINK_DEPENDS,
BUILDLINK_PACKAGES and BUILDLINK_ORDER is handled by a single new
variable BUILDLINK_TREE. Each buildlink3.mk file adds a pair of
enter/exit marker, which can be used to reconstruct the tree and
to determine first level includes. Avoiding := for large variables
(BUILDLINK_ORDER) speeds up parse time as += has linear complexity.
The include guard reduces system time by avoiding reading files over and
over again. For complex packages this reduces both %user and %sys time to
half of the former time.
2009-03-20 19:23:50 +00:00

41 lines
1.3 KiB
Makefile

# $NetBSD: buildlink3.mk,v 1.31 2009/03/20 19:24:28 joerg Exp $
BUILDLINK_TREE+= readline
.if !defined(READLINE_BUILDLINK3_MK)
READLINE_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.readline+= readline>=2.2
BUILDLINK_ABI_DEPENDS.readline+= readline>=5.0
BUILDLINK_PKGSRCDIR.readline?= ../../devel/readline
BUILDLINK_FILES.readline+= include/history.h
BUILDLINK_FILES.readline+= include/readline.h
BUILDLINK_FNAME_TRANSFORM.readline+= \
-e "s|include/history\.h|include/readline/history.h|g" \
-e "s|include/readline\.h|include/readline/readline.h|g"
# Many GNU configure scripts don't check for the correct terminal library
# when testing for -lreadline. If BROKEN_READLINE_DETECTION is set to
# "yes", then automatically add the right one.
#
. include "../../mk/bsd.fast.prefs.mk"
BROKEN_READLINE_DETECTION?= no
. if !empty(BROKEN_READLINE_DETECTION:M[yY][eE][sS])
BUILDLINK_TRANSFORM+= l:readline:readline:${BUILDLINK_LIBNAME.termcap}
. endif
CHECK_BUILTIN.readline:= yes
.include "../../devel/readline/builtin.mk"
CHECK_BUILTIN.readline:= no
# A built-in readline is always going to use a built-in termcap.
.if !empty(USE_BUILTIN.readline:M[yY][eE][sS])
USE_BUILTIN.termcap= yes
.endif
.include "../../mk/termcap.buildlink3.mk"
.endif # READLINE_BUILDLINK3_MK
BUILDLINK_TREE+= -readline