blob: c540350b36f958ff4f213881ebafde79f426c610 [file] [log] [blame]
Matt Spinlerc1d65772018-03-27 10:15:32 -05001AC_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
Patrick Venture18825042019-02-13 15:36:13 -080013PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces])
14PKG_CHECK_MODULES([IBM_DBUS_INTERFACES], [ibm-dbus-interfaces])
15PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
16PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
Matt Spinlere0017eb2018-03-27 11:17:38 -050017
Matt Spinler8c0a63f2018-03-27 12:27:23 -050018AC_CHECK_HEADER(nlohmann/json.hpp, ,
19 [AC_MSG_ERROR([Could not find nlohmann/json.hpp... nlohmann/json package required])])
20
Matt Spinleref3b86f2018-05-23 11:19:10 -050021AC_CHECK_HEADER(cereal/archives/binary.hpp, ,
22 [AC_MSG_ERROR([Could not find cereal/archives/binary.hpp... cereal package required])])
23
Matt Spinlerc1d65772018-03-27 10:15:32 -050024# Checks for typedefs, structures, and compiler characteristics.
Vernon Mauery5b6d0f62018-10-04 10:35:31 -070025AX_CXX_COMPILE_STDCXX_17([noext])
Matt Spinlerc1d65772018-03-27 10:15:32 -050026AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
27
28LT_INIT
29
Matt Spinlerb96fa322018-03-27 13:39:33 -050030# Check/set gtest specific functions.
31AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
32AC_SUBST(GTEST_CPPFLAGS)
33AC_ARG_ENABLE([oe-sdk],
34 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
35)
36AC_ARG_VAR(OECORE_TARGET_SYSROOT,
37 [Path to the OE SDK SYSROOT])
38AS_IF([test "x$enable_oe_sdk" == "xyes"],
39 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
40 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
41 )
42 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
43 [
44 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
45 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
46 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
47 ]
48 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
49)
50
Matt Spinler743e5822018-03-27 13:44:50 -050051#The policy data must have been defined by the service folks
52#for it to be used, so allow its use to be configurable and
53#default it to off.
54AC_ARG_ENABLE([policy-interface],
55 AS_HELP_STRING([--enable-policy-interface],
56 [Enable the Policy D-Bus interface])
57)
58
59AC_ARG_VAR(USE_POLICY_INTERFACE, [If the Policy D-Bus interface should be created])
60
61AS_IF([test "x$enable_policy_interface" == "xyes"],
62 [USE_POLICY_INTERFACE="yes"]
63 AC_DEFINE_UNQUOTED([USE_POLICY_INTERFACE], ["$USE_POLICY_INTERFACE"],
64 [If the Policy D-Bus interface should be created])
65)
66
Matt Spinlere0017eb2018-03-27 11:17:38 -050067AC_DEFINE(LOGGING_PATH, "/xyz/openbmc_project/logging",
68 [The xyz log manager DBus object path])
69AC_DEFINE(LOGGING_IFACE, "xyz.openbmc_project.Logging.Entry",
70 [The xyz log entry interface])
Matt Spinler54bfa7e2018-03-27 11:28:59 -050071AC_DEFINE(LOGGING_BUSNAME, "xyz.openbmc_project.Logging",
72 [The xyz logging busname])
Matt Spinler57724a92018-03-27 11:31:59 -050073AC_DEFINE(IBM_LOGGING_BUSNAME, "com.ibm.Logging",
74 [The IBM log manager DBus busname to own])
Matt Spinler4c0e8942019-11-06 11:29:45 -060075AC_DEFINE(ASSOC_IFACE, "xyz.openbmc_project.Association.Definitions",
Matt Spinler52ee71b2018-05-23 13:18:55 -050076 [The associations interface])
77AC_DEFINE(ASSET_IFACE, "xyz.openbmc_project.Inventory.Decorator.Asset",
78 [The asset interface])
Matt Spinlere0017eb2018-03-27 11:17:38 -050079
Matt Spinler7ce3eef2018-03-27 13:54:48 -050080AC_DEFINE(DEFAULT_POLICY_EID, "None",
81 [The default event ID to use])
82AC_DEFINE(DEFAULT_POLICY_MSG, "An internal BMC error occurred",
83 [The default policy message to use])
84
Matt Spinler743e5822018-03-27 13:44:50 -050085AC_ARG_VAR(POLICY_JSON_PATH, [The path to the policy json file])
86AS_IF([test "x$POLICY_JSON_PATH" == "x"], [POLICY_JSON_PATH="/usr/share/ibm-logging/policy.json"])
87AC_DEFINE_UNQUOTED([POLICY_JSON_PATH], ["$POLICY_JSON_PATH"], [The path to the policy json file on the BMC])
88
Matt Spinler52ee71b2018-05-23 13:18:55 -050089AC_ARG_VAR(ERRLOG_PERSIST_PATH, [Path to save errors in])
90AS_IF([test "x$ERRLOG_PERSIST_PATH" == "x"], \
91 [ERRLOG_PERSIST_PATH="/var/lib/ibm-logging/errors"])
92AC_DEFINE_UNQUOTED([ERRLOG_PERSIST_PATH], ["$ERRLOG_PERSIST_PATH"], \
93 [Path to save errors in])
94
Matt Spinleref3b86f2018-05-23 11:19:10 -050095AC_ARG_VAR(CALLOUT_CLASS_VERSION,
96 [Callout class version to register with Cereal])
97AS_IF([test "x$CALLOUT_CLASS_VERSION" == "x"],
98 [CALLOUT_CLASS_VERSION=1])
99AC_DEFINE_UNQUOTED([CALLOUT_CLASS_VERSION], [$CALLOUT_CLASS_VERSION],
100 [Callout Class version to register with Cereal])
101
Matt Spinlerb96fa322018-03-27 13:39:33 -0500102AC_CONFIG_FILES([Makefile test/Makefile])
Matt Spinlerc1d65772018-03-27 10:15:32 -0500103AC_OUTPUT