From: oetiker Date: Sun, 18 May 2008 06:37:43 +0000 (+0000) Subject: improved handling of libintl issues X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3fd43e0a548e9156be6869cbec2c030909a3633f;p=rrdtool-all.git improved handling of libintl issues git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1362 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/NEWS b/program/NEWS index c482d227..2d2abf78 100644 --- a/program/NEWS +++ b/program/NEWS @@ -36,7 +36,7 @@ NEW Graphing (Tobi Oetiker) * TEXTALIGN command to alter default text alignment behaviour * C API in-memory graphing with rrd_graph_v (Evan Miller) * draw dashed lines in graphs (Thomas Gutzler) -* new interface graphv which returns inforamation useing the rrd_info +* new interface graphv which returns inforamation using the rrd_info interface (Tobi Oetiker and Mark Plaksin) NEW Forecasting (Evan Miller) @@ -45,6 +45,9 @@ NEW Forecasting (Evan Miller) method. It is a drop-in replacement for HWPREDICT, and is better suited for data whose seasonal variations grow or shrink in proportion to the average. +* If you create an RRD with the new MHWPREDICT function, the resulting + rrdfile will be version 0004 and can only be used in rrdtool 1.3. + Rewrites -------- * rrd_restore now uses libxml for parsing which makes things much more @@ -55,20 +58,23 @@ Rewrites * rrd_update rewritten to make it more modular. Fixed two longstanding HW bugs in the process (Evan Miller) +Internationalization (Takao Fujiwara and Tobi Oetiker) +-------------------- +* The help output by rrdtool has been internationalized. There are no real + translations included with rrdtool yet, contributions are welcome. +* The internationalization will only be compiled if libintl and friends are + available on your system. Use the configure option --disable-libintl if + you want to disable this feature + Misc ---- * ruby rrd_fetch will return step as a last property -- Mike Perham -Incompatibility ---------------- -* If you create an RRD with the new MHWPREDICT function, the resulting rrdfile will - be version 0004 and can only be used in rrdtool 1.3. - -Locale Independent Input ------------------------- -* Regardles of locale you are in, rrdtool always expects input to be numbers (LC_NUMERIC) - in C or POSIX locale for numbers. (not 1,1 but 1.1) this is necessary to make - things like RPN work as it uses , as a separator. +Locale Independent Numeric Input +-------------------------------- +* Regardles of locale you are in, rrdtool always expects input to be numbers + (LC_NUMERIC) in C or POSIX locale for numbers. (not 1,1 but 1.1) this is + necessary to make things like RPN work as it uses , as a separator. RRDTOOL NEWS ============ diff --git a/program/configure.ac b/program/configure.ac index 913dc5a0..f6e3545f 100644 --- a/program/configure.ac +++ b/program/configure.ac @@ -477,20 +477,27 @@ AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package]) AM_GLIB_GNU_GETTEXT() -IT_PROG_INTLTOOL([0.35.0],[no-xml]) AC_ARG_ENABLE(libintl,[ --disable-libintl i18n support (libintl)], [],[enable_libintl=yes]) if test x$enable_libintl = xyes; then + IT_PROG_INTLTOOL([0.35.0],[no-xml]) +fi + +if test x$enable_libintl = xyes -a x$MSGFMT = xno; then + AC_MSG_WARN(I could not find msgfmt. Diabeling libintl build.) + enable_libintl=no +fi +if test x$enable_libintl = xyes; then AC_CHECK_HEADERS(libintl.h,[],[AC_MSG_RESULT(disabeling libintl build); enable_libintl=no]) +fi - if test x$enable_libintl = xyes ; then -dnl it seems bsd synstems need to link against libintl -dnl when compiling rrdupdate. lets check - AC_CHECK_LIB(intl, libintl_gettext,[LIB_LIBINTL="-lintl"]) - fi +if test x$enable_libintl = xyes ; then + dnl it seems bsd synstems need to link against libintl + dnl when compiling rrdupdate. lets check + AC_CHECK_LIB(intl, libintl_gettext,[LIB_LIBINTL="-lintl"]) fi dnl use for linking rrdupdate @@ -499,6 +506,9 @@ AC_SUBST(LIB_LIBINTL) dnl do not touch the po stuff if we are not going to build intl AM_CONDITIONAL(BUILD_LIBINTL,[test x$enable_libintl = xyes]) +if test x$enable_libintl = xyes; then + AC_DEFINE([BUILD_LIBINTL], [], [Use this in code sections to mark them for libintl build]) +fi CONFIGURE_PART(IEEE Math Checks) @@ -508,7 +518,7 @@ AC_CHECK_FUNCS(fpclassify, , [AC_MSG_CHECKING(for fpclassify with ) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include volatile int x;volatile float f; ]], [[x = fpclassify(f)]])],[AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FPCLASSIFY,1)],[AC_MSG_RESULT(no)])]) + AC_DEFINE(HAVE_FPCLASSIFY)],[AC_MSG_RESULT(no)])]) AC_CHECK_FUNCS(isinf, , [AC_MSG_CHECKING(for isinf with ) diff --git a/program/src/rrd_i18n.h b/program/src/rrd_i18n.h index db564553..aaa82ff7 100644 --- a/program/src/rrd_i18n.h +++ b/program/src/rrd_i18n.h @@ -14,7 +14,7 @@ extern "C" { #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ -#ifdef HAVE_LIBINTL_H +#if defined(HAVE_LIBINTL_H) && defined(BUILD_LIBINTL) # include #define _(String) gettext (String) #else diff --git a/program/src/rrd_tool.c b/program/src/rrd_tool.c index 56495ab2..54cf12b5 100644 --- a/program/src/rrd_tool.c +++ b/program/src/rrd_tool.c @@ -387,7 +387,8 @@ int main( #ifdef HAVE_LOCALE_H setlocale(LC_ALL, ""); #endif -#ifdef HAVE_LIBINTL_H + +#if defined(HAVE_LIBINTL_H) && defined(BUILD_LIBINTL) bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE);