2012-04-10 12:18:20 +00:00
|
|
|
!CONFIG(separate_debug_info):CONFIG(debug, debug|release):have_target:!staticlib:!static:!isEmpty(QMAKE_OBJCOPY) {
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2011-11-09 17:59:46 +00:00
|
|
|
contains(TEMPLATE, "lib") {
|
|
|
|
QMAKE_GDB_INDEX = { test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\"; } &&
|
|
|
|
QMAKE_GDB_DIR = .
|
|
|
|
} else {
|
2011-11-10 11:43:51 +00:00
|
|
|
QMAKE_GDB_INDEX = { test -n \"$(DESTDIR)\" && DESTDIR=\"$(DESTDIR)\" || DESTDIR=.; } &&
|
|
|
|
QMAKE_GDB_DIR = \$\$DESTDIR
|
2011-11-09 17:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QMAKE_GDB_INDEX += \
|
2011-04-27 10:05:43 +00:00
|
|
|
test \$\$(gdb --version | sed -e \'s,[^0-9]\\+\\([0-9]\\)\\.\\([0-9]\\).*,\\1\\2,;q\') -gt 72 && \
|
2011-11-10 11:43:51 +00:00
|
|
|
gdb --nx --batch --quiet -ex \'set confirm off\' -ex \"save gdb-index $$QMAKE_GDB_DIR\" -ex quit \'$(TARGET)\' && \
|
2011-04-27 10:05:43 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$escape_expand(\\n\\t)$$QMAKE_POST_LINK
|
|
|
|
QMAKE_POST_LINK = $$QMAKE_GDB_INDEX $$QMAKE_POST_LINK
|
|
|
|
|
|
|
|
silent:QMAKE_POST_LINK = @echo indexing $@ for gdb && $$QMAKE_POST_LINK
|
|
|
|
}
|
|
|
|
|