gcc/libstdc++-v3/python/Makefile.am
Jonathan Wakely db853ff78a libstdc++: Install GDB pretty printers for debug library
The additional libraries installed by --enable-libstdcxx-debug are built
without optimization to aid debugging, but the Python pretty printers
are not installed alongside them. This means that you can step through
the unoptimized library code, but at the expense of pretty printing the
library types.

This remedies the situation by installing another copy of the GDB hooks
alongside the debug version of libstdc++.so.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* python/Makefile.am [GLIBCXX_BUILD_DEBUG] (install-data-local):
	Install another copy of the GDB hook.
	* python/Makefile.in: Regenerate.
2021-08-16 17:51:42 +01:00

67 lines
2.3 KiB
Makefile

## Makefile for the python subdirectory of the GNU C++ Standard library.
##
## Copyright (C) 2009-2021 Free Software Foundation, Inc.
##
## This file is part of the libstdc++ version 3 distribution.
## Process this file with automake to produce Makefile.in.
## This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
## any later version.
##
## This library 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 library; see the file COPYING3. If not see
## <http://www.gnu.org/licenses/>.
include $(top_srcdir)/fragment.am
## Where to install the module code.
if ENABLE_PYTHONDIR
pythondir = $(prefix)/$(python_mod_dir)
else
pythondir = $(datadir)/gcc-$(gcc_version)/python
endif
if GLIBCXX_BUILD_DEBUG
debug_gdb_py = YES
else
debug_gdb_py =
endif
all-local: gdb.py
nobase_python_DATA = \
libstdcxx/v6/printers.py \
libstdcxx/v6/xmethods.py \
libstdcxx/v6/__init__.py \
libstdcxx/__init__.py
gdb.py: hook.in Makefile
sed -e 's,@pythondir@,$(pythondir),' \
-e 's,@toolexeclibdir@,$(toolexeclibdir),' < $(srcdir)/hook.in > $@
install-data-local: gdb.py
@$(mkdir_p) $(DESTDIR)$(toolexeclibdir)
## We want to install gdb.py as SOMETHING-gdb.py. SOMETHING is the
## full name of the final library. We use the libtool .la file to get
## the correct name.
@libname=`sed -ne "/^library_names=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
$(DESTDIR)$(toolexeclibdir)/libstdc++.la`; \
if [ -z "$$libname" ]; then \
libname=`sed -ne "/^old_library=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
$(DESTDIR)$(toolexeclibdir)/libstdc++.la`; \
fi; \
echo " $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py"; \
$(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py ; \
if [ -n "$(debug_gdb_py)" ]; then \
sed "/^libdir = /s;'$$;/debug';" gdb.py > debug-gdb.py ; \
$(INSTALL_DATA) debug-gdb.py $(DESTDIR)$(toolexeclibdir)/debug/$$libname-gdb.py ; \
fi