From 8aee057be55156d1daec286839029bc1ee511dff Mon Sep 17 00:00:00 2001 From: Patrick Venture Date: Wed, 28 Nov 2018 14:59:23 -0800 Subject: main: receive blob handler path from configure Add blob handler path to configure_ac and use this path for searching. Change-Id: Ie0e33e93822bc6e95ace2fed5abe66f42dae5ca5 Signed-off-by: Patrick Venture --- configure.ac | 4 ++++ main.cpp | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 325cc0e..667b88c 100644 --- a/configure.ac +++ b/configure.ac @@ -56,6 +56,10 @@ AS_IF([test "x$enable_oe_sdk" == "xyes"], AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) ) +AC_ARG_VAR(BLOB_LIB_PATH, [The file path to search for libraries.]) +AS_IF([test "x$BLOB_LIB_PATH" == "x"], [BLOB_LIB_PATH="/usr/lib/blob-ipmid"]) +AC_DEFINE_UNQUOTED([BLOB_LIB_PATH], ["$BLOB_LIB_PATH"], [The file path to search for libraries.]) + # Create configured output AC_CONFIG_FILES([Makefile test/Makefile]) AC_OUTPUT diff --git a/main.cpp b/main.cpp index ee236d9..7bbae28 100644 --- a/main.cpp +++ b/main.cpp @@ -60,9 +60,6 @@ static ipmi_ret_t handleBlobCommand(ipmi_cmd_t cmd, const uint8_t* reqBuf, replyCmdBuf, dataLen); } -/* TODO: this should come from the makefile or recipe... */ -constexpr auto expectedHandlerPath = "/usr/lib/blob-ipmid"; - void setupBlobGlobalHandler() __attribute__((constructor)); void setupBlobGlobalHandler() @@ -78,7 +75,7 @@ void setupBlobGlobalHandler() /* Install handlers. */ try { - loadLibraries(getBlobManager(), expectedHandlerPath); + loadLibraries(getBlobManager(), BLOB_LIB_PATH); } catch (const std::exception& e) { -- cgit v1.2.3