Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 1 | AC_PREREQ([2.69]) |
| 2 | AC_INIT([phosphor-state-manager], [1.0], [https://github.com/openbmc/phosphor-state-manager/issues]) |
| 3 | AC_LANG([C++]) |
| 4 | AC_CONFIG_HEADERS([config.h]) |
| 5 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 6 | AM_SILENT_RULES([yes]) |
| 7 | |
| 8 | # Checks for programs |
| 9 | AC_PROG_CXX |
| 10 | AC_PROG_INSTALL #Checks/sets the install variable to be used |
| 11 | AC_PROG_MAKE_SET |
| 12 | |
| 13 | # Check for libraries |
| 14 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
Patrick Williams | 515f74b | 2017-01-30 10:56:09 -0600 | [diff] [blame] | 15 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\ |
| 16 | AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."])) |
Adriana Kobylak | 20a4887 | 2017-01-30 20:18:46 -0600 | [diff] [blame] | 17 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, |
| 18 | AC_MSG_ERROR(["Requires sdbusplus package."])) |
Deepak Kodihalli | 3dd08a5 | 2017-07-25 07:34:44 -0500 | [diff] [blame] | 19 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\ |
| 20 | AC_MSG_ERROR(["Requires phosphor-logging package."])) |
Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 21 | |
| 22 | # Checks for typedefs, structures, and compiler characteristics. |
Vernon Mauery | 6425ab7 | 2018-10-04 10:31:50 -0700 | [diff] [blame^] | 23 | AX_CXX_COMPILE_STDCXX_17([noext]) |
Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 24 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 25 | |
Matthew Barth | 6e0b509 | 2017-01-19 12:50:25 -0600 | [diff] [blame] | 26 | # Checks for library functions |
Josh D. King | bdd9cb7 | 2016-12-19 11:13:43 -0600 | [diff] [blame] | 27 | LT_INIT # Removes WARNING: unrecognized options: --with-libtool-sysroot |
Matthew Barth | 6e0b509 | 2017-01-19 12:50:25 -0600 | [diff] [blame] | 28 | |
Andrew Geissler | a90a31a | 2016-12-13 16:16:28 -0600 | [diff] [blame] | 29 | AC_ARG_VAR(HOST_BUSNAME, [The Host Dbus busname to own]) |
| 30 | AS_IF([test "x$HOST_BUSNAME" == "x"], [HOST_BUSNAME="xyz.openbmc_project.State.Host"]) |
| 31 | AC_DEFINE_UNQUOTED([HOST_BUSNAME], ["$HOST_BUSNAME"], [The Host DBus busname to own]) |
Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 32 | |
Andrew Geissler | a90a31a | 2016-12-13 16:16:28 -0600 | [diff] [blame] | 33 | AC_ARG_VAR(HOST_OBJPATH, [The host state manager Dbus root]) |
| 34 | AS_IF([test "x$HOST_OBJPATH" == "x"], [HOST_OBJPATH="/xyz/openbmc_project/state/host"]) |
| 35 | AC_DEFINE_UNQUOTED([HOST_OBJPATH], ["$HOST_OBJPATH"], [The host state manager Dbus root]) |
| 36 | |
| 37 | AC_ARG_VAR(CHASSIS_BUSNAME, [The Chassis Dbus busname to own]) |
| 38 | AS_IF([test "x$CHASSIS_BUSNAME" == "x"], [CHASSIS_BUSNAME="xyz.openbmc_project.State.Chassis"]) |
| 39 | AC_DEFINE_UNQUOTED([CHASSIS_BUSNAME], ["$CHASSIS_BUSNAME"], [The Chassis DBus busname to own]) |
| 40 | |
| 41 | AC_ARG_VAR(CHASSIS_OBJPATH, [The chassis state manager Dbus root]) |
| 42 | AS_IF([test "x$CHASSIS_OBJPATH" == "x"], [CHASSIS_OBJPATH="/xyz/openbmc_project/state/chassis"]) |
| 43 | AC_DEFINE_UNQUOTED([CHASSIS_OBJPATH], ["$CHASSIS_OBJPATH"], [The chassis state manager Dbus root]) |
Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 44 | |
Josh D. King | bdd9cb7 | 2016-12-19 11:13:43 -0600 | [diff] [blame] | 45 | AC_ARG_VAR(BMC_BUSNAME, [The BMC Dbus busname to own]) |
| 46 | AS_IF([test "x$BMC_BUSNAME" == "x"], [BMC_BUSNAME="xyz.openbmc_project.State.BMC"]) |
| 47 | AC_DEFINE_UNQUOTED([BMC_BUSNAME], ["$BMC_BUSNAME"], [The BMC DBus busname to own]) |
| 48 | |
| 49 | AC_ARG_VAR(BMC_OBJPATH, [The BMC state manager Dbus root]) |
Josh D. King | 3362ea5 | 2017-02-23 11:32:33 -0600 | [diff] [blame] | 50 | AS_IF([test "x$BMC_OBJPATH" == "x"], [BMC_OBJPATH="/xyz/openbmc_project/state/bmc"]) |
Josh D. King | bdd9cb7 | 2016-12-19 11:13:43 -0600 | [diff] [blame] | 51 | AC_DEFINE_UNQUOTED([BMC_OBJPATH], ["$BMC_OBJPATH"], [The BMC state manager Dbus root]) |
| 52 | |
Andrew Geissler | 07d0ed5 | 2017-03-28 15:44:18 -0500 | [diff] [blame] | 53 | AC_ARG_VAR(HOST_RUNNING_FILE, [File to create if host is running]) |
| 54 | AS_IF([test "x$HOST_RUNNING_FILE" == "x"], [HOST_RUNNING_FILE="/run/openbmc/host@%u-on"]) |
| 55 | AC_DEFINE_UNQUOTED([HOST_RUNNING_FILE], ["$HOST_RUNNING_FILE"], [File to create if host is running]) |
| 56 | |
Dhruvaraj Subhashchandran | 3f47524 | 2017-07-12 00:44:27 -0500 | [diff] [blame] | 57 | AC_ARG_VAR(HOST_STATE_PERSIST_PATH, [Path of file for storing requested host state.]) |
| 58 | AS_IF([test "x$HOST_STATE_PERSIST_PATH" == "x"], \ |
| 59 | [HOST_STATE_PERSIST_PATH="/var/lib/phosphor-state-manager/requestedHostTransition"]) |
| 60 | AC_DEFINE_UNQUOTED([HOST_STATE_PERSIST_PATH], ["$HOST_STATE_PERSIST_PATH"], \ |
| 61 | [Path of file for storing requested host state.]) |
| 62 | |
Nagaraju Goruganti | cb781fe | 2018-04-06 13:41:01 -0500 | [diff] [blame] | 63 | AC_ARG_VAR(POH_COUNTER_PERSIST_PATH, [Path of file for storing POH counter.]) |
| 64 | AS_IF([test "x$POH_COUNTER_PERSIST_PATH" == "x"], \ |
| 65 | [POH_COUNTER_PERSIST_PATH="/var/lib/phosphor-state-manager/POHCounter"]) |
| 66 | AC_DEFINE_UNQUOTED([POH_COUNTER_PERSIST_PATH], ["$POH_COUNTER_PERSIST_PATH"], \ |
| 67 | [Path of file for storing POH counter.]) |
| 68 | |
Matt Spinler | 9eab986 | 2018-07-11 14:13:52 -0500 | [diff] [blame] | 69 | AC_ARG_VAR(CHASSIS_STATE_CHANGE_PERSIST_PATH, [Path of file for storing the state change time.]) |
| 70 | AS_IF([test "x$CHASSIS_STATE_CHANGE_PERSIST_PATH" == "x"], \ |
| 71 | [CHASSIS_STATE_CHANGE_PERSIST_PATH="/var/lib/phosphor-state-manager/chassisStateChangeTime"]) |
| 72 | AC_DEFINE_UNQUOTED([CHASSIS_STATE_CHANGE_PERSIST_PATH], ["$CHASSIS_STATE_CHANGE_PERSIST_PATH"], \ |
| 73 | [Path of file for storing the state change time.]) |
| 74 | |
Dhruvaraj Subhashchandran | 2710e73 | 2017-06-19 06:43:22 -0500 | [diff] [blame] | 75 | AC_ARG_VAR(BOOT_COUNT_MAX_ALLOWED, [The maximum allowed reboot count]) |
| 76 | AS_IF([test "x$BOOT_COUNT_MAX_ALLOWED" == "x"], [BOOT_COUNT_MAX_ALLOWED=3]) |
| 77 | AC_DEFINE_UNQUOTED([BOOT_COUNT_MAX_ALLOWED], [$BOOT_COUNT_MAX_ALLOWED], [The maximum allowed reboot count]) |
| 78 | |
Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 79 | # Check for header files. |
Gunnar Mills | 3129208 | 2017-10-25 20:43:27 -0500 | [diff] [blame] | 80 | AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])]) |
Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 81 | AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...openbmc/sdbusplus package required])]) |
Saqib Khan | a8006a2 | 2017-02-14 11:37:08 -0600 | [diff] [blame] | 82 | AC_CHECK_HEADER(phosphor-logging/log.hpp, ,[AC_MSG_ERROR([Could not find phosphor-logging/log.hpp...openbmc/phosphor-logging package required])]) |
Andrew Geissler | 1e3bf94 | 2016-12-13 15:32:22 -0600 | [diff] [blame] | 83 | |
Vishwanatha Subbanna | 0a83873 | 2017-10-05 12:43:19 +0530 | [diff] [blame] | 84 | AC_ARG_VAR(CLASS_VERSION, [Class version to register with Cereal]) |
| 85 | AS_IF([test "x$CLASS_VERSION" == "x"], [CLASS_VERSION=1]) |
| 86 | AC_DEFINE_UNQUOTED([CLASS_VERSION], [$CLASS_VERSION], [Class version to register with Cereal]) |
| 87 | |
Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 88 | AC_CONFIG_FILES([Makefile]) |
Andrew Geissler | 1e3bf94 | 2016-12-13 15:32:22 -0600 | [diff] [blame] | 89 | AC_OUTPUT |