blob: 9f51ec6d90f3d1903a5ce284a10cf555116d8104 [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
Brad Bishop9316b9a2017-02-10 14:21:37 -050024# Checks for libraries.
25AX_PKG_CHECK_MODULES([SYSTEMD], [], [libsystemd >= 221], [], [AC_MSG_ERROR(["systemd required and not found."])])
26
27# sdbusplus is non-private because we have no library to link.
28# If we ever have a library, move this to private.
29AX_PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], [], [], [AC_MSG_ERROR(["sdbusplus required and not found."])])
30AX_PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [], [phosphor-dbus-interfaces], [], [AC_MSG_ERROR(["phosphor-dbus-interfaces required and not found."])])
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050031
32AC_CHECK_HEADER(systemd/sd-journal.h, ,[AC_MSG_ERROR([Could not find \
33systemd/sd-journal.h...systemd developement package required])])
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060034AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find \
35systemd/sd-bus.h...systemd developement package required])])
Andrew Geissler09a05492017-01-18 13:57:33 -060036AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find \
37sdbusplus/server.hpp...openbmc/sdbusplus package required])])
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050038
Andrew Geissler328889d2016-10-10 12:43:48 -050039# Check/set gtest specific functions.
40AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
41AC_SUBST(GTEST_CPPFLAGS)
42
43# Test cases require SDK so only build if we're told to (and SDK is available)
44AC_ARG_ENABLE([oe-sdk],
45 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
46)
47AC_ARG_VAR(OECORE_TARGET_SYSROOT,
48 [Path to the OE SDK SYSROOT])
49AS_IF([test "x$enable_oe_sdk" == "xyes"],
50 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
51 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
52 )
53 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
54 [
55 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
56 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
57 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
58 ]
59 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
60)
61
Adriana Kobylakc0f05322017-01-12 13:27:49 -060062AC_DEFINE(BUSNAME_LOGGING, "xyz.openbmc_project.Logging", [The log manager DBus busname to own.])
63AC_DEFINE(OBJ_INTERNAL, "/xyz/openbmc_project/Logging/Internal/Manager", [The private log manager DBus object path.])
Adriana Kobylak88d7cf82017-01-24 12:30:15 -060064AC_DEFINE(OBJ_ENTRY, "/xyz/openbmc_project/Logging/Entry", [The log entry DBus object path.])
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050065AC_CONFIG_HEADERS([config.h])
Andrew Geissler328889d2016-10-10 12:43:48 -050066AC_CONFIG_FILES([Makefile test/Makefile])
Brad Bishop9316b9a2017-02-10 14:21:37 -050067AC_CONFIG_FILES([phosphor-logging.pc])
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060068AC_OUTPUT