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. |
William A. Kennington III | 73c2cfb | 2018-09-12 18:01:37 -0700 | [diff] [blame] | 15 | AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory]) |
Vishwanatha Subbanna | 15b1dc1 | 2017-05-23 15:16:13 +0530 | [diff] [blame] | 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 |
William A. Kennington III | e2aab94 | 2018-01-24 16:56:41 -0800 | [diff] [blame] | 22 | 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] | 23 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR([Could not find sdbusplus...openbmc/sdbusplus package required])]) |
William A. Kennington III | f505fc0 | 2018-09-12 18:30:09 -0700 | [diff] [blame] | 24 | PKG_CHECK_MODULES([SDEVENTPLUS], [sdeventplus],, [AC_MSG_ERROR([Could not find sdeventplus...openbmc/sdeventplus 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 | |
William A. Kennington III | 1eb97d9 | 2018-09-13 00:36:12 -0700 | [diff] [blame^] | 34 | # We need the header only CLI library |
| 35 | AC_CHECK_HEADERS([CLI/CLI.hpp], [], [ |
| 36 | AC_MSG_ERROR([Could not find CLI11 CLI/CLI.hpp]) |
| 37 | ]) |
| 38 | |
Vishwanatha Subbanna | 00bd377 | 2017-05-31 14:53:42 +0530 | [diff] [blame] | 39 | AC_ARG_ENABLE([oe-sdk], |
| 40 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 41 | ) |
| 42 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 43 | [Path to the OE SDK SYSROOT]) |
| 44 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 45 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 46 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 47 | ) |
| 48 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 49 | [ |
| 50 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 51 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 52 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 53 | ] |
| 54 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 55 | ) |
| 56 | |
Vishwanatha Subbanna | 15b1dc1 | 2017-05-23 15:16:13 +0530 | [diff] [blame] | 57 | # Create configured output |
Vishwanatha Subbanna | 00bd377 | 2017-05-31 14:53:42 +0530 | [diff] [blame] | 58 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Vishwanatha Subbanna | 15b1dc1 | 2017-05-23 15:16:13 +0530 | [diff] [blame] | 59 | AC_OUTPUT |