Fix gdbserver build when intl already built
authorTom Tromey <tom@tromey.com>
Thu, 12 Mar 2020 19:32:15 +0000 (13:32 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 12 Mar 2020 19:32:15 +0000 (13:32 -0600)
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.

ChangeLog
2020-03-12  Tom Tromey  <tom@tromey.com>

* Makefile.in: Rebuild.
* Makefile.def (gdbsupport): Depend on intl.

gdbserver/ChangeLog
2020-03-12  Tom Tromey  <tom@tromey.com>

* 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
Makefile.def
Makefile.in
gdbserver/ChangeLog
gdbserver/Makefile.in
gdbserver/acinclude.m4
gdbserver/config.in
gdbserver/configure
gdbserver/configure.ac

index 880ffdd70c96c91dd28243f9824cfafde3b3fb6b..f36e28ed7c27d41805494ccdd838f41ac170d550 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-12  Tom Tromey  <tom@tromey.com>
+
+       * Makefile.in: Rebuild.
+       * Makefile.def (gdbsupport): Depend on intl.
+
 2020-02-17  Tom Tromey  <tom@tromey.com>
 
        * configure: Rebuild.
index 2fe8204366c8427393162939d9e5a62199d2109b..7a27220d77a8cd6dd594de4fd957635eacbad91b 100644 (file)
@@ -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; };
index be38b34e9bfe1db349cd1596186cbe373b5478d5..e09bb1d311ffed441bd64fe0309dfed479475c78 100644 (file)
@@ -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
index 11d6c792d009ca8d273b268770a2cde08c119307..b516cb73f38650b1794520c608b0ef3b85384d20 100644 (file)
@@ -1,3 +1,13 @@
+2020-03-12  Tom Tromey  <tom@tromey.com>
+
+       * 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.
+
 2020-03-12  Simon Marchi  <simon.marchi@efficios.com>
 
        * acinclude.m4: Update path to selftest.m4.
index cc1eb808e322cc9a1d131a7a7e166216f4a3fc18..d6b79385e15732c962e09fdebab28b1e0782961e 100644 (file)
@@ -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 \
index e0d2bfa21366813ba7a930dad994eee5cc1a60c7..a49be8dff81e1ffe17f979692d9a6251874586c9 100644 (file)
@@ -36,6 +36,9 @@ m4_include(../gdbsupport/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.
 
index da8c313c360171264fee94124c3f757d27987995..e62795072f208fecf302f7f96bed977f5d07a1fc 100644 (file)
 /* 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
 
index 7fa9ac925e51abc9582b229a1ad664b88dd6b000..3f30a2bc6f1b81e02bca087901f6f7bd3505eff5 100755 (executable)
@@ -639,6 +639,18 @@ ustinc
 ustlibs
 CCDEPMODE
 CONFIG_SRC_SUBDIR
+CATOBJEXT
+GENCAT
+INSTOBJEXT
+DATADIRNAME
+CATALOGS
+POSUB
+GMSGFMT
+XGETTEXT
+INCINTL
+LIBINTL_DEP
+LIBINTL
+USE_NLS
 DEPDIR
 am__leading_dot
 host_noncanonical
@@ -8960,6 +8972,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"
 
index db9d45715efb2dd765b5cd5728e87adf838f81d1..d92005cf0fb07f3f6b265b6244c475e0540cd28d 100644 (file)
@@ -55,6 +55,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)
This page took 0.051604 seconds and 4 git commands to generate.