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 | |
Matt Spinler | e0017eb | 2018-03-27 11:17:38 -0500 | [diff] [blame] | 13 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\ |
| 14 | AC_MSG_ERROR(["Requires openbmc/phosphor-dbus-interfaces package."])) |
Matt Spinler | 4a6ea6a | 2018-03-27 14:25:12 -0500 | [diff] [blame^] | 15 | PKG_CHECK_MODULES([IBM_DBUS_INTERFACES], [ibm-dbus-interfaces],,\ |
| 16 | AC_MSG_ERROR(["Requires openbmc/ibm-dbus-interfaces package."])) |
Matt Spinler | e0017eb | 2018-03-27 11:17:38 -0500 | [diff] [blame] | 17 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, |
| 18 | AC_MSG_ERROR(["Requires openbmc/sdbusplus package."])) |
| 19 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\ |
| 20 | AC_MSG_ERROR(["Requires openbmc/phosphor-logging package."])) |
| 21 | |
Matt Spinler | 8c0a63f | 2018-03-27 12:27:23 -0500 | [diff] [blame] | 22 | AC_CHECK_HEADER(nlohmann/json.hpp, , |
| 23 | [AC_MSG_ERROR([Could not find nlohmann/json.hpp... nlohmann/json package required])]) |
| 24 | |
Matt Spinler | c1d6577 | 2018-03-27 10:15:32 -0500 | [diff] [blame] | 25 | # Checks for typedefs, structures, and compiler characteristics. |
| 26 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 27 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 28 | |
| 29 | LT_INIT |
| 30 | |
Matt Spinler | b96fa32 | 2018-03-27 13:39:33 -0500 | [diff] [blame] | 31 | # Check/set gtest specific functions. |
| 32 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 33 | AC_SUBST(GTEST_CPPFLAGS) |
| 34 | AC_ARG_ENABLE([oe-sdk], |
| 35 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 36 | ) |
| 37 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 38 | [Path to the OE SDK SYSROOT]) |
| 39 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 40 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 41 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 42 | ) |
| 43 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 44 | [ |
| 45 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 46 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 47 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 48 | ] |
| 49 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 50 | ) |
| 51 | |
Matt Spinler | 743e582 | 2018-03-27 13:44:50 -0500 | [diff] [blame] | 52 | #The policy data must have been defined by the service folks |
| 53 | #for it to be used, so allow its use to be configurable and |
| 54 | #default it to off. |
| 55 | AC_ARG_ENABLE([policy-interface], |
| 56 | AS_HELP_STRING([--enable-policy-interface], |
| 57 | [Enable the Policy D-Bus interface]) |
| 58 | ) |
| 59 | |
| 60 | AC_ARG_VAR(USE_POLICY_INTERFACE, [If the Policy D-Bus interface should be created]) |
| 61 | |
| 62 | AS_IF([test "x$enable_policy_interface" == "xyes"], |
| 63 | [USE_POLICY_INTERFACE="yes"] |
| 64 | AC_DEFINE_UNQUOTED([USE_POLICY_INTERFACE], ["$USE_POLICY_INTERFACE"], |
| 65 | [If the Policy D-Bus interface should be created]) |
| 66 | ) |
| 67 | |
Matt Spinler | e0017eb | 2018-03-27 11:17:38 -0500 | [diff] [blame] | 68 | AC_DEFINE(LOGGING_PATH, "/xyz/openbmc_project/logging", |
| 69 | [The xyz log manager DBus object path]) |
| 70 | AC_DEFINE(LOGGING_IFACE, "xyz.openbmc_project.Logging.Entry", |
| 71 | [The xyz log entry interface]) |
Matt Spinler | 54bfa7e | 2018-03-27 11:28:59 -0500 | [diff] [blame] | 72 | AC_DEFINE(LOGGING_BUSNAME, "xyz.openbmc_project.Logging", |
| 73 | [The xyz logging busname]) |
Matt Spinler | 57724a9 | 2018-03-27 11:31:59 -0500 | [diff] [blame] | 74 | AC_DEFINE(IBM_LOGGING_BUSNAME, "com.ibm.Logging", |
| 75 | [The IBM log manager DBus busname to own]) |
Matt Spinler | e0017eb | 2018-03-27 11:17:38 -0500 | [diff] [blame] | 76 | |
Matt Spinler | 7ce3eef | 2018-03-27 13:54:48 -0500 | [diff] [blame] | 77 | AC_DEFINE(DEFAULT_POLICY_EID, "None", |
| 78 | [The default event ID to use]) |
| 79 | AC_DEFINE(DEFAULT_POLICY_MSG, "An internal BMC error occurred", |
| 80 | [The default policy message to use]) |
| 81 | |
Matt Spinler | 743e582 | 2018-03-27 13:44:50 -0500 | [diff] [blame] | 82 | AC_ARG_VAR(POLICY_JSON_PATH, [The path to the policy json file]) |
| 83 | AS_IF([test "x$POLICY_JSON_PATH" == "x"], [POLICY_JSON_PATH="/usr/share/ibm-logging/policy.json"]) |
| 84 | AC_DEFINE_UNQUOTED([POLICY_JSON_PATH], ["$POLICY_JSON_PATH"], [The path to the policy json file on the BMC]) |
| 85 | |
Matt Spinler | b96fa32 | 2018-03-27 13:39:33 -0500 | [diff] [blame] | 86 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Matt Spinler | c1d6577 | 2018-03-27 10:15:32 -0500 | [diff] [blame] | 87 | AC_OUTPUT |