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 |
Matthew Barth | db440d4 | 2017-04-17 15:49:37 -0500 | [diff] [blame] | 15 | AM_PATH_PYTHON([2.7], |
| 16 | [AC_SUBST([PYTHON], [echo "$PYTHON"])], |
| 17 | [AC_MSG_ERROR([Could not find python-2.7 installed...python-2.7 is required])]) |
Matthew Barth | 1febc28 | 2017-04-12 11:33:39 -0500 | [diff] [blame] | 18 | |
| 19 | # Checks for libraries. |
| 20 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, AC_MSG_ERROR(["Requires sdbusplus package."])) |
| 21 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],, AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."])) |
| 22 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],, AC_MSG_ERROR(["Requires phosphor-logging."])) |
| 23 | |
Ratan Gupta | cd22786 | 2017-10-06 21:27:13 +0530 | [diff] [blame] | 24 | # Check for sdbus++ |
| 25 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 26 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 27 | AC_MSG_ERROR(["Requires sdbus++"])) |
| 28 | |
Matthew Barth | 1febc28 | 2017-04-12 11:33:39 -0500 | [diff] [blame] | 29 | # Checks for typedefs, structures, and compiler characteristics. |
| 30 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 31 | AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS]) |
| 32 | |
| 33 | # Checks for library functions. |
| 34 | LT_INIT |
| 35 | |
| 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 | AC_ARG_ENABLE([oe-sdk], |
| 41 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 42 | ) |
| 43 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 44 | [Path to the OE SDK SYSROOT]) |
| 45 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 46 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 47 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 48 | ) |
| 49 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 50 | [ |
| 51 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 52 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 53 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 54 | ] |
| 55 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 56 | ) |
| 57 | |
Ratan Gupta | cd22786 | 2017-10-06 21:27:13 +0530 | [diff] [blame] | 58 | AC_ARG_VAR(OBJ_EVENT, [The event manager D-Bus object path]) |
| 59 | AS_IF([test "x$OBJ_EVENT" == "x"], [OBJ_EVENT="/xyz/openbmc_project/events"]) |
| 60 | AC_DEFINE_UNQUOTED([OBJ_EVENT], ["$OBJ_EVENT"], [The event manager D-Bus object path]) |
| 61 | |
| 62 | AC_ARG_VAR(BUSNAME_EVENT, [The D-Bus busname to own]) |
| 63 | AS_IF([test "x$BUSNAME_EVENT" == "x"], [BUSNAME_EVENT="xyz.openbmc_project.Events"]) |
| 64 | AC_DEFINE_UNQUOTED([BUSNAME_EVENT], ["$BUSNAME_EVENT"], [The D-Bus busname to own]) |
| 65 | |
Brad Bishop | 870c3fc | 2017-05-22 23:23:13 -0400 | [diff] [blame] | 66 | AC_ARG_VAR(YAML_PATH, [The path to the yaml config files.]) |
Brad Bishop | 2d6586a | 2017-05-31 19:43:35 -0400 | [diff] [blame] | 67 | 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] | 68 | |
Ratan Gupta | 8bbf9d2 | 2017-10-06 21:45:24 +0530 | [diff] [blame] | 69 | AC_ARG_VAR(MAX_EVENTS, [Maximum number of events.]) |
| 70 | AS_IF([test "x$MAX_EVENTS" == "x"], [MAX_EVENTS=20]) |
| 71 | AC_DEFINE_UNQUOTED([MAX_EVENTS], [$MAX_EVENTS], [Maximum number of events.]) |
| 72 | |
Brad Bishop | b1e329a | 2017-08-02 01:23:12 -0400 | [diff] [blame] | 73 | AC_CONFIG_FILES([Makefile src/Makefile src/test/Makefile mslverify/Makefile]) |
Matthew Barth | 1febc28 | 2017-04-12 11:33:39 -0500 | [diff] [blame] | 74 | AC_OUTPUT |