pkgsrc/devel/gettext-lib/builtin.mk
adam 55f7376043 Changes 0.18.1:
* msggrep: A '$' anchor in a regular expression now also matches the end of
  the string, even if it does not end in a newline.
* Dependencies:
  The libraries and programs are now linked with libunistring if this library
  is already installed.
* Installation options:
  The configure option --with-cvs is deprecated. The 'autopoint' program will
  now use the 'git' program by default to compress its archive. If the
  configure option --without-git is specified, 'autopoint' will not rely on
  'git', but will instead rely on a locally installed a 3 MB large archive.

Changes 0.18:
* Runtime behaviour:
  - On MacOS X and Windows systems, <libintl.h> now extends setlocale() and
    newlocale() so that their determination of the default locale considers
    the choice the user has made in the system control panels.
  - On MacOS X systems, the gettext()/dgettext()/... functions now respect the
    locale of the current thread, if a thread-specific locale has been set.
* PO file format:
  There is a new field 'Language' in the header entry.  It denotes the language
  code (plus optional country code) for the PO file.  This field can be used
  by automated tools, such as spell checkers.  It is expected to be more
  reliable than looking at the file name or at the 'Language-Team' field in
  the header entry.
  msgmerge, msgcat, msgen have a new option --lang that allows to specify
  this field.  Additionally, msgmerge fills in this new field by looking at
  the 'Language-Team' field (if the --lang option is not given).
* xgettext and PO file format:
  For messages with plural forms, programmers can inform the translators
  about the range of possible values of the numeric argument, like this:
    /* xgettext: range: 0..15 */
  This information 'range: 0..15' is stored in the PO file as a flag attached
  to the message.  Translators can produce better translations when they know
  that the numeric argument is small.
* Colorized PO files:
  msgattrib, msgcomm, msgconv, msgen, msgfilter, msggrep, msginit, msgmerge,
  msgunfmt, msguniq, xgettext now have options --color and --style, like msgcat
  has since version 0.17.
* msgmerge is up to 10 times faster when the PO and POT files are large.
  This speedup was contributed by Ralf Wildenhues.
* msgcmp has a new option -N/--no-fuzzy-matching, like msgmerge has since
  version 0.12.
* msgfilter now sets environment variables during the invocation of the
  filter, indicating the msgid and location of the messge being processed.
* xgettext now can extract plural forms from Qt 4 programs. The recommended
  xgettext command-line options for this case are:
    --qt --keyword=tr:1,1t --keyword=tr:1,2c,2t --keyword=tr:1,1,2c,3t
* xgettext --language=GCC-source now recognizes also the format strings
  used in the Fortran front-end of the GCC compiler, and marks them as
  'gfc-internal-format'.
* autopoint can now be used to update several PO directories all together.
2011-04-12 17:41:28 +00:00

128 lines
4 KiB
Makefile

# $NetBSD: builtin.mk,v 1.41 2011/04/12 17:41:28 adam Exp $
.include "../../mk/bsd.fast.prefs.mk"
BUILTIN_PKG:= gettext
BUILTIN_FIND_LIBS:= intl
BUILTIN_FIND_FILES_VAR:= H_GETTEXT H_GENTOO_GETTEXT \
H_NGETTEXT_GETTEXT
BUILTIN_FIND_FILES.H_GETTEXT= /usr/include/libintl.h
BUILTIN_FIND_GREP.H_GETTEXT= \#define[ ]*__USE_GNU_GETTEXT
BUILTIN_FIND_FILES.H_GENTOO_GETTEXT= /usr/include/libintl.h
BUILTIN_FIND_GREP.H_GENTOO_GETTEXT= gentoo-multilib/.*/libintl.h
BUILTIN_FIND_FILES.H_NGETTEXT_GETTEXT= /usr/include/libintl.h
BUILTIN_FIND_GREP.H_NGETTEXT_GETTEXT= char.*ngettext
.include "../../mk/buildlink3/bsd.builtin.mk"
###
### Determine if there is a built-in implementation of the package and
### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
###
#
# Gentoo Linux has an unusual scheme where /usr/include/libintl.h
# pulls in gentoo-multilib/$ARCH/libintl.h, where the latter is the
# real libintl.h file. We can safely assume that this is GNU gettext
# (in glibc).
#
.if !defined(IS_BUILTIN.gettext)
IS_BUILTIN.gettext= no
. if (empty(H_GETTEXT:M__nonexistent__) && \
empty(H_GETTEXT:M${LOCALBASE}/*)) || \
(empty(H_GENTOO_GETTEXT:M__nonexistent__) && \
empty(H_GENTOO_GETTEXT:M${LOCALBASE}/*))
IS_BUILTIN.gettext= yes
. endif
.endif
MAKEVARS+= IS_BUILTIN.gettext
###
### Determine whether we should use the built-in implementation if it
### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
###
.if !defined(USE_BUILTIN.gettext)
. if ${PREFER.gettext} == "pkgsrc"
USE_BUILTIN.gettext= no
. else
USE_BUILTIN.gettext= ${IS_BUILTIN.gettext}
. if defined(BUILTIN_PKG.gettext) && \
!empty(IS_BUILTIN.gettext:M[yY][eE][sS])
USE_BUILTIN.gettext= yes
. for _dep_ in ${BUILDLINK_API_DEPENDS.gettext}
. if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
USE_BUILTIN.gettext!= \
if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.gettext:Q}; then \
${ECHO} yes; \
else \
${ECHO} no; \
fi
. endif
. endfor
. endif
# XXX
# XXX By default, assume that the native gettext implementation is good
# XXX enough to replace GNU gettext if it supplies ngettext().
# XXX
. if empty(H_NGETTEXT_GETTEXT:M__nonexistent__) && \
empty(H_NGETTEXT_GETTEXT:M${LOCALBASE}/*)
USE_BUILTIN.gettext= yes
. endif
#
# Some platforms don't have a gettext implementation that can replace
# GNU gettext.
#
_INCOMPAT_GETTEXT?= SunOS-*-* # XXX move to mk/platforms/SunOS.mk
. for _pattern_ in ${_INCOMPAT_GETTEXT} ${INCOMPAT_GETTEXT}
. if !empty(MACHINE_PLATFORM:M${_pattern_})
USE_BUILTIN.gettext= no
. endif
. endfor
. endif # PREFER.gettext
.endif
MAKEVARS+= USE_BUILTIN.gettext
# Define BUILTIN_LIBNAME.gettext to be the base name of the built-in
# gettext library.
#
.if !empty(BUILTIN_LIB_FOUND.intl:M[yY][eE][sS])
BUILTIN_LIBNAME.gettext= intl
.else
BUILTIN_LIBNAME.gettext= # empty (part of the C library)
.endif
###
### The section below only applies if we are not including this file
### solely to determine whether a built-in implementation exists.
###
CHECK_BUILTIN.gettext?= no
.if !empty(CHECK_BUILTIN.gettext:M[nN][oO])
. if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
BUILDLINK_LIBNAME.gettext= ${BUILTIN_LIBNAME.gettext}
. if empty(BUILTIN_LIBNAME.gettext)
BUILDLINK_TRANSFORM+= rm:-lintl
. endif
. endif
# If using a built-in libintl that isn't from GNU gettext, then set up
# some GNU configure variables that are checked by modern gettext.m4
# so that it will detect "GNU gettext" in the existing libintl.
#
. if defined(GNU_CONFIGURE)
. if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
. if !empty(BUILTIN_LIB_FOUND.intl:M[yY][eE][sS])
CONFIGURE_ENV+= gt_cv_func_gnugettext_libintl="yes"
CONFIGURE_ENV+= gt_cv_func_gnugettext1_libintl="yes"
. if empty(H_NGETTEXT_GETTEXT:M__nonexistent__) && \
empty(H_NGETTEXT_GETTEXT:M${LOCALBASE}/*)
CONFIGURE_ENV+= gt_cv_func_gnugettext2_libintl="yes"
. endif
. endif
. endif
. if !empty(USE_BUILTIN.gettext:M[nN][oO])
CONFIGURE_ARGS+= --with-libintl-prefix="${BUILDLINK_PREFIX.gettext}"
. endif
. endif
.endif # CHECK_BUILTIN.gettext