* RFA: fix locale configure checks
@ 2008-08-21 20:45 Tom Tromey
2008-11-25 23:12 ` Tom Tromey
0 siblings, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2008-08-21 20:45 UTC (permalink / raw)
To: gdb-patches
Today while exploring the charset code I happened to notice that gdb
never calls setlocale.
The code is there, but configure never does the checks that might
define HAVE_LOCALE_H, HAVE_SETLOCALE, or HAVE_LC_MESSAGES.
This patch fixes the problem. I just copied what GCC does here.
Built & regtested on x86-64. I also examined the config.h on my x86
box by hand.
Ok?
Tom
:ADDPATCH build:
2008-08-21 Tom Tromey <tromey@redhat.com>
* config.in, configure: Rebuild.
* configure.ac: Check for locale.h, setlocale. Call
AM_LC_MESSAGES.
* acinclude.m4: Include lcmessage.m4.
diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index 4e8f590..2a951e2 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -26,6 +26,9 @@ sinclude(../config/tcl.m4)
dnl For dependency tracking macros.
sinclude([../config/depstand.m4])
+dnl For AM_LC_MESSAGES
+sinclude([../config/lcmessage.m4])
+
#
# Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This
# makes configure think it's cross compiling. If --target wasn't used, then
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 680fba0..2d2c955 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -647,6 +647,7 @@ AC_CHECK_HEADERS(link.h, [], [],
# include <nlist.h>
#endif
])
+AC_CHECK_HEADERS(locale.h)
AC_CHECK_HEADERS(machine/reg.h)
AC_CHECK_HEADERS(poll.h sys/poll.h)
AC_CHECK_HEADERS(proc_service.h thread_db.h gnu/libc-version.h)
@@ -713,6 +714,7 @@ AC_CHECK_HEADERS(ctype.h time.h)
AC_CHECK_DECLS([free, malloc, realloc])
AC_CHECK_DECLS([strerror, strstr])
AC_CHECK_DECLS([getopt, snprintf, vsnprintf])
+AM_LC_MESSAGES
# ----------------------- #
# Checks for structures. #
@@ -753,6 +755,7 @@ AC_CHECK_FUNCS(poll)
AC_CHECK_FUNCS(pread64)
AC_CHECK_FUNCS(sbrk)
AC_CHECK_FUNCS(setpgid setpgrp setsid)
+AC_CHECK_FUNCS(setlocale)
AC_CHECK_FUNCS(sigaction sigprocmask sigsetmask)
AC_CHECK_FUNCS(socketpair)
AC_CHECK_FUNCS(syscall)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFA: fix locale configure checks
2008-08-21 20:45 RFA: fix locale configure checks Tom Tromey
@ 2008-11-25 23:12 ` Tom Tromey
2008-11-26 3:04 ` Thiago Jung Bauermann
2008-12-09 11:05 ` Joel Brobecker
0 siblings, 2 replies; 6+ messages in thread
From: Tom Tromey @ 2008-11-25 23:12 UTC (permalink / raw)
To: gdb-patches
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Tom> Today while exploring the charset code I happened to notice that gdb
Tom> never calls setlocale.
Tom> The code is there, but configure never does the checks that might
Tom> define HAVE_LOCALE_H, HAVE_SETLOCALE, or HAVE_LC_MESSAGES.
Tom> This patch fixes the problem. I just copied what GCC does here.
I've updated this patch to account for recent changes to configure.ac.
I am re-regtesting it, but I don't anticipate any problems.
Ok if it passes?
Tom
2008-11-25 Tom Tromey <tromey@redhat.com>
* config.in, configure: Rebuild.
* configure.ac: Check for locale.h, setlocale. Call
AM_LC_MESSAGES.
* acinclude.m4: Include lcmessage.m4.
diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index 4e8f590..2a951e2 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -26,6 +26,9 @@ sinclude(../config/tcl.m4)
dnl For dependency tracking macros.
sinclude([../config/depstand.m4])
+dnl For AM_LC_MESSAGES
+sinclude([../config/lcmessage.m4])
+
#
# Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This
# makes configure think it's cross compiling. If --target wasn't used, then
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 8725aa6..4e0cf7d 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -696,7 +696,7 @@ AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \
sys/reg.h sys/debugreg.h sys/select.h sys/syscall.h \
sys/types.h sys/wait.h wait.h termios.h termio.h \
- sgtty.h unistd.h elf_hp.h ctype.h time.h])
+ sgtty.h unistd.h elf_hp.h ctype.h time.h locale.h])
AC_CHECK_HEADERS(link.h, [], [],
[#if HAVE_SYS_TYPES_H
# include <sys/types.h>
@@ -740,6 +740,7 @@ AC_CHECK_HEADERS(term.h, [], [],
AC_CHECK_DECLS([free, malloc, realloc, strerror, strstr, getopt,
snprintf, vsnprintf])
+AM_LC_MESSAGES
# ----------------------- #
# Checks for structures. #
@@ -775,7 +776,7 @@ AC_FUNC_VFORK
AC_CHECK_FUNCS([canonicalize_file_name realpath getrusage getuid \
getgid poll pread64 sbrk setpgid setpgrp setsid \
sigaction sigprocmask sigsetmask socketpair syscall \
- ttrace wborder])
+ ttrace wborder setlocale])
# Check the return and argument types of ptrace. No canned test for
# this, so roll our own.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: RFA: fix locale configure checks
2008-11-25 23:12 ` Tom Tromey
@ 2008-11-26 3:04 ` Thiago Jung Bauermann
2008-11-26 10:01 ` Tom Tromey
2008-12-09 11:05 ` Joel Brobecker
1 sibling, 1 reply; 6+ messages in thread
From: Thiago Jung Bauermann @ 2008-11-26 3:04 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
El mar, 25-11-2008 a las 10:22 -0700, Tom Tromey escribió:
> >>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
> Tom> Today while exploring the charset code I happened to notice that gdb
> Tom> never calls setlocale.
>
> Tom> The code is there, but configure never does the checks that might
> Tom> define HAVE_LOCALE_H, HAVE_SETLOCALE, or HAVE_LC_MESSAGES.
I just noticed that GDB sets LC_MESSAGES and LC_CTYPE. Do you or anybody
know if there a reason that it doesn't set LC_ALL instead?
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFA: fix locale configure checks
2008-11-26 3:04 ` Thiago Jung Bauermann
@ 2008-11-26 10:01 ` Tom Tromey
0 siblings, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2008-11-26 10:01 UTC (permalink / raw)
To: Thiago Jung Bauermann; +Cc: gdb-patches
>>>>> "Thiago" == Thiago Jung Bauermann <bauerman@br.ibm.com> writes:
Thiago> I just noticed that GDB sets LC_MESSAGES and LC_CTYPE. Do you or anybody
Thiago> know if there a reason that it doesn't set LC_ALL instead?
cvs annotate claims I checked in this code in 2002. Funny.
I can't find the original note. I don't know why it works this way;
it might just be boilerplate from when I gettextized a number of
programs.
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFA: fix locale configure checks
2008-11-25 23:12 ` Tom Tromey
2008-11-26 3:04 ` Thiago Jung Bauermann
@ 2008-12-09 11:05 ` Joel Brobecker
2008-12-09 17:20 ` Tom Tromey
1 sibling, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2008-12-09 11:05 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
> 2008-11-25 Tom Tromey <tromey@redhat.com>
>
> * config.in, configure: Rebuild.
> * configure.ac: Check for locale.h, setlocale. Call
> AM_LC_MESSAGES.
> * acinclude.m4: Include lcmessage.m4.
Looks good to me.
Thank you,
--
Joel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-12-09 17:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-21 20:45 RFA: fix locale configure checks Tom Tromey
2008-11-25 23:12 ` Tom Tromey
2008-11-26 3:04 ` Thiago Jung Bauermann
2008-11-26 10:01 ` Tom Tromey
2008-12-09 11:05 ` Joel Brobecker
2008-12-09 17:20 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox