[Bug gdb/21465] New: Installing scripts in auto-load scripts-directory

dilyan.palauzov at aegee dot org sourceware-bugzilla@sourceware.org
Sat May 6 22:42:00 GMT 2017


            Bug ID: 21465
           Summary: Installing scripts in auto-load scripts-directory
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dilyan.palauzov at aegee dot org
  Target Milestone: ---

If an Autotools package wants to install a -gdb.py script under "auto-load
scripts-directory" during "make install", what is the procedure to determine
the destination path?

I wrote this code:

AC_CHECK_PROG(gdb, gdb, found)
if $gdb = found; then
  GDB_AUTO_LOAD_SCRIPTS_DIRECTORY=$(gdb -q -ex "show data-directory" -ex "show
auto-load scripts-directory" -ex quit |sed "1d;2{N;s/\n//g;
s/.*\"\(.*\)\".*:\(.*\)./\1 \2/}; /\$datadir/ {s/\(.*\)
\$datadir\(.*\)/\1\2/;q}; s/.* \(.\)/\1/")

which exposes the current "auto-load scripts-directory" to the Makefile

Isn't there a better way?

show configuration prints:

This GDB was configured as follows:
   configure --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
             --with-gdb-datadir=/usr/local/share/gdb (relocatable)
             --with-jit-reader-dir=/usr/local/lib/gdb (relocatable)
             --with-python=/usr/local (relocatable)
             --with-separate-debug-dir=/usr/local/lib/debug (relocatable)

("Relocatable" means the directory can be moved with the GDB installation
tree, and GDB will still find it.)

info '(gdb)Data Files':
If the data directory is inside GDB's configured binary prefix (set with
'--prefix' or '--exec-prefix'), then the default data directory will be updated
automatically if the installed GDB is moved to a new location.

and my gdb is in /usr/local/bin.

Where shall I move gdb, so that 'show configurtion' prints something different
for '--with-gdb-datadir'?

You are receiving this mail because:
You are on the CC list for the bug.

More information about the Gdb-prs mailing list