blob: 33d383ac354d504725e250184d45c8a74e711474 [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])])
William A. Kennington III822eaf62019-02-12 15:20:06 -080020PKG_CHECK_MODULES([LIBIPMID], [libipmid])
Patrick Venture4457f902019-02-13 15:02:37 -080021PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
22PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
Tom Joseph56c534b2017-10-17 12:38:42 +053023
24# Check for sdbus++ tool
25AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
26AS_IF([test "x$SDBUSPLUSPLUS" == "x"], AC_MSG_ERROR([Cannot find sdbus++]))
Matthew Barth70dbc582016-09-20 10:16:52 -050027
28# Checks for typedefs, structures, and compiler characteristics.
Patrick Williams6f575142022-04-15 10:12:01 -050029AX_CXX_COMPILE_STDCXX([20],[noext])
Matthew Barth70dbc582016-09-20 10:16:52 -050030AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
31
32# Checks for library functions.
33LT_INIT([disable-static shared])
34
35# Check/set gtest specific functions.
36AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-GTEST_HAS_PTHREAD=0"])
37AC_SUBST(GTEST_CPPFLAGS)
38
39AC_ARG_ENABLE([oe-sdk],
40 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
41)
42AC_ARG_VAR(OECORE_TARGET_SYSROOT,
43 [Path to the OE SDK SYSROOT])
44AS_IF([test "x$enable_oe_sdk" == "xyes"],
45 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
46 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
47 )
48 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
49 [
50 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
51 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
52 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
53 ]
54 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
55)
56
Vishwanatha Subbanna07655062017-07-14 20:31:57 +053057# Host object name in the D-Bus
58AC_ARG_VAR(HOST_NAME, [The Host name in the object path])
59AS_IF([test "x$HOST_NAME" == "x"],
60 [HOST_NAME="host"])
61AC_DEFINE_UNQUOTED([HOST_NAME], ["$HOST_NAME"], [The Host name in the object path])
62
63# Service dbus object manager
64AC_ARG_VAR(CONTROL_HOST_OBJ_MGR, [The Control Host D-Bus Object Manager])
65AS_IF([test "x$CONTROL_HOST_OBJ_MGR" == "x"],
66 [CONTROL_HOST_OBJ_MGR="/org/open_power/control"])
67AC_DEFINE_UNQUOTED([CONTROL_HOST_OBJ_MGR], ["$CONTROL_HOST_OBJ_MGR"], [The Control Host D-Bus Object Manager])
68
Tom Josephb61b1072019-01-28 12:32:52 +053069AS_IF([test "x$INVSENSOR_YAML_GEN" == "x"], [INVSENSOR_YAML_GEN="inventory-sensor-example.yaml"])
70INVSENSORGEN="$PYTHON ${srcdir}/scripts/inventory-sensor.py -i $INVSENSOR_YAML_GEN"
71AC_SUBST(INVSENSORGEN)
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