Adriana Kobylak | 88d7cf8 | 2017-01-24 12:30:15 -0600 | [diff] [blame] | 1 | # Initialization |
Adriana Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-logging], [1.0], [https://github.com/openbmc/phosphor-logging/issues]) |
Andrew Geissler | 09a0549 | 2017-01-18 13:57:33 -0600 | [diff] [blame] | 4 | AC_LANG([C++]) |
Adriana Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 5 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
Adriana Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 6 | AM_SILENT_RULES([yes]) |
| 7 | |
Adriana Kobylak | 88d7cf8 | 2017-01-24 12:30:15 -0600 | [diff] [blame] | 8 | # Checks for typedefs, structures, and compiler characteristics. |
| 9 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 10 | AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS]) |
| 11 | |
Adriana Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 12 | # Checks for programs |
| 13 | AC_PROG_CXX |
Adriana Kobylak | 88d7cf8 | 2017-01-24 12:30:15 -0600 | [diff] [blame] | 14 | AM_PROG_AR |
Adriana Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 15 | AC_PROG_INSTALL #Checks/sets the install variable to be used |
| 16 | AC_PROG_MAKE_SET |
Adriana Kobylak | 7298dc2 | 2017-01-24 12:21:50 -0600 | [diff] [blame] | 17 | # Python |
| 18 | AM_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 Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 20 | |
| 21 | # Surpress the --with-libtool-sysroot error |
| 22 | LT_INIT |
| 23 | |
Adriana Kobylak | 88d7cf8 | 2017-01-24 12:30:15 -0600 | [diff] [blame] | 24 | # Check for libraries. |
Adriana Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 25 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
Adriana Kobylak | 7d0692a | 2016-12-06 15:13:23 -0600 | [diff] [blame] | 26 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, |
| 27 | AC_MSG_ERROR(["Requires sdbusplus package."])) |
Adriana Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 28 | |
| 29 | AC_CHECK_HEADER(systemd/sd-journal.h, ,[AC_MSG_ERROR([Could not find \ |
| 30 | systemd/sd-journal.h...systemd developement package required])]) |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 31 | AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find \ |
| 32 | systemd/sd-bus.h...systemd developement package required])]) |
Andrew Geissler | 09a0549 | 2017-01-18 13:57:33 -0600 | [diff] [blame] | 33 | AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find \ |
| 34 | sdbusplus/server.hpp...openbmc/sdbusplus package required])]) |
Adriana Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 35 | |
Andrew Geissler | 328889d | 2016-10-10 12:43:48 -0500 | [diff] [blame] | 36 | # Check/set gtest specific functions. |
| 37 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 38 | AC_SUBST(GTEST_CPPFLAGS) |
| 39 | |
| 40 | # Test cases require SDK so only build if we're told to (and SDK is available) |
| 41 | AC_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 | ) |
| 44 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 45 | [Path to the OE SDK SYSROOT]) |
| 46 | AS_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 Kobylak | c0f0532 | 2017-01-12 13:27:49 -0600 | [diff] [blame] | 59 | AC_DEFINE(BUSNAME_LOGGING, "xyz.openbmc_project.Logging", [The log manager DBus busname to own.]) |
| 60 | AC_DEFINE(OBJ_INTERNAL, "/xyz/openbmc_project/Logging/Internal/Manager", [The private log manager DBus object path.]) |
Adriana Kobylak | 88d7cf8 | 2017-01-24 12:30:15 -0600 | [diff] [blame] | 61 | AC_DEFINE(OBJ_ENTRY, "/xyz/openbmc_project/Logging/Entry", [The log entry DBus object path.]) |
Adriana Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 62 | AC_CONFIG_HEADERS([config.h]) |
Andrew Geissler | 328889d | 2016-10-10 12:43:48 -0500 | [diff] [blame] | 63 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 64 | AC_OUTPUT |