From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10649 invoked by alias); 25 Nov 2008 17:23:15 -0000 Received: (qmail 10585 invoked by uid 22791); 25 Nov 2008 17:23:14 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Nov 2008 17:22:16 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id mAPHM3Jr013385 for ; Tue, 25 Nov 2008 12:22:04 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id mAPHM2IY022198; Tue, 25 Nov 2008 12:22:03 -0500 Received: from opsy.redhat.com (vpn-13-14.rdu.redhat.com [10.11.13.14]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id mAPHM2ug031043; Tue, 25 Nov 2008 12:22:02 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 9A4138880B8; Tue, 25 Nov 2008 10:22:01 -0700 (MST) To: gdb-patches@sourceware.org Subject: Re: RFA: fix locale configure checks References: From: Tom Tromey Reply-To: Tom Tromey Date: Tue, 25 Nov 2008 23:12:00 -0000 In-Reply-To: (Tom Tromey's message of "Thu\, 21 Aug 2008 14\:44\:06 -0600") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00693.txt.bz2 >>>>> "Tom" == Tom Tromey 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 * 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 @@ -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.