blob: 7c01962163e55220a162f13bf7f6ce742f6abeac [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 Williams515f74b2017-01-30 10:56:09 -060015PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\
16 AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
Adriana Kobylak20a48872017-01-30 20:18:46 -060017PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,
18 AC_MSG_ERROR(["Requires sdbusplus package."]))
Deepak Kodihalli3dd08a52017-07-25 07:34:44 -050019PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
20 AC_MSG_ERROR(["Requires phosphor-logging package."]))
Andrew Geissler36529022016-11-29 15:23:54 -060021
22# Checks for typedefs, structures, and compiler characteristics.
23AX_CXX_COMPILE_STDCXX_14([noext])
24AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
25
Matthew Barth6e0b5092017-01-19 12:50:25 -060026# Checks for library functions
Josh D. Kingbdd9cb72016-12-19 11:13:43 -060027LT_INIT # Removes WARNING: unrecognized options: --with-libtool-sysroot
Matthew Barth6e0b5092017-01-19 12:50:25 -060028
Andrew Geisslera90a31a2016-12-13 16:16:28 -060029AC_ARG_VAR(HOST_BUSNAME, [The Host Dbus busname to own])
30AS_IF([test "x$HOST_BUSNAME" == "x"], [HOST_BUSNAME="xyz.openbmc_project.State.Host"])
31AC_DEFINE_UNQUOTED([HOST_BUSNAME], ["$HOST_BUSNAME"], [The Host DBus busname to own])
Andrew Geissler36529022016-11-29 15:23:54 -060032
Andrew Geisslera90a31a2016-12-13 16:16:28 -060033AC_ARG_VAR(HOST_OBJPATH, [The host state manager Dbus root])
34AS_IF([test "x$HOST_OBJPATH" == "x"], [HOST_OBJPATH="/xyz/openbmc_project/state/host"])
35AC_DEFINE_UNQUOTED([HOST_OBJPATH], ["$HOST_OBJPATH"], [The host state manager Dbus root])
36
37AC_ARG_VAR(CHASSIS_BUSNAME, [The Chassis Dbus busname to own])
38AS_IF([test "x$CHASSIS_BUSNAME" == "x"], [CHASSIS_BUSNAME="xyz.openbmc_project.State.Chassis"])
39AC_DEFINE_UNQUOTED([CHASSIS_BUSNAME], ["$CHASSIS_BUSNAME"], [The Chassis DBus busname to own])
40
41AC_ARG_VAR(CHASSIS_OBJPATH, [The chassis state manager Dbus root])
42AS_IF([test "x$CHASSIS_OBJPATH" == "x"], [CHASSIS_OBJPATH="/xyz/openbmc_project/state/chassis"])
43AC_DEFINE_UNQUOTED([CHASSIS_OBJPATH], ["$CHASSIS_OBJPATH"], [The chassis state manager Dbus root])
Andrew Geissler36529022016-11-29 15:23:54 -060044
Josh D. Kingbdd9cb72016-12-19 11:13:43 -060045AC_ARG_VAR(BMC_BUSNAME, [The BMC Dbus busname to own])
46AS_IF([test "x$BMC_BUSNAME" == "x"], [BMC_BUSNAME="xyz.openbmc_project.State.BMC"])
47AC_DEFINE_UNQUOTED([BMC_BUSNAME], ["$BMC_BUSNAME"], [The BMC DBus busname to own])
48
49AC_ARG_VAR(BMC_OBJPATH, [The BMC state manager Dbus root])
Josh D. King3362ea52017-02-23 11:32:33 -060050AS_IF([test "x$BMC_OBJPATH" == "x"], [BMC_OBJPATH="/xyz/openbmc_project/state/bmc"])
Josh D. Kingbdd9cb72016-12-19 11:13:43 -060051AC_DEFINE_UNQUOTED([BMC_OBJPATH], ["$BMC_OBJPATH"], [The BMC state manager Dbus root])
52
Andrew Geissler07d0ed52017-03-28 15:44:18 -050053AC_ARG_VAR(HOST_RUNNING_FILE, [File to create if host is running])
54AS_IF([test "x$HOST_RUNNING_FILE" == "x"], [HOST_RUNNING_FILE="/run/openbmc/host@%u-on"])
55AC_DEFINE_UNQUOTED([HOST_RUNNING_FILE], ["$HOST_RUNNING_FILE"], [File to create if host is running])
56
Dhruvaraj Subhashchandran3f475242017-07-12 00:44:27 -050057AC_ARG_VAR(HOST_STATE_PERSIST_PATH, [Path of file for storing requested host state.])
58AS_IF([test "x$HOST_STATE_PERSIST_PATH" == "x"], \
59 [HOST_STATE_PERSIST_PATH="/var/lib/phosphor-state-manager/requestedHostTransition"])
60AC_DEFINE_UNQUOTED([HOST_STATE_PERSIST_PATH], ["$HOST_STATE_PERSIST_PATH"], \
61 [Path of file for storing requested host state.])
62
Andrew Geissler36529022016-11-29 15:23:54 -060063# Check for header files.
64AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd developement package required])])
65AC_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 -060066AC_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 -060067
Andrew Geissler36529022016-11-29 15:23:54 -060068AC_CONFIG_FILES([Makefile])
Andrew Geissler1e3bf942016-12-13 15:32:22 -060069AC_OUTPUT