2d1ba244e9
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.
41 lines
1.3 KiB
Makefile
41 lines
1.3 KiB
Makefile
# $NetBSD: buildlink3.mk,v 1.31 2009/03/20 19:24:13 joerg Exp $
|
|
|
|
BUILDLINK_TREE+= gettext
|
|
|
|
.if !defined(GETTEXT_BUILDLINK3_MK)
|
|
GETTEXT_BUILDLINK3_MK:=
|
|
|
|
BUILDLINK_API_DEPENDS.gettext+= gettext-lib>=0.14.5
|
|
BUILDLINK_PKGSRCDIR.gettext?= ../../devel/gettext-lib
|
|
BUILDLINK_LIBNAME.gettext= intl
|
|
BUILDLINK_LDADD.gettext= ${BUILDLINK_LIBNAME.gettext:S/^/-l/:S/^-l$//}
|
|
BUILDLINK_LDADD.gettext+= ${BUILDLINK_LDADD.iconv}
|
|
|
|
.include "../../mk/bsd.fast.prefs.mk"
|
|
|
|
# Some GNU configure scripts generated with an older and broken gettext.m4
|
|
# fail to detect if gettext is present or not because it fails to add
|
|
# "-lintl" to the linker command line.
|
|
#
|
|
# If BROKEN_GETTEXT_DETECTION is "yes", then automatically add "-lintl"
|
|
# to LIBS to workaround this brokenness.
|
|
#
|
|
BROKEN_GETTEXT_DETECTION?= no
|
|
. if !empty(BROKEN_GETTEXT_DETECTION:M[yY][eE][sS])
|
|
BUILDLINK_LIBS.gettext+= ${BUILDLINK_LDADD.gettext}
|
|
CONFIGURE_ENV+= INTLLIBS="${BUILDLINK_LDADD.gettext}"
|
|
. endif
|
|
|
|
CHECK_BUILTIN.gettext:= yes
|
|
.include "../../devel/gettext-lib/builtin.mk"
|
|
CHECK_BUILTIN.gettext:= no
|
|
|
|
# A built-in gettext is always going to use a built-in iconv.
|
|
.if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
|
|
USE_BUILTIN.iconv= yes
|
|
.endif
|
|
|
|
.include "../../converters/libiconv/buildlink3.mk"
|
|
.endif # GETTEXT_BUILDLINK3_MK
|
|
|
|
BUILDLINK_TREE+= -gettext
|