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