blob: a3c158a1c12b47f41b6f17a87315cb670ce9df91 [file] [log] [blame]
Matthew Barth70dbc582016-09-20 10:16:52 -05001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([openpower-host-ipmi-oem], [1.0], [https://github.com/openbmc/openpower-host-ipmi-oem/issues])
4AC_CONFIG_HEADERS([config.h])
5AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
6AM_SILENT_RULES([yes])
7
8# Checks for programs.
9AC_PROG_CXX
10AM_PROG_AR
11AC_PROG_INSTALL
12AC_PROG_MAKE_SET
13
14# Checks for libraries.
15PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
16
17# Checks for header files.
18AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
19AC_CHECK_HEADER(host-ipmid/ipmid-api.h, ,[AC_MSG_ERROR([Could not find host-ipmid/ipmid-api.h...host-ipmid package required])])
Vishwanatha Subbanna07655062017-07-14 20:31:57 +053020PKG_CHECK_MODULES([OPENPOWER_DBUS_INTERFACES], [openpower-dbus-interfaces],,
21 [AC_MSG_ERROR([Could not find openpower-dbus-interfaces...openbmc/openpower-dbus-interfaces package required])])
Tom Joseph56c534b2017-10-17 12:38:42 +053022PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\
23 AC_MSG_ERROR(["Requires sdbusplus package."]))
24PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
25 AC_MSG_ERROR(["Requires phosphor-logging package."]))
26
27# Check for sdbus++ tool
28AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
29AS_IF([test "x$SDBUSPLUSPLUS" == "x"], AC_MSG_ERROR([Cannot find sdbus++]))
Matthew Barth70dbc582016-09-20 10:16:52 -050030
31# Checks for typedefs, structures, and compiler characteristics.
Vernon Maueryd6c7b2e2018-10-04 10:29:19 -070032AX_CXX_COMPILE_STDCXX_17([noext])
Matthew Barth70dbc582016-09-20 10:16:52 -050033AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
34
35# Checks for library functions.
36LT_INIT([disable-static shared])
37
38# Check/set gtest specific functions.
39AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-GTEST_HAS_PTHREAD=0"])
40AC_SUBST(GTEST_CPPFLAGS)
41
42AC_ARG_ENABLE([oe-sdk],
43 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
44)
45AC_ARG_VAR(OECORE_TARGET_SYSROOT,
46 [Path to the OE SDK SYSROOT])
47AS_IF([test "x$enable_oe_sdk" == "xyes"],
48 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
49 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
50 )
51 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
52 [
53 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
54 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
55 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
56 ]
57 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
58)
59
Vishwanatha Subbanna07655062017-07-14 20:31:57 +053060# Host object name in the D-Bus
61AC_ARG_VAR(HOST_NAME, [The Host name in the object path])
62AS_IF([test "x$HOST_NAME" == "x"],
63 [HOST_NAME="host"])
64AC_DEFINE_UNQUOTED([HOST_NAME], ["$HOST_NAME"], [The Host name in the object path])
65
66# Service dbus object manager
67AC_ARG_VAR(CONTROL_HOST_OBJ_MGR, [The Control Host D-Bus Object Manager])
68AS_IF([test "x$CONTROL_HOST_OBJ_MGR" == "x"],
69 [CONTROL_HOST_OBJ_MGR="/org/open_power/control"])
70AC_DEFINE_UNQUOTED([CONTROL_HOST_OBJ_MGR], ["$CONTROL_HOST_OBJ_MGR"], [The Control Host D-Bus Object Manager])
71
Matthew Barth70dbc582016-09-20 10:16:52 -050072# Create configured output.
73AC_CONFIG_FILES([Makefile])
74AC_OUTPUT