1AC_PREREQ([2.69]) 2AC_INIT([ibm-logging], [1.0], [https://github.com/openbmc/ibm-logging/issues]) 3AC_LANG([C++]) 4AC_CONFIG_HEADERS([config.h]) 5AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) 6AM_SILENT_RULES([yes]) 7 8# Checks for programs. 9AC_PROG_CXX 10AC_PROG_INSTALL 11AC_PROG_MAKE_SET 12 13PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\ 14 AC_MSG_ERROR(["Requires openbmc/phosphor-dbus-interfaces package."])) 15PKG_CHECK_MODULES([IBM_DBUS_INTERFACES], [ibm-dbus-interfaces],,\ 16 AC_MSG_ERROR(["Requires openbmc/ibm-dbus-interfaces package."])) 17PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, 18 AC_MSG_ERROR(["Requires openbmc/sdbusplus package."])) 19PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\ 20 AC_MSG_ERROR(["Requires openbmc/phosphor-logging package."])) 21 22AC_CHECK_HEADER(nlohmann/json.hpp, , 23 [AC_MSG_ERROR([Could not find nlohmann/json.hpp... nlohmann/json package required])]) 24 25AC_CHECK_HEADER(cereal/archives/binary.hpp, , 26 [AC_MSG_ERROR([Could not find cereal/archives/binary.hpp... cereal package required])]) 27 28# Checks for typedefs, structures, and compiler characteristics. 29AX_CXX_COMPILE_STDCXX_17([noext]) 30AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) 31 32LT_INIT 33 34# Check/set gtest specific functions. 35AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) 36AC_SUBST(GTEST_CPPFLAGS) 37AC_ARG_ENABLE([oe-sdk], 38 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) 39) 40AC_ARG_VAR(OECORE_TARGET_SYSROOT, 41 [Path to the OE SDK SYSROOT]) 42AS_IF([test "x$enable_oe_sdk" == "xyes"], 43 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], 44 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) 45 ) 46 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) 47 [ 48 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" 49 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" 50 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" 51 ] 52 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) 53) 54 55#The policy data must have been defined by the service folks 56#for it to be used, so allow its use to be configurable and 57#default it to off. 58AC_ARG_ENABLE([policy-interface], 59 AS_HELP_STRING([--enable-policy-interface], 60 [Enable the Policy D-Bus interface]) 61) 62 63AC_ARG_VAR(USE_POLICY_INTERFACE, [If the Policy D-Bus interface should be created]) 64 65AS_IF([test "x$enable_policy_interface" == "xyes"], 66 [USE_POLICY_INTERFACE="yes"] 67 AC_DEFINE_UNQUOTED([USE_POLICY_INTERFACE], ["$USE_POLICY_INTERFACE"], 68 [If the Policy D-Bus interface should be created]) 69) 70 71AC_DEFINE(LOGGING_PATH, "/xyz/openbmc_project/logging", 72 [The xyz log manager DBus object path]) 73AC_DEFINE(LOGGING_IFACE, "xyz.openbmc_project.Logging.Entry", 74 [The xyz log entry interface]) 75AC_DEFINE(LOGGING_BUSNAME, "xyz.openbmc_project.Logging", 76 [The xyz logging busname]) 77AC_DEFINE(IBM_LOGGING_BUSNAME, "com.ibm.Logging", 78 [The IBM log manager DBus busname to own]) 79AC_DEFINE(ASSOC_IFACE, "org.openbmc.Associations", 80 [The associations interface]) 81AC_DEFINE(ASSET_IFACE, "xyz.openbmc_project.Inventory.Decorator.Asset", 82 [The asset interface]) 83 84AC_DEFINE(DEFAULT_POLICY_EID, "None", 85 [The default event ID to use]) 86AC_DEFINE(DEFAULT_POLICY_MSG, "An internal BMC error occurred", 87 [The default policy message to use]) 88 89AC_ARG_VAR(POLICY_JSON_PATH, [The path to the policy json file]) 90AS_IF([test "x$POLICY_JSON_PATH" == "x"], [POLICY_JSON_PATH="/usr/share/ibm-logging/policy.json"]) 91AC_DEFINE_UNQUOTED([POLICY_JSON_PATH], ["$POLICY_JSON_PATH"], [The path to the policy json file on the BMC]) 92 93AC_ARG_VAR(ERRLOG_PERSIST_PATH, [Path to save errors in]) 94AS_IF([test "x$ERRLOG_PERSIST_PATH" == "x"], \ 95 [ERRLOG_PERSIST_PATH="/var/lib/ibm-logging/errors"]) 96AC_DEFINE_UNQUOTED([ERRLOG_PERSIST_PATH], ["$ERRLOG_PERSIST_PATH"], \ 97 [Path to save errors in]) 98 99AC_ARG_VAR(CALLOUT_CLASS_VERSION, 100 [Callout class version to register with Cereal]) 101AS_IF([test "x$CALLOUT_CLASS_VERSION" == "x"], 102 [CALLOUT_CLASS_VERSION=1]) 103AC_DEFINE_UNQUOTED([CALLOUT_CLASS_VERSION], [$CALLOUT_CLASS_VERSION], 104 [Callout Class version to register with Cereal]) 105 106AC_CONFIG_FILES([Makefile test/Makefile]) 107AC_OUTPUT 108