From f04756f3f542eeeae416724046bfec96d977701e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 10 Nov 2011 12:43:51 +0100 Subject: [PATCH] fix gdb_dwarf_index.prf for applications, take two Handle the case of an empty DESTDIR. (cherry picked from commit 122fa6b53c33364a4687919191e55899acb43797) Change-Id: I0c2eec5736d0944b8ee97abdfa3f1121e7d8db4b Reviewed-by: Oswald Buddenhagen --- mkspecs/features/unix/gdb_dwarf_index.prf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/unix/gdb_dwarf_index.prf b/mkspecs/features/unix/gdb_dwarf_index.prf index 7771ed4f88..e3f79cdac6 100644 --- a/mkspecs/features/unix/gdb_dwarf_index.prf +++ b/mkspecs/features/unix/gdb_dwarf_index.prf @@ -4,12 +4,13 @@ QMAKE_GDB_INDEX = { test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\"; } && QMAKE_GDB_DIR = . } else { - QMAKE_GDB_DIR = $(DESTDIR) + QMAKE_GDB_INDEX = { test -n \"$(DESTDIR)\" && DESTDIR=\"$(DESTDIR)\" || DESTDIR=.; } && + QMAKE_GDB_DIR = \$\$DESTDIR } QMAKE_GDB_INDEX += \ test \$\$(gdb --version | sed -e \'s,[^0-9]\\+\\([0-9]\\)\\.\\([0-9]\\).*,\\1\\2,;q\') -gt 72 && \ - gdb --nx --batch --quiet -ex \'set confirm off\' -ex \'save gdb-index $$QMAKE_GDB_DIR\' -ex quit \'$(TARGET)\' && \ + gdb --nx --batch --quiet -ex \'set confirm off\' -ex \"save gdb-index $$QMAKE_GDB_DIR\" -ex quit \'$(TARGET)\' && \ test -f $(TARGET).gdb-index && \ $$QMAKE_OBJCOPY --add-section \'.gdb_index=$(TARGET).gdb-index\' --set-section-flags \'.gdb_index=readonly\' \'$(TARGET)\' \'$(TARGET)\' && \ $$QMAKE_DEL_FILE $(TARGET).gdb-index || true