Skip to contentSkip to conversation

cpufrequtils: make NLS optional

PATCH Applied Matt Turner 2 participants 2 messages Aug 14, 2011 – Aug 15, 2011 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufrequtils: make NLS optional

From: Sergey Dryabzhinsky <[email protected]>

https://bugs.gentoo.org/205576

---
 Makefile     |    1 +
 utils/info.c |   10 +++++++++-
 utils/set.c  |   10 +++++++++-
 3 files changed, 19 insertions(+), 2 deletions(-)
Makefile +1 -0
index ed6bdde..84f265d 100644
@@ -121,6 +121,7 @@ CFLAGS +=	-pipe
 ifeq ($(strip $(NLS)),true)
 	INSTALL_NLS += install-gmo
 	COMPILE_NLS += update-gmo
+	CPPFLAGS += -DNLS
 endif
 
 ifeq ($(strip $(CPUFRQ_BENCH)),true)
utils/info.c +9 -1
index 38d906a..155e604 100644
@@ -10,7 +10,6 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
-#include <libintl.h>
 #include <locale.h>
 
 #include <getopt.h>
@@ -18,9 +17,18 @@
 #include "cpufreq.h"
 
 
+#ifdef NLS
+#include <libintl.h>
 #define _(String) gettext (String)
 #define gettext_noop(String) String
 #define N_(String) gettext_noop (String)
+#else
+#define gettext_noop(String) String
+#define _(String) gettext_noop (String)
+#define gettext(String) gettext_noop (String)
+#define N_(String) gettext_noop (String)
+#define textdomain(String)
+#endif
 
 #define LINE_LEN 10
 
utils/set.c +9 -1
index 2ece47e..bfca465 100644
@@ -12,16 +12,24 @@
 #include <limits.h>
 #include <string.h>
 #include <ctype.h>
-#include <libintl.h>
 #include <locale.h>
 
 #include <getopt.h>
 
 #include "cpufreq.h"
 
+#ifdef NLS
+#include <libintl.h>
 #define _(String) gettext(String)
 #define gettext_noop(String) String
 #define N_(String) gettext_noop(String)
+#else
+#define gettext_noop(String) String
+#define _(String) gettext_noop (String)
+#define gettext(String) gettext_noop (String)
+#define N_(String) gettext_noop (String)
+#define textdomain(String)
+#endif
 
 #define NORM_FREQ_LEN 32
 
Signature · 1 line
1.7.3.4