+2020-10-09 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * Makefile.in: Include Makefile.gnulib.inc. Don't define LIBGNU
+ or INCGNU. Make use of LIBGNU_EXTRA_LIBS when linking.
+
2020-10-09 Jan Vrany <jan.vrany@labware.com>
* source.c (directory_command): Notify observers that "directories"
# Helper code from gnulib.
GNULIB_BUILDDIR = ../gnulib
-LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a
-INCGNU = -I$(srcdir)/../gnulib/import -I$(GNULIB_BUILDDIR)/import
+include $(GNULIB_BUILDDIR)/Makefile.gnulib.inc
SUPPORT = ../gdbsupport
LIBSUPPORT = $(SUPPORT)/libgdbsupport.a
$(XM_CLIBS) $(GDBTKLIBS) \
@LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \
$(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \
- $(WIN32LIBS) $(LIBGNU) $(LIBICONV) \
+ $(WIN32LIBS) $(LIBGNU) $(LIBGNU_EXTRA_LIBS) $(LIBICONV) \
$(LIBMPFR) $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS) \
$(DEBUGINFOD_LIBS)
CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) $(CTF_DEPS) \
+2020-10-09 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * Makefile.in: Include Makefile.gnulib.inc. Don't define LIBGNU
+ or INCGNU. Make use of LIBGNU_EXTRA_LIBS when linking.
+
2020-10-08 Andrew Burgess <andrew.burgess@embecosm.com>
* linux-low.cc (linux_process_target::handle_extended_wait):
# gnulib
GNULIB_BUILDDIR = ../gnulib
-LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a
-INCGNU = -I$(srcdir)/../gnulib/import -I$(GNULIB_BUILDDIR)/import
+include $(GNULIB_BUILDDIR)/Makefile.gnulib.inc
# Where is the INTL library? Typically in ../intl.
INTL = @LIBINTL@
$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
$(CXXFLAGS) \
-o gdbserver$(EXEEXT) $(OBS) $(GDBSUPPORT) $(LIBGNU) \
- $(LIBIBERTY) $(INTL) $(GDBSERVER_LIBS) $(XM_CLIBS) \
- $(WIN32APILIBS)
+ $(LIBGNU_EXTRA_LIBS) $(LIBIBERTY) $(INTL) \
+ $(GDBSERVER_LIBS) $(XM_CLIBS) $(WIN32APILIBS)
gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY) \
$(INTL_DEPS) $(GDBSUPPORT)
$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
$(CXXFLAGS) \
-o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) \
- $(GDBSUPPORT) $(LIBGNU) $(LIBIBERTY) $(INTL) \
- $(WIN32APILIBS)
+ $(GDBSUPPORT) $(LIBGNU) $(LIBGNU_EXTRA_LIBS) \
+ $(LIBIBERTY) $(INTL) $(WIN32APILIBS)
IPA_OBJS = \
alloc-ipa.o \
+2020-10-09 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * Makefile.gnulib.inc.in: New file.
+ * Makefile.in: Regenerate.
+ * configure: Regenerate.
+ * configure.ac: Install the new file.
+
2020-09-08 Tom Tromey <tromey@adacore.com>
PR win32/25302:
--- /dev/null
+# Copyright (C) 2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# A makefile snippet that lists all of the libraries that should be
+# pulled in when linking against gnulib. Both GDB and GDBSERVER will
+# include this snippet.
+#
+# The defined variables are:
+#
+# LIBGNU: The path to the archive containing gnulib. Can be used as a
+# dependency as when this file changes gdb/gdbserver should be
+# relinked.
+#
+# LIBGNU_EXTRA_LIBS: A list of linker -l.... flags that should be
+# included in the link line of gdb/gdbserver. These are
+# libraries that $(LIBGNU) depends on. This list is taken from
+# the output of gnulib-tool, which is run by our
+# gnulib/update-gnulib.sh script.
+#
+# INCGNU: A list of -I.... include paths that should be passed to the
+# compiler, these are where the gnulib headers can be found.
+
+ifndef GNULIB_BUILDDIR
+$(error missing GNULIB_BUILDDIR)
+endif
+
+LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a
+LIBGNU_EXTRA_LIBS = @FREXPL_LIBM@ @FREXP_LIBM@ @INET_NTOP_LIB@ \
+ @LIBTHREAD@ @LIB_GETLOGIN@ @LIB_GETRANDOM@ \
+ @LIB_HARD_LOCALE@ @LIB_MBRTOWC@ \
+ @LIB_SETLOCALE_NULL@ @LIBINTL@
+INCGNU = -I$(srcdir)/../gnulib/import -I$(GNULIB_BUILDDIR)/import
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = Makefile.gnulib.inc
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
distclean-hdr:
-rm -f config.h stamp-h1
+Makefile.gnulib.inc: $(top_builddir)/config.status $(srcdir)/Makefile.gnulib.inc.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# Checks for libraries. #
# ---------------------- #
+ac_config_files="$ac_config_files Makefile.gnulib.inc"
+
+
ac_config_files="$ac_config_files Makefile import/Makefile"
ac_config_commands="$ac_config_commands default"
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "Makefile.gnulib.inc") CONFIG_FILES="$CONFIG_FILES Makefile.gnulib.inc" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"import/Makefile") CONFIG_FILES="$CONFIG_FILES import/Makefile" ;;
"default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
# Checks for libraries. #
# ---------------------- #
+AC_CONFIG_FILES(Makefile.gnulib.inc)
+
AC_OUTPUT(Makefile import/Makefile,
[
case x$CONFIG_HEADERS in