Vishwanatha Subbanna | 15b1dc1 | 2017-05-23 15:16:13 +0530 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-watchdog], [1.0], |
| 4 | [https://github.com/openbmc/phosphor-watchdog/issues]) |
| 5 | AC_LANG([C++]) |
| 6 | AC_CONFIG_HEADERS([config.h]) |
| 7 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 8 | AM_SILENT_RULES([yes]) |
| 9 | |
| 10 | # Checks for programs. |
| 11 | AC_PROG_CXX |
| 12 | AC_PROG_INSTALL |
| 13 | |
| 14 | # Checks for typedefs, structures, and compiler characteristics. |
| 15 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 16 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 17 | |
| 18 | # For linking |
| 19 | LT_INIT |
| 20 | |
Vishwanatha Subbanna | d7a3f13 | 2017-05-29 19:39:08 +0530 | [diff] [blame] | 21 | # Check for needed modules |
Vishwanatha Subbanna | 7e14655 | 2017-05-29 17:03:33 +0530 | [diff] [blame] | 22 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221], [], [AC_MSG_ERROR(["systemd required and not found"])]) |
William A. Kennington III | e2aab94 | 2018-01-24 16:56:41 -0800 | [diff] [blame] | 23 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging], [], [AC_MSG_ERROR([Could not find phosphor-logging...openbmc/phosphor-logging package required])]) |
Vishwanatha Subbanna | d7a3f13 | 2017-05-29 19:39:08 +0530 | [diff] [blame] | 24 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR([Could not find sdbusplus...openbmc/sdbusplus package required])]) |
William A. Kennington III | e2aab94 | 2018-01-24 16:56:41 -0800 | [diff] [blame] | 25 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces], [], [AC_MSG_ERROR([Could not find phosphor-dbus-interfaces...openbmc/phosphor-dbus-interfaces package required])]) |
| 26 | PKG_CHECK_MODULES([GTEST_MAIN], [gtest_main], [], |
| 27 | [ |
| 28 | AX_PTHREAD([GTEST_MAIN_CFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_MAIN_CFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 29 | [GTEST_MAIN_LIBS="-lgtest_main -lgtest"] |
| 30 | AC_SUBST(GTEST_MAIN_CFLAGS) |
| 31 | AC_SUBST(GTEST_MAIN_LIBS) |
| 32 | ]) |
Vishwanatha Subbanna | 7e14655 | 2017-05-29 17:03:33 +0530 | [diff] [blame] | 33 | |
Vishwanatha Subbanna | 00bd377 | 2017-05-31 14:53:42 +0530 | [diff] [blame] | 34 | AC_ARG_ENABLE([oe-sdk], |
| 35 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 36 | ) |
| 37 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 38 | [Path to the OE SDK SYSROOT]) |
| 39 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 40 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 41 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 42 | ) |
| 43 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 44 | [ |
| 45 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 46 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 47 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 48 | ] |
| 49 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 50 | ) |
| 51 | |
Vishwanatha Subbanna | 15b1dc1 | 2017-05-23 15:16:13 +0530 | [diff] [blame] | 52 | # Create configured output |
Vishwanatha Subbanna | 00bd377 | 2017-05-31 14:53:42 +0530 | [diff] [blame] | 53 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Vishwanatha Subbanna | 15b1dc1 | 2017-05-23 15:16:13 +0530 | [diff] [blame] | 54 | AC_OUTPUT |