blob: 4683d40284408343d8a0a9d0e268e0d6a8becb23 [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])
Patrick Venture5dd0c1b2018-10-29 18:57:00 -07007AC_LANG([C++])
Matthew Barth70dbc582016-09-20 10:16:52 -05008
9# Checks for programs.
10AC_PROG_CXX
11AM_PROG_AR
12AC_PROG_INSTALL
13AC_PROG_MAKE_SET
14
15# Checks for libraries.
16PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
17
18# Checks for header files.
19AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
20AC_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 +053021PKG_CHECK_MODULES([OPENPOWER_DBUS_INTERFACES], [openpower-dbus-interfaces],,
22 [AC_MSG_ERROR([Could not find openpower-dbus-interfaces...openbmc/openpower-dbus-interfaces package required])])
Tom Joseph56c534b2017-10-17 12:38:42 +053023PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\
24 AC_MSG_ERROR(["Requires sdbusplus package."]))
25PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
26 AC_MSG_ERROR(["Requires phosphor-logging package."]))
27
28# Check for sdbus++ tool
29AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
30AS_IF([test "x$SDBUSPLUSPLUS" == "x"], AC_MSG_ERROR([Cannot find sdbus++]))
Matthew Barth70dbc582016-09-20 10:16:52 -050031
32# Checks for typedefs, structures, and compiler characteristics.
Vernon Maueryd6c7b2e2018-10-04 10:29:19 -070033AX_CXX_COMPILE_STDCXX_17([noext])
Matthew Barth70dbc582016-09-20 10:16:52 -050034AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
35
36# Checks for library functions.
37LT_INIT([disable-static shared])
38
39# Check/set gtest specific functions.
40AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-GTEST_HAS_PTHREAD=0"])
41AC_SUBST(GTEST_CPPFLAGS)
42
43AC_ARG_ENABLE([oe-sdk],
44 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
45)
46AC_ARG_VAR(OECORE_TARGET_SYSROOT,
47 [Path to the OE SDK SYSROOT])
48AS_IF([test "x$enable_oe_sdk" == "xyes"],
49 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
50 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
51 )
52 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
53 [
54 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
55 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
56 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
57 ]
58 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
59)
60
Vishwanatha Subbanna07655062017-07-14 20:31:57 +053061# Host object name in the D-Bus
62AC_ARG_VAR(HOST_NAME, [The Host name in the object path])
63AS_IF([test "x$HOST_NAME" == "x"],
64 [HOST_NAME="host"])
65AC_DEFINE_UNQUOTED([HOST_NAME], ["$HOST_NAME"], [The Host name in the object path])
66
67# Service dbus object manager
68AC_ARG_VAR(CONTROL_HOST_OBJ_MGR, [The Control Host D-Bus Object Manager])
69AS_IF([test "x$CONTROL_HOST_OBJ_MGR" == "x"],
70 [CONTROL_HOST_OBJ_MGR="/org/open_power/control"])
71AC_DEFINE_UNQUOTED([CONTROL_HOST_OBJ_MGR], ["$CONTROL_HOST_OBJ_MGR"], [The Control Host D-Bus Object Manager])
72
Matt Spinler34aca012018-09-25 11:21:06 -050073AC_DEFINE(MAPPER_BUS_NAME, "xyz.openbmc_project.ObjectMapper",
74 [The object mapper bus name])
75
76AC_DEFINE(MAPPER_OBJ, "/xyz/openbmc_project/object_mapper",
77 [The object mapper object path])
78
79AC_DEFINE(MAPPER_IFACE, "xyz.openbmc_project.ObjectMapper",
80 [The object mapper interface])
81
Matthew Barth70dbc582016-09-20 10:16:52 -050082# Create configured output.
83AC_CONFIG_FILES([Makefile])
84AC_OUTPUT