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

Joel Brobecker
2012-09-27T09:17:45Z

Does anyone have any objection to this approach in principle?

> 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.

It took me a long time to understand why you had to do things the way
you do. I would have prefered a patch that just needs to call make with
a new value for "prefix" set to "$(top_build_dir)/..", rather . But it
would not work if configured with --with-gdb-datadir.

There is an issue, I think, with your patch, unfortunately: I think
it requires GNU Make, as you are using variable substitution which
I do not think is available with all flavors of make.

There are only so many options I can see:
1. Conditionalize this feature to having GNU Make. Not sure how to do
that, though;
2. Compute the in-tree directory locations during the configure
step.

Option (2) is going to be a little more work, but maybe someone has
another simpler suggestion.

> 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.

--
Joel