diff options
author | jlam <jlam@pkgsrc.org> | 2004-03-10 17:57:14 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-03-10 17:57:14 +0000 |
commit | d0b4c54eb698e718080690cf98ab5b8bbb4001e0 (patch) | |
tree | 1226d07b8f66083168895189decc88848b70903f /devel/gettext-lib | |
parent | 9d61fef8537aed11013bf556e319b2d8e398a11b (diff) | |
download | pkgsrc-d0b4c54eb698e718080690cf98ab5b8bbb4001e0.tar.gz |
Split out the code that deals with checking whether the software is
built-in or not into a separate builtin.mk file. The code to deal
checking for built-in software is much simpler to deal with in pkgsrc.
The buildlink3.mk file for a package will be of the usual format
regardless of the package, which makes it simpler for packagers to
update a package.
The builtin.mk file for a package must define a single yes/no variable
USE_BUILTIN.<pkg> that is used by bsd.buildlink3.mk to decide whether
to use the built-in software or to use the pkgsrc software.
Diffstat (limited to 'devel/gettext-lib')
-rw-r--r-- | devel/gettext-lib/buildlink3.mk | 155 | ||||
-rw-r--r-- | devel/gettext-lib/builtin.mk | 146 |
2 files changed, 155 insertions, 146 deletions
diff --git a/devel/gettext-lib/buildlink3.mk b/devel/gettext-lib/buildlink3.mk index 9855b406820..96bf0bf2bdf 100644 --- a/devel/gettext-lib/buildlink3.mk +++ b/devel/gettext-lib/buildlink3.mk @@ -1,159 +1,22 @@ -# $NetBSD: buildlink3.mk,v 1.16 2004/02/18 16:35:27 jlam Exp $ +# $NetBSD: buildlink3.mk,v 1.17 2004/03/10 17:57:14 jlam Exp $ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ GETTEXT_BUILDLINK3_MK:= ${GETTEXT_BUILDLINK3_MK}+ -.include "../../mk/bsd.prefs.mk" - -.if !empty(GETTEXT_BUILDLINK3_MK:M+) -BUILDLINK_PACKAGES+= gettext -BUILDLINK_DEPENDS.gettext+= gettext-lib>=0.10.35nb1 -BUILDLINK_PKGSRCDIR.gettext?= ../../devel/gettext-lib -.endif # GETTEXT_BUILDLINK3_MK - -BUILDLINK_CHECK_BUILTIN.gettext?= NO - -.if !defined(BUILDLINK_IS_BUILTIN.gettext) -BUILDLINK_IS_BUILTIN.gettext= NO -. if exists(/usr/include/libintl.h) -BUILDLINK_IS_BUILTIN.gettext= YES -. if !empty(BUILDLINK_CHECK_BUILTIN.gettext:M[nN][oO]) -# -# Consider the base system libintl to be gettext-lib-0.10.35nb1. -# -_GETTEXT_PKG= gettext-lib-0.10.35nb1 -. for _depend_ in ${BUILDLINK_DEPENDS.gettext} -. if !empty(BUILDLINK_IS_BUILTIN.gettext:M[yY][eE][sS]) -BUILDLINK_IS_BUILTIN.gettext!= \ - if ${PKG_ADMIN} pmatch '${_depend_}' ${_GETTEXT_PKG}; then \ - ${ECHO} "YES"; \ - else \ - ${ECHO} "NO"; \ - fi -. endif -. endfor -. endif -. endif -. if !empty(BUILDLINK_CHECK_BUILTIN.gettext:M[nN][oO]) -# -# The listed platforms have a broken (for the purposes of pkgsrc) version -# of gettext-lib. -# -_INCOMPAT_GETTEXT= SunOS-*-* -INCOMPAT_GETTEXT?= # empty -. for _pattern_ in ${_INCOMPAT_GETTEXT} ${INCOMPAT_GETTEXT} -. if !empty(MACHINE_PLATFORM:M${_pattern_}) -BUILDLINK_IS_BUILTIN.gettext= NO -. endif -. endfor -. endif -MAKEFLAGS+= BUILDLINK_IS_BUILTIN.gettext=${BUILDLINK_IS_BUILTIN.gettext} -.endif - -.if !empty(BUILDLINK_CHECK_BUILTIN.gettext:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.gettext= YES -.endif - -.if !defined(BUILDLINK_USE_BUILTIN.gettext) -. if !empty(BUILDLINK_IS_BUILTIN.gettext:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.gettext= YES -. else -BUILDLINK_USE_BUILTIN.gettext= NO -. endif - -. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \ - !empty(BUILDLINK_IS_BUILTIN.gettext:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.gettext= YES -. endif -. if !empty(PREFER_PKGSRC:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.gettext= NO -. endif -. if !empty(PREFER_NATIVE:Mgettext) && \ - !empty(BUILDLINK_IS_BUILTIN.gettext:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.gettext= YES -. endif -. if !empty(PREFER_PKGSRC:Mgettext) -BUILDLINK_USE_BUILTIN.gettext= NO -. endif - -. if defined(USE_GNU_GETTEXT) -BUILDLINK_USE_BUILTIN.gettext= NO -. endif -.endif - -.if !empty(BUILDLINK_USE_BUILTIN.gettext:M[nN][oO]) -. if !empty(BUILDLINK_DEPTH:M+) +.if !empty(BUILDLINK_DEPTH:M+) BUILDLINK_DEPENDS+= gettext -. endif .endif +BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ngettext} +BUILDLINK_PACKAGES+= gettext + .if !empty(GETTEXT_BUILDLINK3_MK:M+) -. if !empty(BUILDLINK_USE_BUILTIN.gettext:M[nN][oO]) -_BLNK_LIBINTL= -lintl -_GETTEXT_ICONV_DEPENDS= gettext-lib>=0.11.5nb1 -. if !defined(_GETTEXT_NEEDS_ICONV) -_GETTEXT_NEEDS_ICONV?= NO -. for _depend_ in ${BUILDLINK_DEPENDS.gettext} -. if !empty(_GETTEXT_NEEDS_ICONV:M[nN][oO]) -_GETTEXT_NEEDS_ICONV!= \ - if ${PKG_INFO} -qe '${_depend_}'; then \ - pkg=`cd ${_PKG_DBDIR}; ${PKG_ADMIN} -S lsbest '${_depend_}'`; \ - if ${PKG_INFO} -qN "$$pkg" | ${GREP} -q "libiconv-[0-9]"; then \ - ${ECHO} "YES"; \ - else \ - ${ECHO} "NO"; \ - fi; \ - else \ - ${ECHO} "YES"; \ - fi -. endif -. endfor -MAKEFLAGS+= _GETTEXT_NEEDS_ICONV=${_GETTEXT_NEEDS_ICONV} -. endif -. if ${_GETTEXT_NEEDS_ICONV} == "YES" -. include "../../converters/libiconv/buildlink3.mk" -BUILDLINK_DEPENDS.gettext+= ${_GETTEXT_ICONV_DEPENDS} -_BLNK_LIBINTL+= ${BUILDLINK_LDADD.iconv} -. endif -. else -. if !defined(_BLNK_LIBINTL_FOUND) -_BLNK_LIBINTL_FOUND!= \ - if [ "`${ECHO} /usr/lib/libintl.*`" = "/usr/lib/libintl.*" ]; then \ - ${ECHO} "NO"; \ - else \ - ${ECHO} "YES"; \ - fi -MAKEFLAGS+= _BLNK_LIBINTL_FOUND=${_BLNK_LIBINTL_FOUND} -. endif -. if ${_BLNK_LIBINTL_FOUND} == "YES" -_BLNK_LIBINTL= -lintl -. else -_BLNK_LIBINTL= # empty -BUILDLINK_TRANSFORM+= l:intl: -. endif -. endif +BUILDLINK_DEPENDS.gettext+= gettext-lib>=0.10.35nb1 +BUILDLINK_PKGSRCDIR.gettext?= ../../devel/gettext-lib -BUILDLINK_LDADD.gettext?= ${_BLNK_LIBINTL} +# libiconv/buildlink3.mk is included by gettext-lib/builtin.mk +#.include "../../converters/libiconv/buildlink3.mk" -# Add -lintl to LIBS in CONFIGURE_ENV to work around broken gettext.m4: -# older gettext.m4 does not add -lintl where it should, and the resulting -# configure script fails to detect if libintl.a is the genuine GNU gettext -# or not. -# -. if defined(GNU_CONFIGURE) -LIBS+= ${BUILDLINK_LDADD.gettext} -CONFIGURE_ENV+= INTLLIBS="${BUILDLINK_LDADD.gettext}" -. if !empty(BUILDLINK_USE_BUILTIN.gettext:M[yY][eE][sS]) -. if ${_BLNK_LIBINTL_FOUND} == "YES" -CONFIGURE_ENV+= gt_cv_func_gnugettext1_libintl="yes" -. endif -. endif -. if !empty(BUILDLINK_USE_BUILTIN.gettext:M[nN][oO]) -CONFIGURE_ARGS+= --with-libintl-prefix=${BUILDLINK_PREFIX.gettext} -. else -CONFIGURE_ARGS+= --without-libintl-prefix -. endif -. endif .endif # GETTEXT_BUILDLINK3_MK BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} diff --git a/devel/gettext-lib/builtin.mk b/devel/gettext-lib/builtin.mk new file mode 100644 index 00000000000..d073634700f --- /dev/null +++ b/devel/gettext-lib/builtin.mk @@ -0,0 +1,146 @@ +# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $ + +.if !defined(_BLNK_LIBINTL_FOUND) +_BLNK_LIBINTL_FOUND!= \ + if [ "`${ECHO} /usr/lib/libintl.*`" = "/usr/lib/libintl.*" ]; then \ + ${ECHO} "no"; \ + else \ + ${ECHO} "yes"; \ + fi +MAKEFLAGS+= _BLNK_LIBINTL_FOUND=${_BLNK_LIBINTL_FOUND} +.endif + +_LIBINTL_H= /usr/include/libintl.h + +.if !defined(IS_BUILTIN.gettext) +IS_BUILTIN.gettext= no +. if !empty(_BLNK_LIBINTL_FOUND:M[yY][eE][sS]) && exists(${_LIBINTL_H}) +IS_BUILTIN.gettext!= \ + if ${GREP} -q "\#define[ ]*__USE_GNU_GETTEXT" ${_LIBINTL_H}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. if !empty(IS_BUILTIN.gettext:M[yY][eE][sS]) +# +# XXX Consider the base system libintl to be gettext-lib-0.10.35nb1. +# +BUILTIN_PKG.gettext= gettext-lib-0.10.35nb1 +MAKEFLAGS+= BUILTIN_PKG.gettext=${BUILTIN_PKG.gettext} +. endif +. endif +MAKEFLAGS+= IS_BUILTIN.gettext=${IS_BUILTIN.gettext} +.endif + +CHECK_BUILTIN.gettext?= no +.if !empty(CHECK_BUILTIN.gettext:M[yY][eE][sS]) +USE_BUILTIN.gettext= yes +.endif + +.if !defined(USE_BUILTIN.gettext) +USE_BUILTIN.gettext?= ${IS_BUILTIN.gettext} +PREFER.getext?= pkgsrc + +. if defined(BUILTIN_PKG.gettext) +USE_BUILTIN.gettext= yes +. for _depend_ in ${BUILDLINK_DEPENDS.gettext} +. if !empty(USE_BUILTIN.gettext:M[yY][eE][sS]) +USE_BUILTIN.gettext!= \ + if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.gettext}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. endif +. endfor +. endif + +. if ${PREFER.gettext} == "native" +# XXX +# XXX By default, assume that the native libintl is good enough. +# XXX +. if !empty(_BLNK_LIBINTL_FOUND:M[yY][eE][sS]) && exists(${_LIBINTL_H}) +USE_BUILTIN.gettext= yes +# +# The listed platforms have an implementation of libintl that isn't +# GNUish enough. +# +_INCOMPAT_GETTEXT= SunOS-*-* +. for _pattern_ in ${_INCOMPAT_GETTEXT} ${INCOMPAT_GETTEXT} +. if !empty(MACHINE_PLATFORM:M${_pattern_}) +USE_BUILTIN.gettext= no +. endif +. endfor +. endif +. endif + +. if defined(USE_GNU_GETTEXT) +. if !empty(IS_BUILTIN.gettext:M[nN][oO]) || \ + (${PREFER.gettext} == "pkgsrc") +USE_BUILTIN.gettext= no +. endif +. endif +.endif # USE_BUILTIN.gettext + +.if !empty(USE_BUILTIN.gettext:M[nN][oO]) +_BLNK_LIBINTL= -lintl +_GETTEXT_ICONV_DEPENDS= gettext-lib>=0.11.5nb1 +. if !defined(_GETTEXT_NEEDS_ICONV) +_GETTEXT_NEEDS_ICONV?= no +. for _depend_ in ${BUILDLINK_DEPENDS.gettext} +. if !empty(_GETTEXT_NEEDS_ICONV:M[nN][oO]) +_GETTEXT_NEEDS_ICONV!= \ + if ${PKG_INFO} -qe '${_depend_}'; then \ + pkg=`cd ${_PKG_DBDIR}; ${PKG_ADMIN} -S lsbest '${_depend_}'`; \ + if ${PKG_INFO} -qN "$$pkg" | ${GREP} -q "libiconv-[0-9]"; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi; \ + else \ + ${ECHO} "yes"; \ + fi +. endif +. endfor +. endif +. if ${_GETTEXT_NEEDS_ICONV} == "yes" +. for _mkfile_ in buildlink3.mk builtin.mk +. if exists(../../converters/libiconv/${_mkfile_}) +. include "../../converters/libiconv/${_mkfile_}" +. endif +. endfor +BUILDLINK_DEPENDS.gettext+= ${_GETTEXT_ICONV_DEPENDS} +_BLNK_LIBINTL+= ${BUILDLINK_LDADD.iconv} +. endif +.endif + +.if !empty(USE_BUILTIN.gettext:M[yY][eE][sS]) +. if ${_BLNK_LIBINTL_FOUND} == "yes" +_BLNK_LIBINTL= -lintl +. else +_BLNK_LIBINTL= # empty +BUILDLINK_TRANSFORM+= l:intl: +. endif +.endif + +BUILDLINK_LDADD.gettext?= ${_BLNK_LIBINTL} + +# Add -lintl to LIBS in CONFIGURE_ENV to work around broken gettext.m4: +# older gettext.m4 does not add -lintl where it should, and the resulting +# configure script fails to detect if libintl.a is the genuine GNU gettext +# or not. +# +.if defined(GNU_CONFIGURE) +LIBS+= ${BUILDLINK_LDADD.gettext} +CONFIGURE_ENV+= INTLLIBS="${BUILDLINK_LDADD.gettext}" +. if !empty(USE_BUILTIN.gettext:M[yY][eE][sS]) +. if ${_BLNK_LIBINTL_FOUND} == "yes" +CONFIGURE_ENV+= gt_cv_func_gnugettext1_libintl="yes" +. endif +. endif +. if !empty(USE_BUILTIN.gettext:M[nN][oO]) +CONFIGURE_ARGS+= --with-libintl-prefix=${BUILDLINK_PREFIX.gettext} +. else +CONFIGURE_ARGS+= --without-libintl-prefix +. endif +.endif |