From 30d6303abff107ea0661af8cf2ae4e0abad8d73e Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Thu, 8 Dec 2011 14:15:06 +0530 Subject: [PATCH] build-sys: Fix building without NLS --- configure.ac | 2 ++ src/pulsecore/i18n.c | 3 ++- src/pulsecore/i18n.h | 4 ++-- src/pulsecore/proplist-util.c | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index e3ce9874..fbc7276a 100644 --- a/configure.ac +++ b/configure.ac @@ -95,6 +95,7 @@ PKG_PROG_PKG_CONFIG # gettext +if test "x$enable_nls" != "xno"; then IT_PROG_INTLTOOL([0.35.0]) GETTEXT_PACKAGE=pulseaudio AC_SUBST([GETTEXT_PACKAGE]) @@ -103,6 +104,7 @@ AM_GLIB_GNU_GETTEXT pulselocaledir='${prefix}/${DATADIRNAME}/locale' AX_DEFINE_DIR(PULSE_LOCALEDIR, pulselocaledir, [Gettext locale dir]) +fi #### Determine host OS #### diff --git a/src/pulsecore/i18n.c b/src/pulsecore/i18n.c index 7f25b20d..b4f0a666 100644 --- a/src/pulsecore/i18n.c +++ b/src/pulsecore/i18n.c @@ -28,11 +28,12 @@ #include "i18n.h" void pa_init_i18n(void) { - +#ifdef ENABLE_NLS PA_ONCE_BEGIN { bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); } PA_ONCE_END; +#endif } diff --git a/src/pulsecore/i18n.h b/src/pulsecore/i18n.h index d828becd..b206867e 100644 --- a/src/pulsecore/i18n.h +++ b/src/pulsecore/i18n.h @@ -26,12 +26,12 @@ PA_C_DECL_BEGIN +#ifdef ENABLE_NLS + #if !defined(GETTEXT_PACKAGE) #error "Something is very wrong here, config.h needs to be included first" #endif -#ifdef ENABLE_NLS - #include #define _(String) dgettext(GETTEXT_PACKAGE, String) diff --git a/src/pulsecore/proplist-util.c b/src/pulsecore/proplist-util.c index bec857a4..f4474310 100644 --- a/src/pulsecore/proplist-util.c +++ b/src/pulsecore/proplist-util.c @@ -25,7 +25,10 @@ #include #include + +#ifdef ENABLE_NLS #include +#endif #ifdef __APPLE__ #include -- 2.39.2