From 8f48ae542e0031cc5d7efc425d696be6c2005181 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Wed, 18 Mar 2015 19:31:55 +0100 Subject: [PATCH] Install the guile-frida-bindings into system library path Allows using only name in scm_load_module -- can be overwritten for testing and works with the final binary. Would be even better if we could hide the module in a private directory but I haven't found a nice way so far --- CMakeLists.txt | 7 ++++++- src/bindings/Guile.cxx | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa3d082..36cf17e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,9 +138,14 @@ enable_testing() add_test(NAME fridatest COMMAND fridatest ${CMAKE_SOURCE_DIR}) target_link_libraries(fridatest gmock gtest ${QT_LIBRARIES} ${LLVM_LDFLAGS} -lLLVM-3.5 ${LLVM_SYSTEM_LIBS} ${LOG4CXX_LDFLAGS} ${GUILE_LDFLAGS} ${QUAZIP_LIBRARIES}) target_compile_options(fridatest PRIVATE -DCONFIG_TEST) +set_property(TEST fridatest + APPEND PROPERTY ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}) install(TARGETS frida RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -install(TARGETS guilePlugin guile-frida-binding +install(TARGETS guilePlugin DESTINATION ${CMAKE_INSTALL_LIBDIR}/frida/plugins/Interpreter) + +install(TARGETS guile-frida-binding + DESTINATION ${CMAKE_INSTALL_LIBDIR}) \ No newline at end of file diff --git a/src/bindings/Guile.cxx b/src/bindings/Guile.cxx index c452e76..12fd32f 100644 --- a/src/bindings/Guile.cxx +++ b/src/bindings/Guile.cxx @@ -13,7 +13,7 @@ GuileInterpreter::GuileInterpreter() { scm_c_use_module("system repl server"); scm_call_0(scm_c_public_ref("system repl server", "spawn-server")); - scm_c_load_extension(CONFIG_LIBDIR "/frida/plugins/Interpreter/libguile-frida-binding", + scm_c_load_extension("libguile-frida-binding", "scm_init_frida_module"); guile_output_port = scm_open_output_string(); -- 2.39.5