1
diff -Naru gcc-linaro-4.7-2012.04/gcc/gcc.c gcc-linaro-4.7-2012.04-updated/gcc/gcc.c
2
--- gcc-linaro-4.7-2012.04/gcc/gcc.c 2012-04-10 17:54:47.000000000 +0800
3
+++ gcc-linaro-4.7-2012.04-updated/gcc/gcc.c 2012-04-17 10:09:17.261047794 +0800
5
/* Unlock the stdio streams. */
9
+ gcc_init_libintl_program (argv[0]);
11
diagnostic_initialize (global_dc, 0);
12
if (atexit (delete_temp_files) != 0)
13
diff -Naru gcc-linaro-4.7-2012.04/gcc/intl.c gcc-linaro-4.7-2012.04-updated/gcc/intl.c
14
--- gcc-linaro-4.7-2012.04/gcc/intl.c 2012-04-10 17:54:47.000000000 +0800
15
+++ gcc-linaro-4.7-2012.04-updated/gcc/intl.c 2012-04-17 10:41:40.129785979 +0800
18
gcc_init_libintl (void)
20
+ gcc_init_libintl_program("gcc");
23
+#define LIBINTL_RELATIVE_DIR "../share/locale"
26
+gcc_init_libintl_program (const char * program_name)
28
#ifdef HAVE_LC_MESSAGES
29
setlocale (LC_CTYPE, "");
30
setlocale (LC_MESSAGES, "");
32
setlocale (LC_ALL, "");
35
- (void) bindtextdomain ("gcc", LOCALEDIR);
36
+ if (!access (LOCALEDIR, X_OK))
38
+ /* If LOCALEDIR exists, use LOCALEDIR. */
39
+ (void) bindtextdomain ("gcc", LOCALEDIR);
43
+ /* Try relative dir, i.e. .../bin/../share/locale. */
45
+ char *prefix_dir, *locale_dir;
46
+ prefix_dir = make_relative_prefix(program_name,".",".");
47
+ len1 = strlen (prefix_dir);
48
+ len2 = strlen (LIBINTL_RELATIVE_DIR);
49
+ locale_dir = xmalloc (len1 + len2 + 1);
50
+ if (locale_dir != NULL)
52
+ strcpy (locale_dir, prefix_dir);
53
+ strcpy (locale_dir + len1, LIBINTL_RELATIVE_DIR);
54
+ (void) bindtextdomain ("gcc", locale_dir);
57
+ (void) bindtextdomain ("gcc", LOCALEDIR);
62
(void) textdomain ("gcc");
64
/* Opening quotation mark. */
65
diff -Naru gcc-linaro-4.7-2012.04/gcc/intl.h gcc-linaro-4.7-2012.04-updated/gcc/intl.h
66
--- gcc-linaro-4.7-2012.04/gcc/intl.h 2012-04-10 17:54:47.000000000 +0800
67
+++ gcc-linaro-4.7-2012.04-updated/gcc/intl.h 2012-04-17 10:09:17.261047794 +0800
71
extern void gcc_init_libintl (void);
72
+extern void gcc_init_libintl_program (const char *);
73
extern size_t gcc_gettext_width (const char *);