blob: b58aebe72dd459c829ac98fae532df4dca7435b8 [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
Matt Spinlere0017eb2018-03-27 11:17:38 -050013PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\
14 AC_MSG_ERROR(["Requires openbmc/phosphor-dbus-interfaces package."]))
15PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,
16 AC_MSG_ERROR(["Requires openbmc/sdbusplus package."]))
17PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
18 AC_MSG_ERROR(["Requires openbmc/phosphor-logging package."]))
19
Matt Spinler8c0a63f2018-03-27 12:27:23 -050020AC_CHECK_HEADER(nlohmann/json.hpp, ,
21 [AC_MSG_ERROR([Could not find nlohmann/json.hpp... nlohmann/json package required])])
22
Matt Spinlerc1d65772018-03-27 10:15:32 -050023# Checks for typedefs, structures, and compiler characteristics.
24AX_CXX_COMPILE_STDCXX_14([noext])
25AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
26
27LT_INIT
28
Matt Spinlerb96fa322018-03-27 13:39:33 -050029# Check/set gtest specific functions.
30AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
31AC_SUBST(GTEST_CPPFLAGS)
32AC_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)
35AC_ARG_VAR(OECORE_TARGET_SYSROOT,
36 [Path to the OE SDK SYSROOT])
37AS_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 Spinlere0017eb2018-03-27 11:17:38 -050050AC_DEFINE(LOGGING_PATH, "/xyz/openbmc_project/logging",
51 [The xyz log manager DBus object path])
52AC_DEFINE(LOGGING_IFACE, "xyz.openbmc_project.Logging.Entry",
53 [The xyz log entry interface])
Matt Spinler54bfa7e2018-03-27 11:28:59 -050054AC_DEFINE(LOGGING_BUSNAME, "xyz.openbmc_project.Logging",
55 [The xyz logging busname])
Matt Spinler57724a92018-03-27 11:31:59 -050056AC_DEFINE(IBM_LOGGING_BUSNAME, "com.ibm.Logging",
57 [The IBM log manager DBus busname to own])
Matt Spinlere0017eb2018-03-27 11:17:38 -050058
Matt Spinlerb96fa322018-03-27 13:39:33 -050059AC_CONFIG_FILES([Makefile test/Makefile])
Matt Spinlerc1d65772018-03-27 10:15:32 -050060AC_OUTPUT