blob: d668d7a06cb01e0a2f1105260e01db019c5eb5b4 [file] [log] [blame]
Adriana Kobylak88d7cf82017-01-24 12:30:15 -06001# Initialization
Adriana Kobylakf855c3e2016-09-29 20:48:08 -05002AC_PREREQ([2.69])
3AC_INIT([phosphor-logging], [1.0], [https://github.com/openbmc/phosphor-logging/issues])
Andrew Geissler09a05492017-01-18 13:57:33 -06004AC_LANG([C++])
Adriana Kobylakf855c3e2016-09-29 20:48:08 -05005AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
Adriana Kobylakf855c3e2016-09-29 20:48:08 -05006AM_SILENT_RULES([yes])
7
Adriana Kobylak88d7cf82017-01-24 12:30:15 -06008# Checks for typedefs, structures, and compiler characteristics.
9AX_CXX_COMPILE_STDCXX_14([noext])
10AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS])
11
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050012# Checks for programs
13AC_PROG_CXX
Adriana Kobylak88d7cf82017-01-24 12:30:15 -060014AM_PROG_AR
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050015AC_PROG_INSTALL #Checks/sets the install variable to be used
16AC_PROG_MAKE_SET
Adriana Kobylak7298dc22017-01-24 12:21:50 -060017# Python
18AM_PATH_PYTHON([2.7], [AC_SUBST([PYTHON], [echo "$PYTHON"])], [AC_MSG_ERROR(
19 [Could not find python-2.7 installed...python-2.7 is required])])
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050020
21# Surpress the --with-libtool-sysroot error
22LT_INIT
23
Adriana Kobylak88d7cf82017-01-24 12:30:15 -060024# Check for libraries.
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050025PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
Adriana Kobylak7d0692a2016-12-06 15:13:23 -060026PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,
27 AC_MSG_ERROR(["Requires sdbusplus package."]))
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050028
29AC_CHECK_HEADER(systemd/sd-journal.h, ,[AC_MSG_ERROR([Could not find \
30systemd/sd-journal.h...systemd developement package required])])
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060031AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find \
32systemd/sd-bus.h...systemd developement package required])])
Andrew Geissler09a05492017-01-18 13:57:33 -060033AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find \
34sdbusplus/server.hpp...openbmc/sdbusplus package required])])
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050035
Andrew Geissler328889d2016-10-10 12:43:48 -050036# Check/set gtest specific functions.
37AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
38AC_SUBST(GTEST_CPPFLAGS)
39
40# Test cases require SDK so only build if we're told to (and SDK is available)
41AC_ARG_ENABLE([oe-sdk],
42 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
43)
44AC_ARG_VAR(OECORE_TARGET_SYSROOT,
45 [Path to the OE SDK SYSROOT])
46AS_IF([test "x$enable_oe_sdk" == "xyes"],
47 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
48 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
49 )
50 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
51 [
52 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
53 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
54 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
55 ]
56 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
57)
58
Adriana Kobylakc0f05322017-01-12 13:27:49 -060059AC_DEFINE(BUSNAME_LOGGING, "xyz.openbmc_project.Logging", [The log manager DBus busname to own.])
60AC_DEFINE(OBJ_INTERNAL, "/xyz/openbmc_project/Logging/Internal/Manager", [The private log manager DBus object path.])
Adriana Kobylak88d7cf82017-01-24 12:30:15 -060061AC_DEFINE(OBJ_ENTRY, "/xyz/openbmc_project/Logging/Entry", [The log entry DBus object path.])
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050062AC_CONFIG_HEADERS([config.h])
Andrew Geissler328889d2016-10-10 12:43:48 -050063AC_CONFIG_FILES([Makefile test/Makefile])
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060064AC_OUTPUT