summaryrefslogtreecommitdiffstats
path: root/extra/cpufrequtils/cpufrequtils-005-nls.patch
blob: 7a0336fff4cf2e31109794ebf8058ae6ab9359f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
make nls/gettext support optional

patch by Jos van der Ende <seraph@xs4all.nl>

http://bugs.gentoo.org/205576

--- cpufrequtils-005/Makefile
+++ cpufrequtils-005/Makefile
@@ -141,6 +141,7 @@
 ifeq ($(strip $(NLS)),true)
 	INSTALL_NLS += install-gmo
 	COMPILE_NLS += update-gmo
+	CFLAGDEF += -DNLS
 endif
 
 
--- cpufrequtils-005/utils/info.c
+++ cpufrequtils-005/utils/info.c
@@ -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
 
--- cpufrequtils-005/utils/set.c
+++ cpufrequtils-005/utils/set.c
@@ -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