blob: 694d2b3938df04c219b1bd3b29c432c00b71e78d [file] [log] [blame]
Vishwanatha Subbannaaffea8b2017-04-04 14:02:16 +05301# Initialization
2AC_PREREQ([2.69])
3AC_INIT([phosphor-gpio-monitor], [1.0], [https://github.com/openbmc/phosphor-gpio-monitor/issues])
4AC_LANG([C++])
5AC_CONFIG_HEADERS([config.h])
6AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
7AM_SILENT_RULES([yes])
8
9# Checks for programs.
10AC_PROG_CXX
11AC_PROG_INSTALL
Vishwanatha Subbannaaffea8b2017-04-04 14:02:16 +053012
13# Checks for typedefs, structures, and compiler characteristics.
14AX_CXX_COMPILE_STDCXX_14([noext])
15AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
16
17# For linking
18LT_INIT
19
Vishwanatha Subbanna4902a102017-04-04 14:05:09 +053020# Checks for modules
Vishwanatha Subbanna0b956032017-04-04 14:07:25 +053021PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221], ,[AC_MSG_ERROR([Could not find systemd...systemd developement package required])])
Vishwanatha Subbanna4902a102017-04-04 14:05:09 +053022PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],, [AC_MSG_ERROR([Could not find phosphor-logging...openbmc/phosphor-logging package required])])
Vishwanatha Subbannaba730132017-04-04 14:08:26 +053023PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR([Could not find sdbusplus...openbmc/sdbusplus package required])])
24PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],, [AC_MSG_ERROR([Could not find phosphor-dbus-interfaces...openbmc/phosphor-dbus-interfaces package required])])
Vishwanatha Subbanna4902a102017-04-04 14:05:09 +053025
Vishwanatha Subbanna32c97272017-04-04 14:10:08 +053026# Check/set gtest specific functions.
27AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
28AC_SUBST(GTEST_CPPFLAGS)
29AC_ARG_ENABLE([oe-sdk],
30 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
31)
32AC_ARG_VAR(OECORE_TARGET_SYSROOT,
33 [Path to the OE SDK SYSROOT])
34AS_IF([test "x$enable_oe_sdk" == "xyes"],
35 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
36 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
37 )
38 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
39 [
40 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
41 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
42 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
43 ]
44 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
45)
46
Vishwanatha Subbannaaffea8b2017-04-04 14:02:16 +053047# Create configured output
Vishwanatha Subbanna32c97272017-04-04 14:10:08 +053048AC_CONFIG_FILES([Makefile test/Makefile])
Vishwanatha Subbannaaffea8b2017-04-04 14:02:16 +053049AC_OUTPUT