blob: 4a05a2285ecb9c72073d82e63578aca98dd5fc5b [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 Subbanna77ec4792017-04-10 15:43:47 +053025PKG_CHECK_MODULES([LIBEVDEV], [libevdev],, [AC_MSG_ERROR([Could not find libevdev...libevdev package required])])
Vishwanatha Subbanna4902a102017-04-04 14:05:09 +053026
Vishwanatha Subbanna32c97272017-04-04 14:10:08 +053027# Check/set gtest specific functions.
28AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
29AC_SUBST(GTEST_CPPFLAGS)
30AC_ARG_ENABLE([oe-sdk],
31 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
32)
33AC_ARG_VAR(OECORE_TARGET_SYSROOT,
34 [Path to the OE SDK SYSROOT])
35AS_IF([test "x$enable_oe_sdk" == "xyes"],
36 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
37 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
38 )
39 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
40 [
41 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
42 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
43 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
44 ]
45 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
46)
47
Vishwanatha Subbannaaffea8b2017-04-04 14:02:16 +053048# Create configured output
Vishwanatha Subbanna32c97272017-04-04 14:10:08 +053049AC_CONFIG_FILES([Makefile test/Makefile])
Vishwanatha Subbannaaffea8b2017-04-04 14:02:16 +053050AC_OUTPUT