summaryrefslogtreecommitdiffstats
path: root/perfparser.pro
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-04-13 14:49:51 +0200
committerUlf Hermann <ulf.hermann@qt.io>2017-04-28 10:53:25 +0000
commit4abd9df38adc6e324472730413885c0a194a499c (patch)
tree45fb2a662abe0c1b32ad379e775a01990db94425 /perfparser.pro
parentfb27768c3aef57c00a5bd7d8948ae7ef21c92046 (diff)
Allow specification of elfutils install dir
Link against elfutils in that directory, and copy files from there in the deploy step. Also, drop the windows specific library naming dance as we are never going to build the bundled elfutils on windows. Change-Id: Ia1dd2583856918b2c2623016f6ed7a80c0c7ef07 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Diffstat (limited to 'perfparser.pro')
-rw-r--r--perfparser.pro41
1 files changed, 40 insertions, 1 deletions
diff --git a/perfparser.pro b/perfparser.pro
index 92b600b..f37a0fe 100644
--- a/perfparser.pro
+++ b/perfparser.pro
@@ -1,12 +1,51 @@
TEMPLATE = subdirs
SUBDIRS = app
+include (paths.pri)
+
+defineReplace(elfutilsLibraryName) {
+ RET = $$1
+ linux: RET = lib$${RET}.so.$$2
+ macos: RET = lib$${RET}.dylib
+ win32: RET = $${RET}.dll
+ return($$RET)
+}
+
!isEmpty(BUILD_TESTS): SUBDIRS += tests
!isEmpty(PERFPARSER_BUNDLED_ELFUTILS) {
SUBDIRS += 3rdparty/elfutils
app.depends = 3rdparty/elfutils
!isEmpty(BUILD_TESTS): tests.depends = 3rdparty/elfutils
+} else:!isEmpty(PERFPARSER_ELFUTILS_INSTALLDIR) {
+ unix:isEmpty(ELFUTILS_INSTALL_DIR): ELFUTILS_INSTALL_DIR = /usr
+
+ inst_elfutils.files = \
+ $$ELFUTILS_INSTALL_DIR/lib/$$elfutilsLibraryName(elf, 1) \
+ $$ELFUTILS_INSTALL_DIR/lib/$$elfutilsLibraryName(dw, 1)
+
+ inst_elfutils.path = $$PERFPARSER_ELFUTILS_INSTALLDIR
+ inst_elfutils.CONFIG += no_check_exist no_default_install
+
+ # only deploy the non-versioned backends. We are never dlopen'ing the versioned ones anyway.
+ inst_backends.files = $$files($$ELFUTILS_INSTALL_DIR/lib/elfutils/*ebl_*.*)
+ inst_backends.files -= $$files($$ELFUTILS_INSTALL_DIR/lib/elfutils/*ebl_*-*.*.*)
+ inst_backends.path = $$PERFPARSER_ELFUTILS_BACKENDS_INSTALLDIR
+ inst_backends.CONFIG += no_check_exist no_default_install
+
+ INSTALLS += inst_backends inst_elfutils
+
+ deploy.depends = install_inst_elfutils install_inst_backends
+
+ linux {
+ RPATH = $$relative_path($$PERFPARSER_ELFUTILS_BACKENDS_INSTALLDIR, \
+ $$PERFPARSER_ELFUTILS_INSTALLDIR)
+ fix_dw_rpath.commands = chrpath -r \'\$\$ORIGIN/$$RPATH\' \
+ $$PERFPARSER_ELFUTILS_INSTALLDIR/$$elfutilsLibraryName(dw, 1)
+ fix_dw_rpath.depends = install_inst_elfutils
+ deploy.depends += fix_dw_rpath
+ QMAKE_EXTRA_TARGETS += fix_dw_rpath install_inst_elfutils
+ }
}
-QMAKE_EXTRA_TARGETS = docs install_docs # dummy targets for consistency
+QMAKE_EXTRA_TARGETS += deploy docs install_docs