[PATCH] Also install data-directory into the build directory as computed by relocate_gdb_directory

Khoo Yit Phang
2012-09-24T19:19:43Z

[-- Attachment #1: Type: text/plain, Size: 845 bytes --]

Hi,

On Sep 24, 2012, at 1:03 PM, Joel Brobecker wrote:

>> Here's yet another alternative: gdb already tries to locate
>> data-directory in $BUILDDIR/share/gdb as part of the relocation logic;
>> we can install a symlink there that points to
>> $BUILDDIR/gdb/data-directory, or make a copy for platforms that don't
>> support symlinks.
>
> Sounds like an interesting idea. We could even do a local install
> of the share directory with $BUILDDIR as the prefix, to avoid
> duplicating the code, if that helps. But people might complain that
> this steps is unnecessary for those who always do an install after
> build. I think it's sufficiently negligible to be OK, personally.

Here's a first attempt at this. It's quite simple, but it assumes that $GDB_DATADIR and/or $bindir aren't too unusual.

Yit
September 24, 2012

[-- Attachment #2: builddir-data-directory.txt --]
[-- Type: text/plain, Size: 1010 bytes --]

gdb/ChangeLog

2012-09-24 Khoo Yit Phang <khooyp@cs.umd.edu>

* data-directory/Makefile.in (all): Also install data-directory
into the build directory at the location computed by
relocate_gdb_directory when gdb is run from the build directory.

diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -95,8 +95,14 @@
"RUNTEST=$(RUNTEST)" \
"RUNTESTFLAGS=$(RUNTESTFLAGS)"

+# Also install data-directory into the build directory at the location
+# computed by relocate_gdb_directory when gdb is run from the build directory.
.PHONY: all
all: stamp-syscalls stamp-python
+ @$(MAKE) $(FLAGS_TO_PASS) \
+ "SYSCALLS_INSTALL_DIR=$(top_builddir)/../$(SYSCALLS_INSTALL_DIR:$(prefix)/%=%)" \
+ "PYTHON_INSTALL_DIR=$(top_builddir)/../$(PYTHON_INSTALL_DIR:$(prefix)/%=%)" \
+ install-only

# For portability's sake, we need to handle systems that don't have
# symbolic links.