Browse Source

cpupower: make NLS truly optional

Loosely based on a patch for cpufrequtils, submittted by
Sergey Dryabzhinsky <sergey.dryabzhinsky@gmail.com> and

signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Dominik Brodowski 14 years ago
parent
commit
47c336307a
2 changed files with 10 additions and 0 deletions
  1. 1 0
      tools/power/cpupower/Makefile
  2. 9 0
      tools/power/cpupower/utils/helpers/helpers.h

+ 1 - 0
tools/power/cpupower/Makefile

@@ -137,6 +137,7 @@ CFLAGS +=	-pipe
 ifeq ($(strip $(NLS)),true)
 	INSTALL_NLS += install-gmo
 	COMPILE_NLS += create-gmo
+	CFLAGS += -DNLS
 endif
 
 ifeq ($(strip $(CPUFREQ_BENCH)),true)

+ 9 - 0
tools/power/cpupower/utils/helpers/helpers.h

@@ -16,11 +16,20 @@
 #include "helpers/bitmask.h"
 
 /* Internationalization ****************************/
+#ifdef NLS
+
 #define _(String) gettext(String)
 #ifndef gettext_noop
 #define gettext_noop(String) String
 #endif
 #define N_(String) gettext_noop(String)
+
+#else /* !NLS */
+
+#define _(String) String
+#define N_(String) String
+
+#endif
 /* Internationalization ****************************/
 
 extern int run_as_root;