From patchwork Tue Feb 25 22:22:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 38317 Received: (qmail 61498 invoked by alias); 25 Feb 2020 22:22:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 61432 invoked by uid 89); 25 Feb 2020 22:22:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=UD:m4 X-HELO: gateway34.websitewelcome.com Received: from gateway34.websitewelcome.com (HELO gateway34.websitewelcome.com) (192.185.147.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Feb 2020 22:22:49 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 1763120CADFE for ; Tue, 25 Feb 2020 16:22:47 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 6ibHj1Mg98vkB6ibHjweaN; Tue, 25 Feb 2020 16:22:47 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JQlMXE/xqTTX84D2Al8dSOex1hSkOxNs/btd4IOAlgk=; b=nTEKGJ6mCJlRoQAakhPhq5AGCI xM+22WSEquM6TVRQsjanZftjNK+TprICrGOIJNyFNEhMI6QRHkhlviYEfhe95SAGyDUwnXRXWlZNl OCQWJzRuT0B9DYEWX64zirPBT; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:55644 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1j6ibG-000r0B-OV; Tue, 25 Feb 2020 15:22:46 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 4/6] Fix gdbserver build when intl already built Date: Tue, 25 Feb 2020 15:22:41 -0700 Message-Id: <20200225222243.8260-5-tom@tromey.com> In-Reply-To: <20200225222243.8260-1-tom@tromey.com> References: <20200225222243.8260-1-tom@tromey.com> gdbserver uses gdb's alloc.c, and this in turn can include headers from intl via gdbsupport/gdb_locale.h. This can cause build failures in some situations, for example if you build gdb and gdbserver on mingw. This patch restores the gdbsupport dependency on intl, and changes gdbserver to use ZW_GNU_GETTEXT_SISTER_DIR. This fixes this build problem. 2020-02-25 Tom Tromey * Makefile.in: Rebuild. * Makefile.def (gdbsupport): Depend on intl. gdbserver/ChangeLog 2020-02-25 Tom Tromey * config.in, configure: Rebuild. * configure.ac: Call ZW_GNU_GETTEXT_SISTER_DIR. * acinclude.m4: Include gettext-sister.m4. * Makefile.in (top_builddir, INTL, INTL_DEPS, INTL_CFLAGS): New variables. (INCLUDE_CFLAGS): Add INTL_CFLAGS. (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Use INTL_DEPS, INTL. --- ChangeLog | 5 +++ Makefile.def | 2 + Makefile.in | 2 + gdbserver/ChangeLog | 10 +++++ gdbserver/Makefile.in | 20 +++++++--- gdbserver/acinclude.m4 | 3 ++ gdbserver/config.in | 4 ++ gdbserver/configure | 83 ++++++++++++++++++++++++++++++++++++++++++ gdbserver/configure.ac | 3 ++ 9 files changed, 127 insertions(+), 5 deletions(-) diff --git a/Makefile.def b/Makefile.def index 2fe8204366c..7a27220d77a 100644 --- a/Makefile.def +++ b/Makefile.def @@ -423,8 +423,10 @@ dependencies = { module=all-libgui; on=all-itcl; }; dependencies = { module=configure-gdbsupport; on=configure-bfd; }; dependencies = { module=configure-gdbsupport; on=configure-gnulib; }; +dependencies = { module=configure-gdbsupport; on=configure-intl; }; dependencies = { module=all-gdbsupport; on=all-bfd; }; dependencies = { module=all-gdbsupport; on=all-gnulib; }; +dependencies = { module=all-gdbsupport; on=all-intl; }; // Host modules specific to binutils. dependencies = { module=configure-bfd; on=configure-libiberty; hard=true; }; diff --git a/Makefile.in b/Makefile.in index be38b34e9bf..e09bb1d311f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -52455,7 +52455,9 @@ all-gdb: maybe-all-libdecnumber all-gdb: maybe-all-libctf all-gdbserver: maybe-all-libiberty configure-gdbsupport: maybe-configure-bfd +configure-gdbsupport: maybe-configure-intl all-gdbsupport: maybe-all-bfd +all-gdbsupport: maybe-all-intl configure-gprof: maybe-configure-intl all-gprof: maybe-all-libiberty all-gprof: maybe-all-bfd diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in index cc1eb808e32..d6b79385e15 100644 --- a/gdbserver/Makefile.in +++ b/gdbserver/Makefile.in @@ -75,6 +75,8 @@ abs_top_srcdir = @abs_top_srcdir@ abs_srcdir = @abs_srcdir@ VPATH = @srcdir@ +top_builddir = . + include $(srcdir)/../gdb/silent-rules.mk # Note that these are overridden by GNU make-specific code below if @@ -109,6 +111,11 @@ GNULIB_BUILDDIR = ../gnulib LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a INCGNU = -I$(srcdir)/../gnulib/import -I$(GNULIB_BUILDDIR)/import +# Where is the INTL library? Typically in ../intl. +INTL = @LIBINTL@ +INTL_DEPS = @LIBINTL_DEP@ +INTL_CFLAGS = @INCINTL@ + INCSUPPORT = -I$(srcdir)/.. -I.. # All the includes used for CFLAGS and for lint. @@ -122,7 +129,8 @@ INCSUPPORT = -I$(srcdir)/.. -I.. # INCLUDE_CFLAGS = -I. -I${srcdir} \ -I$(srcdir)/../gdb/regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \ - -I$(srcdir)/../gdb $(INCGNU) $(INCSUPPORT) + -I$(srcdir)/../gdb $(INCGNU) $(INCSUPPORT) \ + $(INTL_CFLAGS) # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS # from the config/ directory. @@ -403,17 +411,19 @@ html: install-html: clean-info: -gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY) +gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY) \ + $(INTL_DEPS) $(SILENCE) rm -f gdbserver$(EXEEXT) $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \ -o gdbserver$(EXEEXT) $(OBS) $(LIBGNU) $(LIBIBERTY) \ - $(GDBSERVER_LIBS) $(XM_CLIBS) + $(INTL) $(GDBSERVER_LIBS) $(XM_CLIBS) -gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY) +gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY) \ + $(INTL_DEPS) $(SILENCE) rm -f gdbreplay$(EXEEXT) $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \ -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \ - $(LIBIBERTY) + $(LIBIBERTY) $(INTL) IPA_OBJS = \ alloc-ipa.o \ diff --git a/gdbserver/acinclude.m4 b/gdbserver/acinclude.m4 index 00476bb0553..fb6837d6aa9 100644 --- a/gdbserver/acinclude.m4 +++ b/gdbserver/acinclude.m4 @@ -36,6 +36,9 @@ m4_include(../gdb/selftest.m4) m4_include([../config/ax_pthread.m4]) +dnl For ZW_GNU_GETTEXT_SISTER_DIR. +m4_include(../config/gettext-sister.m4) + dnl Check for existence of a type $1 in libthread_db.h dnl Based on BFD_HAVE_SYS_PROCFS_TYPE in bfd/bfd.m4. diff --git a/gdbserver/config.in b/gdbserver/config.in index da8c313c360..e62795072f2 100644 --- a/gdbserver/config.in +++ b/gdbserver/config.in @@ -11,6 +11,10 @@ /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + /* Define if self-testing features should be enabled */ #undef GDB_SELF_TEST diff --git a/gdbserver/configure b/gdbserver/configure index be5719eb77a..47f3152eb45 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -648,6 +648,18 @@ SED ALLOCA CCDEPMODE CONFIG_SRC_SUBDIR +CATOBJEXT +GENCAT +INSTOBJEXT +DATADIRNAME +CATALOGS +POSUB +GMSGFMT +XGETTEXT +INCINTL +LIBINTL_DEP +LIBINTL +USE_NLS DEPDIR am__leading_dot host_noncanonical @@ -6141,6 +6153,77 @@ ac_config_commands="$ac_config_commands depdir" +# If we haven't got the data from the intl directory, +# assume NLS is disabled. +USE_NLS=no +LIBINTL= +LIBINTL_DEP= +INCINTL= +XGETTEXT= +GMSGFMT= +POSUB= + +if test -f ../intl/config.intl; then + . ../intl/config.intl +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +$as_echo_n "checking whether NLS is requested... " >&6; } +if test x"$USE_NLS" != xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define ENABLE_NLS 1" >>confdefs.h + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5 +$as_echo_n "checking for catalogs to be installed... " >&6; } + # Look for .po and .gmo files in the source directory. + CATALOGS= + XLINGUAS= + for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do + # If there aren't any .gmo files the shell will give us the + # literal string "../path/to/srcdir/po/*.gmo" which has to be + # weeded out. + case "$cat" in *\**) + continue;; + esac + # The quadruple backslash is collapsed to a double backslash + # by the backticks, then collapsed again by the double quotes, + # leaving us with one backslash in the sed expression (right + # before the dot that mustn't act as a wildcard). + cat=`echo $cat | sed -e "s!$srcdir/po/!!" -e "s!\\\\.po!.gmo!"` + lang=`echo $cat | sed -e "s!\\\\.gmo!!"` + # The user is allowed to set LINGUAS to a list of languages to + # install catalogs for. If it's empty that means "all of them." + if test "x$LINGUAS" = x; then + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + else + case "$LINGUAS" in *$lang*) + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + ;; + esac + fi + done + LINGUAS="$XLINGUAS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5 +$as_echo "$LINGUAS" >&6; } + + + DATADIRNAME=share + + INSTOBJEXT=.mo + + GENCAT=gencat + + CATOBJEXT=.gmo + +fi + # Create sub-directories for objects and dependencies. CONFIG_SRC_SUBDIR="arch gdbsupport nat target" diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac index be2284b26c5..d0f406628d9 100644 --- a/gdbserver/configure.ac +++ b/gdbserver/configure.ac @@ -56,6 +56,9 @@ ACX_NONCANONICAL_HOST # Dependency checking. ZW_CREATE_DEPDIR +dnl Set up for gettext. +ZW_GNU_GETTEXT_SISTER_DIR + # Create sub-directories for objects and dependencies. CONFIG_SRC_SUBDIR="arch gdbsupport nat target" AC_SUBST(CONFIG_SRC_SUBDIR)