Matthew Barth | 1febc28 | 2017-04-12 11:33:39 -0500 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-dbus-monitor], [1.0], [https://github.com/openbmc/phosphor-dbus-monitor/issues]) |
| 4 | AC_LANG([C++]) |
| 5 | AC_CONFIG_HEADERS([config.h]) |
| 6 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 7 | AM_SILENT_RULES([yes]) |
| 8 | |
| 9 | # Checks for programs. |
| 10 | AC_PROG_CXX |
| 11 | AM_PROG_AR |
| 12 | AC_PROG_INSTALL |
| 13 | AC_PROG_MAKE_SET |
| 14 | AC_PROG_AWK |
Marri Devender Rao | 44fd7e8 | 2020-03-08 09:51:34 -0500 | [diff] [blame] | 15 | AM_PATH_PYTHON([3], |
Matthew Barth | db440d4 | 2017-04-17 15:49:37 -0500 | [diff] [blame] | 16 | [AC_SUBST([PYTHON], [echo "$PYTHON"])], |
Marri Devender Rao | 44fd7e8 | 2020-03-08 09:51:34 -0500 | [diff] [blame] | 17 | [AC_MSG_ERROR([Could not find python-3 installed...python-3 is required])]) |
Matthew Barth | 1febc28 | 2017-04-12 11:33:39 -0500 | [diff] [blame] | 18 | |
| 19 | # Checks for libraries. |
Patrick Venture | 50b4b44 | 2019-02-13 15:27:28 -0800 | [diff] [blame] | 20 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus]) |
| 21 | PKG_CHECK_MODULES([SDEVENTPLUS], [sdeventplus]) |
| 22 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces]) |
| 23 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging]) |
| 24 | PKG_CHECK_MODULES([PHOSPHOR_SNMP], [phosphor-snmp]) |
Matthew Barth | 1febc28 | 2017-04-12 11:33:39 -0500 | [diff] [blame] | 25 | |
Ratan Gupta | cd22786 | 2017-10-06 21:27:13 +0530 | [diff] [blame] | 26 | # Check for sdbus++ |
| 27 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 28 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 29 | AC_MSG_ERROR(["Requires sdbus++"])) |
| 30 | |
Matthew Barth | 1febc28 | 2017-04-12 11:33:39 -0500 | [diff] [blame] | 31 | # Checks for typedefs, structures, and compiler characteristics. |
Vernon Mauery | 8e27377 | 2018-10-04 10:23:32 -0700 | [diff] [blame] | 32 | AX_CXX_COMPILE_STDCXX_17([noext]) |
Matthew Barth | 1febc28 | 2017-04-12 11:33:39 -0500 | [diff] [blame] | 33 | AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS]) |
| 34 | |
| 35 | # Checks for library functions. |
| 36 | LT_INIT |
| 37 | |
| 38 | # Check/set gtest specific functions. |
| 39 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 40 | AC_SUBST(GTEST_CPPFLAGS) |
| 41 | |
| 42 | AC_ARG_ENABLE([oe-sdk], |
| 43 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 44 | ) |
| 45 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 46 | [Path to the OE SDK SYSROOT]) |
| 47 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 48 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 49 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 50 | ) |
| 51 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 52 | [ |
| 53 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 54 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 55 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 56 | ] |
| 57 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 58 | ) |
| 59 | |
Ratan Gupta | cd22786 | 2017-10-06 21:27:13 +0530 | [diff] [blame] | 60 | AC_ARG_VAR(OBJ_EVENT, [The event manager D-Bus object path]) |
| 61 | AS_IF([test "x$OBJ_EVENT" == "x"], [OBJ_EVENT="/xyz/openbmc_project/events"]) |
| 62 | AC_DEFINE_UNQUOTED([OBJ_EVENT], ["$OBJ_EVENT"], [The event manager D-Bus object path]) |
| 63 | |
| 64 | AC_ARG_VAR(BUSNAME_EVENT, [The D-Bus busname to own]) |
| 65 | AS_IF([test "x$BUSNAME_EVENT" == "x"], [BUSNAME_EVENT="xyz.openbmc_project.Events"]) |
| 66 | AC_DEFINE_UNQUOTED([BUSNAME_EVENT], ["$BUSNAME_EVENT"], [The D-Bus busname to own]) |
| 67 | |
Brad Bishop | 870c3fc | 2017-05-22 23:23:13 -0400 | [diff] [blame] | 68 | AC_ARG_VAR(YAML_PATH, [The path to the yaml config files.]) |
Brad Bishop | 2d6586a | 2017-05-31 19:43:35 -0400 | [diff] [blame] | 69 | AS_IF([test "x$YAML_PATH" == "x"], [YAML_PATH="\${top_srcdir}/src/example"]) |
Brad Bishop | 870c3fc | 2017-05-22 23:23:13 -0400 | [diff] [blame] | 70 | |
Ratan Gupta | 8bbf9d2 | 2017-10-06 21:45:24 +0530 | [diff] [blame] | 71 | AC_ARG_VAR(MAX_EVENTS, [Maximum number of events.]) |
| 72 | AS_IF([test "x$MAX_EVENTS" == "x"], [MAX_EVENTS=20]) |
| 73 | AC_DEFINE_UNQUOTED([MAX_EVENTS], [$MAX_EVENTS], [Maximum number of events.]) |
| 74 | |
Dhruvaraj Subhashchandran | 6524b9d | 2017-10-18 01:41:51 -0500 | [diff] [blame] | 75 | AC_ARG_VAR(CLASS_VERSION, [Class version to register with Cereal]) |
| 76 | AS_IF([test "x$CLASS_VERSION" == "x"], [CLASS_VERSION=1]) |
| 77 | AC_DEFINE_UNQUOTED([CLASS_VERSION], [$CLASS_VERSION], [Class version to register with Cereal]) |
| 78 | |
| 79 | AC_ARG_VAR(EVENTS_PERSIST_PATH, [Path of directory housing persisted events.]) |
| 80 | AS_IF([test "x$EVENTS_PERSIST_PATH" == "x"], \ |
| 81 | [EVENTS_PERSIST_PATH="/var/lib/phosphor-dbus-monitor/events"]) |
| 82 | AC_DEFINE_UNQUOTED([EVENTS_PERSIST_PATH], ["$EVENTS_PERSIST_PATH"], \ |
| 83 | [Path of directory housing persisted events]) |
| 84 | |
| 85 | |
Brad Bishop | b1e329a | 2017-08-02 01:23:12 -0400 | [diff] [blame] | 86 | AC_CONFIG_FILES([Makefile src/Makefile src/test/Makefile mslverify/Makefile]) |
Matthew Barth | 1febc28 | 2017-04-12 11:33:39 -0500 | [diff] [blame] | 87 | AC_OUTPUT |