From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7775 invoked by alias); 21 Aug 2008 20:45:29 -0000 Received: (qmail 7765 invoked by uid 22791); 21 Aug 2008 20:45:28 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 21 Aug 2008 20:44:30 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m7LKiS9g006080 for ; Thu, 21 Aug 2008 16:44:28 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m7LKi4LJ008944 for ; Thu, 21 Aug 2008 16:44:05 -0400 Received: from opsy.redhat.com (vpn-10-87.bos.redhat.com [10.16.10.87]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m7LKhwZu024485; Thu, 21 Aug 2008 16:43:58 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 56CB937828E; Thu, 21 Aug 2008 14:44:06 -0600 (MDT) To: gdb-patches@sourceware.org Subject: RFA: fix locale configure checks From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Thu, 21 Aug 2008 20:45:00 -0000 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (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-08/txt/msg00566.txt.bz2 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 * 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 #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)