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 | 1a7508b | 2017-02-13 22:51:40 -0600 | [diff] [blame] | 17 | AC_PROG_MKDIR_P |
| 18 | AC_CHECK_PROG([DIRNAME], dirname, dirname) |
Adriana Kobylak | 7298dc2 | 2017-01-24 12:21:50 -0600 | [diff] [blame] | 19 | # Python |
| 20 | AM_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 Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 22 | |
| 23 | # Surpress the --with-libtool-sysroot error |
| 24 | LT_INIT |
| 25 | |
Brad Bishop | 9316b9a | 2017-02-10 14:21:37 -0500 | [diff] [blame] | 26 | # Checks for libraries. |
| 27 | AX_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. |
| 31 | AX_PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], [], [], [AC_MSG_ERROR(["sdbusplus required and not found."])]) |
| 32 | AX_PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [], [phosphor-dbus-interfaces], [], [AC_MSG_ERROR(["phosphor-dbus-interfaces required and not found."])]) |
Adriana Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 33 | |
Adriana Kobylak | 1a7508b | 2017-02-13 22:51:40 -0600 | [diff] [blame] | 34 | # Check for sdbus++ |
| 35 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 36 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 37 | AC_MSG_ERROR(["Requires sdbus++"])) |
Adriana Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 38 | |
Andrew Geissler | 328889d | 2016-10-10 12:43:48 -0500 | [diff] [blame] | 39 | # Check/set gtest specific functions. |
| 40 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 41 | AC_SUBST(GTEST_CPPFLAGS) |
| 42 | |
| 43 | # Test cases require SDK so only build if we're told to (and SDK is available) |
| 44 | AC_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 | ) |
| 47 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 48 | [Path to the OE SDK SYSROOT]) |
| 49 | AS_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 Kobylak | c0f0532 | 2017-01-12 13:27:49 -0600 | [diff] [blame] | 62 | AC_DEFINE(BUSNAME_LOGGING, "xyz.openbmc_project.Logging", [The log manager DBus busname to own.]) |
Adriana Kobylak | 7c30f49 | 2017-02-23 09:38:45 -0600 | [diff] [blame] | 63 | AC_DEFINE(OBJ_LOGGING, "/xyz/openbmc_project/logging", [The log manager DBus object path.]) |
| 64 | AC_DEFINE(OBJ_INTERNAL, "/xyz/openbmc_project/logging/internal/manager", [The private log manager DBus object path.]) |
| 65 | AC_DEFINE(OBJ_ENTRY, "/xyz/openbmc_project/logging/entry", [The log entry DBus object path.]) |
Adriana Kobylak | ebd59fa | 2017-02-06 20:55:39 -0600 | [diff] [blame] | 66 | |
| 67 | AC_ARG_VAR(YAML_DIR_TEST, [The path to the test error yaml files.]) |
| 68 | AS_IF([test "x$YAML_DIR_TEST" == "x"], \ |
| 69 | [YAML_DIR_TEST="${srcdir}/tools/"]) |
| 70 | AC_ARG_VAR(YAML_DIR, [The path to the yaml error files.]) |
| 71 | AS_IF([test "x$YAML_DIR" == "x"], \ |
| 72 | [YAML_DIR="None"]) |
| 73 | |
Adriana Kobylak | f855c3e | 2016-09-29 20:48:08 -0500 | [diff] [blame] | 74 | AC_CONFIG_HEADERS([config.h]) |
Andrew Geissler | 328889d | 2016-10-10 12:43:48 -0500 | [diff] [blame] | 75 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Brad Bishop | 9316b9a | 2017-02-10 14:21:37 -0500 | [diff] [blame] | 76 | AC_CONFIG_FILES([phosphor-logging.pc]) |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 77 | AC_OUTPUT |