From c57862912186c97eed5898b537816632e11a0e5e Mon Sep 17 00:00:00 2001 From: Christian Balles Date: Thu, 20 Apr 2017 18:44:39 +0200 Subject: [PATCH] qmake: Use pkgconfig feature Instead of using r2 to get the lib and include paths use the builtin qmake feature for pkgconfig. Still needs a tweak to work with sys/user.sh installations. --- src/lib_radare2.pri | 73 ++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 41 deletions(-) diff --git a/src/lib_radare2.pri b/src/lib_radare2.pri index bc327f1c..af30258e 100644 --- a/src/lib_radare2.pri +++ b/src/lib_radare2.pri @@ -8,48 +8,39 @@ win32 { } else { LIBS += -L"$$PWD/../iaito_win32/radare2/lib64" } + + LIBS += \ + -lr_core \ + -lr_config \ + -lr_cons \ + -lr_io \ + -lr_util \ + -lr_flag \ + -lr_asm \ + -lr_debug \ + -lr_hash \ + -lr_bin \ + -lr_lang \ + -lr_io \ + -lr_anal \ + -lr_parse \ + -lr_bp \ + -lr_egg \ + -lr_reg \ + -lr_search \ + -lr_syscall \ + -lr_socket \ + -lr_fs \ + -lr_magic \ + -lr_crypto } else { - # check if r2 is available - system(r2 > /dev/null 2>&1) { - - # see https://github.com/hteso/iaito/pull/5#issuecomment-290433796 - RADARE2_INCLUDE_PATH = $$system(r2 -H | grep INCDIR | sed 's/[^=]*=//') - RADARE2_LIB_PATH = $$system(r2 -H | grep LIBDIR | sed 's/[^=]*=//') - - !isEmpty(RADARE2_INCLUDE_PATH) { - INCLUDEPATH *= $$RADARE2_INCLUDE_PATH - LIBS *= -L$$RADARE2_LIB_PATH - } else { - error("sorry could not find radare2 lib") - } - } else { - error("r2 not found/in path") + R2_USER_PKGCONFIG = $$(HOME)/bin/prefix/radare2/lib/pkgconfig + exists($$R2_USER_PKGCONFIG) { + # caution: may not work for cross compilations + QMAKE_PKG_CONFIG = PKG_CONFIG_PATH=$$R2_USER_PKGCONFIG pkg-config } + + CONFIG += link_pkgconfig + PKGCONFIG += r_core } - -LIBS += \ - -lr_core \ - -lr_config \ - -lr_cons \ - -lr_io \ - -lr_util \ - -lr_flag \ - -lr_asm \ - -lr_debug \ - -lr_hash \ - -lr_bin \ - -lr_lang \ - -lr_io \ - -lr_anal \ - -lr_parse \ - -lr_bp \ - -lr_egg \ - -lr_reg \ - -lr_search \ - -lr_syscall \ - -lr_socket \ - -lr_fs \ - -lr_magic \ - -lr_crypto -