From eb44444f03424eb0a1ce61320e1fd9fe88eb26e1 Mon Sep 17 00:00:00 2001 From: oetiker Date: Sun, 18 May 2008 06:37:43 +0000 Subject: [PATCH] improved handling of libintl issues git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1362 a5681a0c-68f1-0310-ab6d-d61299d08faa --- NEWS | 28 +++++++++++++++++----------- configure.ac | 24 +++++++++++++++++------- src/rrd_i18n.h | 2 +- src/rrd_tool.c | 3 ++- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/NEWS b/NEWS index c482d22..2d2abf7 100644 --- a/NEWS +++ b/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/configure.ac b/configure.ac index 913dc5a..f6e3545 100644 --- a/configure.ac +++ b/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/src/rrd_i18n.h b/src/rrd_i18n.h index db56455..aaa82ff 100644 --- a/src/rrd_i18n.h +++ b/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/src/rrd_tool.c b/src/rrd_tool.c index 56495ab..54cf12b 100644 --- a/src/rrd_tool.c +++ b/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); -- 2.30.2