blob: 07ef420d3490c1487182ce5bb199d25be84202c4 [file] [log] [blame]
Andrew Geissler36529022016-11-29 15:23:54 -06001AC_PREREQ([2.69])
2AC_INIT([phosphor-state-manager], [1.0], [https://github.com/openbmc/phosphor-state-manager/issues])
3AC_LANG([C++])
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
10AC_PROG_INSTALL #Checks/sets the install variable to be used
11AC_PROG_MAKE_SET
12
13# Check for libraries
14PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
Patrick Venture64d60972019-02-13 15:49:27 -080015PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces])
16PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
17PKG_CHECK_MODULES([SDEVENTPLUS], [sdeventplus])
18PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
Andrew Geissler36529022016-11-29 15:23:54 -060019
Andrew Geissleree3a2c82019-07-30 15:16:20 -050020# We need the header only CLI library
21AC_CHECK_HEADERS(
22 [CLI/CLI.hpp],
23 [],
24 [AC_MSG_ERROR([Could not find CLI11 CLI/CLI.hpp])]
25)
26
Andrew Geissler36529022016-11-29 15:23:54 -060027# Checks for typedefs, structures, and compiler characteristics.
Vernon Mauery6425ab72018-10-04 10:31:50 -070028AX_CXX_COMPILE_STDCXX_17([noext])
Andrew Geissler36529022016-11-29 15:23:54 -060029AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
30
Matthew Barth6e0b5092017-01-19 12:50:25 -060031# Checks for library functions
Josh D. Kingbdd9cb72016-12-19 11:13:43 -060032LT_INIT # Removes WARNING: unrecognized options: --with-libtool-sysroot
Matthew Barth6e0b5092017-01-19 12:50:25 -060033
Andrew Geisslera90a31a2016-12-13 16:16:28 -060034AC_ARG_VAR(HOST_BUSNAME, [The Host Dbus busname to own])
35AS_IF([test "x$HOST_BUSNAME" == "x"], [HOST_BUSNAME="xyz.openbmc_project.State.Host"])
36AC_DEFINE_UNQUOTED([HOST_BUSNAME], ["$HOST_BUSNAME"], [The Host DBus busname to own])
Andrew Geissler36529022016-11-29 15:23:54 -060037
Andrew Geisslera90a31a2016-12-13 16:16:28 -060038AC_ARG_VAR(HOST_OBJPATH, [The host state manager Dbus root])
39AS_IF([test "x$HOST_OBJPATH" == "x"], [HOST_OBJPATH="/xyz/openbmc_project/state/host"])
40AC_DEFINE_UNQUOTED([HOST_OBJPATH], ["$HOST_OBJPATH"], [The host state manager Dbus root])
41
42AC_ARG_VAR(CHASSIS_BUSNAME, [The Chassis Dbus busname to own])
43AS_IF([test "x$CHASSIS_BUSNAME" == "x"], [CHASSIS_BUSNAME="xyz.openbmc_project.State.Chassis"])
44AC_DEFINE_UNQUOTED([CHASSIS_BUSNAME], ["$CHASSIS_BUSNAME"], [The Chassis DBus busname to own])
45
46AC_ARG_VAR(CHASSIS_OBJPATH, [The chassis state manager Dbus root])
47AS_IF([test "x$CHASSIS_OBJPATH" == "x"], [CHASSIS_OBJPATH="/xyz/openbmc_project/state/chassis"])
48AC_DEFINE_UNQUOTED([CHASSIS_OBJPATH], ["$CHASSIS_OBJPATH"], [The chassis state manager Dbus root])
Andrew Geissler36529022016-11-29 15:23:54 -060049
Josh D. Kingbdd9cb72016-12-19 11:13:43 -060050AC_ARG_VAR(BMC_BUSNAME, [The BMC Dbus busname to own])
51AS_IF([test "x$BMC_BUSNAME" == "x"], [BMC_BUSNAME="xyz.openbmc_project.State.BMC"])
52AC_DEFINE_UNQUOTED([BMC_BUSNAME], ["$BMC_BUSNAME"], [The BMC DBus busname to own])
53
54AC_ARG_VAR(BMC_OBJPATH, [The BMC state manager Dbus root])
Josh D. King3362ea52017-02-23 11:32:33 -060055AS_IF([test "x$BMC_OBJPATH" == "x"], [BMC_OBJPATH="/xyz/openbmc_project/state/bmc"])
Josh D. Kingbdd9cb72016-12-19 11:13:43 -060056AC_DEFINE_UNQUOTED([BMC_OBJPATH], ["$BMC_OBJPATH"], [The BMC state manager Dbus root])
57
Andrew Geissler07d0ed52017-03-28 15:44:18 -050058AC_ARG_VAR(HOST_RUNNING_FILE, [File to create if host is running])
59AS_IF([test "x$HOST_RUNNING_FILE" == "x"], [HOST_RUNNING_FILE="/run/openbmc/host@%u-on"])
60AC_DEFINE_UNQUOTED([HOST_RUNNING_FILE], ["$HOST_RUNNING_FILE"], [File to create if host is running])
61
Dhruvaraj Subhashchandran3f475242017-07-12 00:44:27 -050062AC_ARG_VAR(HOST_STATE_PERSIST_PATH, [Path of file for storing requested host state.])
63AS_IF([test "x$HOST_STATE_PERSIST_PATH" == "x"], \
64 [HOST_STATE_PERSIST_PATH="/var/lib/phosphor-state-manager/requestedHostTransition"])
65AC_DEFINE_UNQUOTED([HOST_STATE_PERSIST_PATH], ["$HOST_STATE_PERSIST_PATH"], \
66 [Path of file for storing requested host state.])
67
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -050068AC_ARG_VAR(POH_COUNTER_PERSIST_PATH, [Path of file for storing POH counter.])
69AS_IF([test "x$POH_COUNTER_PERSIST_PATH" == "x"], \
70 [POH_COUNTER_PERSIST_PATH="/var/lib/phosphor-state-manager/POHCounter"])
71AC_DEFINE_UNQUOTED([POH_COUNTER_PERSIST_PATH], ["$POH_COUNTER_PERSIST_PATH"], \
72 [Path of file for storing POH counter.])
73
Matt Spinler9eab9862018-07-11 14:13:52 -050074AC_ARG_VAR(CHASSIS_STATE_CHANGE_PERSIST_PATH, [Path of file for storing the state change time.])
75AS_IF([test "x$CHASSIS_STATE_CHANGE_PERSIST_PATH" == "x"], \
76 [CHASSIS_STATE_CHANGE_PERSIST_PATH="/var/lib/phosphor-state-manager/chassisStateChangeTime"])
77AC_DEFINE_UNQUOTED([CHASSIS_STATE_CHANGE_PERSIST_PATH], ["$CHASSIS_STATE_CHANGE_PERSIST_PATH"], \
78 [Path of file for storing the state change time.])
79
Dhruvaraj Subhashchandran2710e732017-06-19 06:43:22 -050080AC_ARG_VAR(BOOT_COUNT_MAX_ALLOWED, [The maximum allowed reboot count])
81AS_IF([test "x$BOOT_COUNT_MAX_ALLOWED" == "x"], [BOOT_COUNT_MAX_ALLOWED=3])
82AC_DEFINE_UNQUOTED([BOOT_COUNT_MAX_ALLOWED], [$BOOT_COUNT_MAX_ALLOWED], [The maximum allowed reboot count])
83
Andrew Geissler36529022016-11-29 15:23:54 -060084# Check for header files.
Gunnar Mills31292082017-10-25 20:43:27 -050085AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
Andrew Geissler36529022016-11-29 15:23:54 -060086AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...openbmc/sdbusplus package required])])
Saqib Khana8006a22017-02-14 11:37:08 -060087AC_CHECK_HEADER(phosphor-logging/log.hpp, ,[AC_MSG_ERROR([Could not find phosphor-logging/log.hpp...openbmc/phosphor-logging package required])])
Andrew Geissler1e3bf942016-12-13 15:32:22 -060088
Vishwanatha Subbanna0a838732017-10-05 12:43:19 +053089AC_ARG_VAR(CLASS_VERSION, [Class version to register with Cereal])
90AS_IF([test "x$CLASS_VERSION" == "x"], [CLASS_VERSION=1])
91AC_DEFINE_UNQUOTED([CLASS_VERSION], [$CLASS_VERSION], [Class version to register with Cereal])
92
Andrew Geissler36529022016-11-29 15:23:54 -060093AC_CONFIG_FILES([Makefile])
Andrew Geissler1e3bf942016-12-13 15:32:22 -060094AC_OUTPUT