From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15725 invoked by alias); 2 Mar 2011 15:32:12 -0000 Received: (qmail 15717 invoked by uid 22791); 2 Mar 2011 15:32:11 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SARE_SUB_RAND_LETTRS4,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Mar 2011 15:32:06 +0000 Received: (qmail 25424 invoked from network); 2 Mar 2011 15:32:04 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 2 Mar 2011 15:32:04 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: Include dir intl when building libcommon.a for gdb Date: Wed, 02 Mar 2011 15:32:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-27-generic; KDE/4.6.0; x86_64; ; ) Cc: Yao Qi , Joel Brobecker References: <4D6C90AC.9010003@codesourcery.com> <20110302121407.GO30306@adacore.com> <4D6E5854.4020103@codesourcery.com> In-Reply-To: <4D6E5854.4020103@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201103021532.02784.pedro@codesourcery.com> X-IsSubscribed: yes 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: 2011-03/txt/msg00105.txt.bz2 On Wednesday 02 March 2011 14:46:44, Yao Qi wrote: > To your first question, because common/signals.c uses "ifdef GDBSERVER", > which makes a lot troubles here. I think of this problem again, and > find that root cause of this problem is that files in common dir > includes some gdb-specific or gdbserver specific code. You're oversimplifying. You'll need to include one or the other in files under common/ that require types such as CORE_ADDR and others. Obvious solutions to that are to rename server.h to defs.h, or add a new defs.h that just includes server.h. > If we move gdb-specific part of common/signals.c out of it, the include > and compilation flags can be unique. Only because signals.c doesn't use any of gdb/gdbserver's specific typedefs (CORE_ADDR & co). I haven't seen any comment on AC_CHECK_HEADERS concerns I raised, probably because the FSF tree has only signals.c and not much else under common/ currently, which hides the issue. Grepping the code we have under common/ in our local tree for "HAVE_", I see: $ grep HAVE_ * gdb_dirent.h:#ifdef HAVE_DIRENT_H gdb_dirent.h:# ifdef HAVE_SYS_NDIR_H gdb_dirent.h:# ifdef HAVE_SYS_DIR_H gdb_dirent.h:# ifdef HAVE_NDIR_H gdb_locale.h:#ifdef HAVE_LOCALE_H gdb_locale.h:#ifdef HAVE_LANGINFO_CODESET signals.c:#ifdef HAVE_SIGNAL_H Maintaining and making sure these checks are in both configures, rather than centralized is harder than updating two Makefiles. IMO, this should be handled by an .m4 under common that is used by both configures, something like gnulib/'s gl_INIT. gnulib does not have its own configure, yet it integrates into random configures. It looks like a better model for common/ to me. -- Pedro Alves