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."])) |
Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 19 | |
| 20 | # Checks for typedefs, structures, and compiler characteristics. |
| 21 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 22 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 23 | |
Matthew Barth | 6e0b509 | 2017-01-19 12:50:25 -0600 | [diff] [blame] | 24 | # Checks for library functions |
Josh D. King | bdd9cb7 | 2016-12-19 11:13:43 -0600 | [diff] [blame] | 25 | LT_INIT # Removes WARNING: unrecognized options: --with-libtool-sysroot |
Matthew Barth | 6e0b509 | 2017-01-19 12:50:25 -0600 | [diff] [blame] | 26 | |
Andrew Geissler | a90a31a | 2016-12-13 16:16:28 -0600 | [diff] [blame] | 27 | AC_ARG_VAR(HOST_BUSNAME, [The Host Dbus busname to own]) |
| 28 | AS_IF([test "x$HOST_BUSNAME" == "x"], [HOST_BUSNAME="xyz.openbmc_project.State.Host"]) |
| 29 | 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] | 30 | |
Andrew Geissler | a90a31a | 2016-12-13 16:16:28 -0600 | [diff] [blame] | 31 | AC_ARG_VAR(HOST_OBJPATH, [The host state manager Dbus root]) |
| 32 | AS_IF([test "x$HOST_OBJPATH" == "x"], [HOST_OBJPATH="/xyz/openbmc_project/state/host"]) |
| 33 | AC_DEFINE_UNQUOTED([HOST_OBJPATH], ["$HOST_OBJPATH"], [The host state manager Dbus root]) |
| 34 | |
| 35 | AC_ARG_VAR(CHASSIS_BUSNAME, [The Chassis Dbus busname to own]) |
| 36 | AS_IF([test "x$CHASSIS_BUSNAME" == "x"], [CHASSIS_BUSNAME="xyz.openbmc_project.State.Chassis"]) |
| 37 | AC_DEFINE_UNQUOTED([CHASSIS_BUSNAME], ["$CHASSIS_BUSNAME"], [The Chassis DBus busname to own]) |
| 38 | |
| 39 | AC_ARG_VAR(CHASSIS_OBJPATH, [The chassis state manager Dbus root]) |
| 40 | AS_IF([test "x$CHASSIS_OBJPATH" == "x"], [CHASSIS_OBJPATH="/xyz/openbmc_project/state/chassis"]) |
| 41 | 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] | 42 | |
Josh D. King | bdd9cb7 | 2016-12-19 11:13:43 -0600 | [diff] [blame] | 43 | AC_ARG_VAR(BMC_BUSNAME, [The BMC Dbus busname to own]) |
| 44 | AS_IF([test "x$BMC_BUSNAME" == "x"], [BMC_BUSNAME="xyz.openbmc_project.State.BMC"]) |
| 45 | AC_DEFINE_UNQUOTED([BMC_BUSNAME], ["$BMC_BUSNAME"], [The BMC DBus busname to own]) |
| 46 | |
| 47 | AC_ARG_VAR(BMC_OBJPATH, [The BMC state manager Dbus root]) |
| 48 | AS_IF([test "x$BMC_OBJPATH" == "x"], [BMC_OBJPATH="/xyz/openbmc_project/state/BMC"]) |
| 49 | AC_DEFINE_UNQUOTED([BMC_OBJPATH], ["$BMC_OBJPATH"], [The BMC state manager Dbus root]) |
| 50 | |
Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 51 | # Check for header files. |
| 52 | AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd developement package required])]) |
| 53 | AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...openbmc/sdbusplus package required])]) |
Andrew Geissler | 1e3bf94 | 2016-12-13 15:32:22 -0600 | [diff] [blame] | 54 | AC_CHECK_HEADER(log.hpp, ,[AC_MSG_ERROR([Could not find log.hpp...openbmc/phosphor-logging package required])]) |
| 55 | |
Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 56 | AC_CONFIG_FILES([Makefile]) |
Andrew Geissler | 1e3bf94 | 2016-12-13 15:32:22 -0600 | [diff] [blame] | 57 | AC_OUTPUT |