blob: 593fbb76bb43dbce09809778a57da94503642a22 [file] [log] [blame]
Matthew Barth1febc282017-04-12 11:33:39 -05001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([phosphor-dbus-monitor], [1.0], [https://github.com/openbmc/phosphor-dbus-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
11AM_PROG_AR
12AC_PROG_INSTALL
13AC_PROG_MAKE_SET
14AC_PROG_AWK
Matthew Barthdb440d42017-04-17 15:49:37 -050015AM_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 Barth1febc282017-04-12 11:33:39 -050018
19# Checks for libraries.
20PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, AC_MSG_ERROR(["Requires sdbusplus package."]))
21PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],, AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
22PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],, AC_MSG_ERROR(["Requires phosphor-logging."]))
23
24# Checks for typedefs, structures, and compiler characteristics.
25AX_CXX_COMPILE_STDCXX_14([noext])
26AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS])
27
28# Checks for library functions.
29LT_INIT
30
31# Check/set gtest specific functions.
32AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
33AC_SUBST(GTEST_CPPFLAGS)
34
35AC_ARG_ENABLE([oe-sdk],
36 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
37)
38AC_ARG_VAR(OECORE_TARGET_SYSROOT,
39 [Path to the OE SDK SYSROOT])
40AS_IF([test "x$enable_oe_sdk" == "xyes"],
41 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
42 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
43 )
44 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
45 [
46 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
47 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
48 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
49 ]
50 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
51)
52
Brad Bishop870c3fc2017-05-22 23:23:13 -040053AC_ARG_VAR(YAML_PATH, [The path to the yaml config files.])
Brad Bishop2d6586a2017-05-31 19:43:35 -040054AS_IF([test "x$YAML_PATH" == "x"], [YAML_PATH="\${top_srcdir}/src/example"])
Brad Bishop870c3fc2017-05-22 23:23:13 -040055
Brad Bishopb1e329a2017-08-02 01:23:12 -040056AC_CONFIG_FILES([Makefile src/Makefile src/test/Makefile mslverify/Makefile])
Matthew Barth1febc282017-04-12 11:33:39 -050057AC_OUTPUT