blob: 10655ed99bfbd0a0acebc63c253417bd23913e54 [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 Kobylak1a7508b2017-02-13 22:51:40 -060017AC_PROG_MKDIR_P
18AC_CHECK_PROG([DIRNAME], dirname, dirname)
Adriana Kobylak7298dc22017-01-24 12:21:50 -060019# Python
20AM_PATH_PYTHON([2.7], [AC_SUBST([PYTHON], [echo "$PYTHON"])], [AC_MSG_ERROR(
21 [Could not find python-2.7 installed...python-2.7 is required])])
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050022
23# Surpress the --with-libtool-sysroot error
24LT_INIT
25
Brad Bishop9316b9a2017-02-10 14:21:37 -050026# Checks for libraries.
27AX_PKG_CHECK_MODULES([SYSTEMD], [], [libsystemd >= 221], [], [AC_MSG_ERROR(["systemd required and not found."])])
28
29# sdbusplus is non-private because we have no library to link.
30# If we ever have a library, move this to private.
31AX_PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], [], [], [AC_MSG_ERROR(["sdbusplus required and not found."])])
32AX_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 -050033
Adriana Kobylak1a7508b2017-02-13 22:51:40 -060034# Check for sdbus++
35AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
36AS_IF([test "x$SDBUSPLUSPLUS" == "x"],
37 AC_MSG_ERROR(["Requires sdbus++"]))
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.])
Adriana Kobylak7c30f492017-02-23 09:38:45 -060063AC_DEFINE(OBJ_LOGGING, "/xyz/openbmc_project/logging", [The log manager DBus object path.])
64AC_DEFINE(OBJ_INTERNAL, "/xyz/openbmc_project/logging/internal/manager", [The private log manager DBus object path.])
65AC_DEFINE(OBJ_ENTRY, "/xyz/openbmc_project/logging/entry", [The log entry DBus object path.])
Adriana Kobylakebd59fa2017-02-06 20:55:39 -060066
67AC_ARG_VAR(YAML_DIR_TEST, [The path to the test error yaml files.])
68AS_IF([test "x$YAML_DIR_TEST" == "x"], \
69 [YAML_DIR_TEST="${srcdir}/tools/"])
70AC_ARG_VAR(YAML_DIR, [The path to the yaml error files.])
71AS_IF([test "x$YAML_DIR" == "x"], \
72 [YAML_DIR="None"])
73
Adriana Kobylakf855c3e2016-09-29 20:48:08 -050074AC_CONFIG_HEADERS([config.h])
Andrew Geissler328889d2016-10-10 12:43:48 -050075AC_CONFIG_FILES([Makefile test/Makefile])
Brad Bishop9316b9a2017-02-10 14:21:37 -050076AC_CONFIG_FILES([phosphor-logging.pc])
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060077AC_OUTPUT