Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-host-ipmid], [1.0], [https://github.com/openbmc/phosphor-host-ipmid/issues]) |
| 4 | AC_CONFIG_HEADERS([config.h]) |
| 5 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 6 | AM_SILENT_RULES([yes]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 7 | |
| 8 | # Checks for programs. |
| 9 | AC_PROG_CXX |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 10 | AC_PROG_CC |
Patrick Williams | 686df74 | 2016-09-02 17:52:59 -0500 | [diff] [blame] | 11 | AM_PROG_AR |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 12 | AC_PROG_INSTALL |
| 13 | AC_PROG_MAKE_SET |
| 14 | |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 15 | # softoff dir specific ones |
| 16 | AC_ARG_ENABLE([softoff], |
| 17 | AS_HELP_STRING([--enable-softoff], [Builds soft power off]) |
| 18 | ) |
| 19 | AS_IF([test "x$enable_softoff" != "xno"], |
| 20 | [AC_PROG_MKDIR_P] |
| 21 | [AC_CHECK_PROG([DIRNAME], dirname, dirname)] |
| 22 | ) |
| 23 | |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 24 | # Checks for libraries. |
Matthew Barth | 80f714b | 2016-11-09 15:04:48 -0600 | [diff] [blame] | 25 | AC_CHECK_LIB([mapper], [mapper_get_service], ,[AC_MSG_ERROR([Could not find libmapper...openbmc/phosphor-objmgr package required])]) |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 26 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221], [], [AC_MSG_ERROR(["systemd required and not found"])]) |
Adriana Kobylak | 2efb3e7 | 2017-02-06 21:43:59 -0600 | [diff] [blame] | 27 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],, [AC_MSG_ERROR([Could not find phosphor-logging...openbmc/phosphor-logging package required])]) |
Vishwanatha Subbanna | b12b0c0 | 2017-03-07 18:17:19 +0530 | [diff] [blame] | 28 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],, [AC_MSG_ERROR([Could not find phosphor-dbus-interfaces...openbmc/phosphor-dbus-interfaces package required])]) |
Deepak Kodihalli | 18aa044 | 2017-07-21 07:07:09 -0500 | [diff] [blame] | 29 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\ |
| 30 | AC_MSG_ERROR(["Requires sdbusplus package."])) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 31 | |
Vishwanatha Subbanna | 6e8979d | 2017-07-13 16:48:20 +0530 | [diff] [blame] | 32 | |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 33 | AS_IF([test "x$enable_softoff" != "xno"], |
| 34 | # Check for sdbusplus |
| 35 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR(["sdbusplus packaged required and not found"])]) |
| 36 | |
| 37 | # Check for sdbus++ tool |
| 38 | [AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])] |
| 39 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 40 | AC_MSG_ERROR([Cannot find sdbus++])) |
| 41 | ) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 42 | |
| 43 | # Checks for typedefs, structures, and compiler characteristics. |
Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 44 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 45 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS]) |
| 46 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 47 | |
| 48 | # Checks for library functions. |
Patrick Williams | 686df74 | 2016-09-02 17:52:59 -0500 | [diff] [blame] | 49 | LT_INIT([dlopen disable-static shared]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 50 | LT_LIB_DLLOAD |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 51 | |
Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 52 | # Check/set gtest specific functions. |
| 53 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 54 | AC_SUBST(GTEST_CPPFLAGS) |
| 55 | |
| 56 | AC_ARG_ENABLE([oe-sdk], |
| 57 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 58 | ) |
| 59 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 60 | [Path to the OE SDK SYSROOT]) |
| 61 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 62 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 63 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 64 | ) |
| 65 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 66 | [ |
| 67 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 68 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 69 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 70 | ] |
| 71 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 72 | ) |
| 73 | |
Tom Joseph | 51cb8ee | 2017-02-21 16:22:33 +0530 | [diff] [blame] | 74 | AC_ARG_VAR(WHITELIST_CONF, [Paths to IPMI whitelisted commands conf files. (default = ${srcdir}/host-ipmid-whitelist.conf)]) |
| 75 | if test -z "$WHITELIST_CONF"; then |
| 76 | WHITELIST_CONF=${srcdir}/host-ipmid-whitelist.conf |
| 77 | fi |
| 78 | |
Ratan Gupta | 28c2e73 | 2017-03-04 08:53:52 +0530 | [diff] [blame] | 79 | AS_IF([test "x$SENSOR_YAML_GEN" == "x"], [SENSOR_YAML_GEN="sensor-example.yaml"]) |
| 80 | SENSORGEN="$PYTHON ${srcdir}/scripts/sensor_gen.py -i $SENSOR_YAML_GEN" |
| 81 | AC_SUBST(SENSORGEN) |
| 82 | |
Tom Joseph | d5899e7 | 2017-05-05 11:20:34 +0530 | [diff] [blame] | 83 | AS_IF([test "x$INVSENSOR_YAML_GEN" == "x"], [INVSENSOR_YAML_GEN="inventory-sensor-example.yaml"]) |
| 84 | INVSENSORGEN="$PYTHON ${srcdir}/scripts/inventory-sensor.py -i $INVSENSOR_YAML_GEN" |
| 85 | AC_SUBST(INVSENSORGEN) |
| 86 | |
Marri Devender Rao | 81b8d55 | 2017-07-07 12:20:23 -0500 | [diff] [blame] | 87 | AS_IF([test "x$FRU_YAML_GEN" == "x"], [FRU_YAML_GEN="fru-read-example.yaml"]) |
Marri Devender Rao | a62bacc | 2017-06-04 23:40:16 -0500 | [diff] [blame] | 88 | FRUGEN="$PYTHON $srcdir/scripts/fru_gen.py -i $FRU_YAML_GEN" |
| 89 | AC_SUBST(FRUGEN) |
| 90 | |
Patrick Venture | c01edf2 | 2017-12-22 14:03:06 -0800 | [diff] [blame] | 91 | AS_IF([test "x$CHANNEL_YAML_GEN" == "x"], [CHANNEL_YAML_GEN="channel-example.yaml"]) |
| 92 | CHANNELGEN="$PYTHON ${srcdir}/scripts/channel_gen.py -i $CHANNEL_YAML_GEN" |
| 93 | AC_SUBST(CHANNELGEN) |
| 94 | |
Tom Joseph | 6edc8a0 | 2017-06-30 18:52:56 +0530 | [diff] [blame] | 95 | AC_DEFINE(CALLOUT_FWD_ASSOCIATION, "callout", [The name of the callout's forward association.]) |
| 96 | AC_DEFINE(BOARD_SENSOR, "/xyz/openbmc_project/inventory/system/chassis/motherboard", [The inventory path to the motherboard fault sensor.]) |
| 97 | AC_DEFINE(SYSTEM_SENSOR, "/xyz/openbmc_project/inventory/system", [The inventory path to the system event sensor.]) |
| 98 | |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 99 | # Soft Power off related. |
| 100 | AS_IF([test "x$enable_softoff" != "xno"], |
| 101 | # Dbus service name |
| 102 | [AC_ARG_VAR(SOFTOFF_BUSNAME, [The Dbus busname to own])] |
| 103 | AS_IF([test "x$SOFTOFF_BUSNAME" == "x"], |
| 104 | [SOFTOFF_BUSNAME="xyz.openbmc_project.Ipmi.Internal.SoftPowerOff"]) |
| 105 | [AC_DEFINE_UNQUOTED([SOFTOFF_BUSNAME], ["$SOFTOFF_BUSNAME"], [The Dbus busname to own])] |
| 106 | |
| 107 | # Service dbus root |
| 108 | [AC_ARG_VAR(SOFTOFF_OBJPATH, [The SoftPowerOff Dbus root])] |
| 109 | AS_IF([test "x$SOFTOFF_OBJPATH" == "x"], |
Vishwanatha Subbanna | b891a57 | 2017-03-31 11:34:48 +0530 | [diff] [blame] | 110 | [SOFTOFF_OBJPATH="/xyz/openbmc_project/ipmi/internal/soft_power_off"]) |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 111 | [AC_DEFINE_UNQUOTED([SOFTOFF_OBJPATH], ["$SOFTOFF_OBJPATH"], [The SoftPowerOff Dbus root])] |
Vishwanatha Subbanna | d27e71e | 2017-02-01 18:02:38 +0530 | [diff] [blame] | 112 | |
| 113 | # Timeouts in SECONDS for SoftPowerOff protocol |
Andrew Geissler | 6fcdc21 | 2018-01-26 11:53:46 -0800 | [diff] [blame] | 114 | [AC_ARG_VAR(IPMI_SMS_ATN_ACK_TIMEOUT_SECS, \ |
| 115 | [Initial timeout for host to ack and query SMS_ATN from BMC])] |
| 116 | [AC_DEFINE_UNQUOTED([IPMI_SMS_ATN_ACK_TIMEOUT_SECS], [30], \ |
| 117 | [Timeout for host to ack and query SMS_ATN from BMC])] |
Vishwanatha Subbanna | 31272b8 | 2017-02-01 18:53:14 +0530 | [diff] [blame] | 118 | |
Andrew Geissler | 48ce072 | 2017-08-16 19:51:51 -0500 | [diff] [blame] | 119 | [AC_ARG_VAR(IPMI_HOST_SHUTDOWN_COMPLETE_TIMEOUT_SECS, [Wait time for host to shutdown])] |
| 120 | [AC_DEFINE_UNQUOTED([IPMI_HOST_SHUTDOWN_COMPLETE_TIMEOUT_SECS], [45*60], [Wait time for host to shutdown])] |
Andrew Geissler | a6e3a30 | 2017-05-31 19:34:00 -0500 | [diff] [blame] | 121 | |
| 122 | # Indicates an in-band power off or reboot request from the host |
| 123 | # This file is used to ensure the soft off service does not run for host |
| 124 | # initiated shutdown or reboot requests |
| 125 | [AC_ARG_VAR(HOST_INBAND_REQUEST_DIR, [Directory used to indicate the host has initiated a shutdown or reboot])] |
| 126 | AS_IF([test "x$HOST_INBAND_REQUEST_DIR" == "x"], |
| 127 | [HOST_INBAND_REQUEST_DIR="/run/openbmc/"]) |
| 128 | [AC_DEFINE_UNQUOTED([HOST_INBAND_REQUEST_DIR], ["$HOST_INBAND_REQUEST_DIR"], [Directory to store host initiated shutdown file])] |
| 129 | |
| 130 | [AC_ARG_VAR(HOST_INBAND_REQUEST_FILE, [File which indicates the host has initiated a shutdown or reboot])] |
| 131 | AS_IF([test "x$HOST_INBAND_REQUEST_FILE" == "x"], |
| 132 | [HOST_INBAND_REQUEST_FILE="host@%u-request"]) |
| 133 | [AC_DEFINE_UNQUOTED([HOST_INBAND_REQUEST_FILE], ["$HOST_INBAND_REQUEST_FILE"], [File to create if host has initiated shutdown or reboot])] |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 134 | ) |
| 135 | |
Andrew Geissler | 62817fa9 | 2017-03-20 14:20:49 -0500 | [diff] [blame] | 136 | # Control Host Interfaces |
| 137 | # Dbus service name |
| 138 | AC_ARG_VAR(CONTROL_HOST_BUSNAME, [The Control Host Dbus busname to own]) |
| 139 | AS_IF([test "x$CONTROL_HOST_BUSNAME" == "x"], |
| 140 | [CONTROL_HOST_BUSNAME="xyz.openbmc_project.Control.Host"]) |
| 141 | AC_DEFINE_UNQUOTED([CONTROL_HOST_BUSNAME], ["$CONTROL_HOST_BUSNAME"], [The Control Host Dbus busname to own]) |
| 142 | |
Vishwanatha Subbanna | 3eb117a | 2017-07-12 16:13:49 +0530 | [diff] [blame] | 143 | # Host object name in the D-Bus |
| 144 | AC_ARG_VAR(HOST_NAME, [The Host name in the object path]) |
| 145 | AS_IF([test "x$HOST_NAME" == "x"], |
| 146 | [HOST_NAME="host"]) |
| 147 | AC_DEFINE_UNQUOTED([HOST_NAME], ["$HOST_NAME"], [The Host name in the object path]) |
| 148 | |
| 149 | # Service dbus object manager |
| 150 | AC_ARG_VAR(CONTROL_HOST_OBJ_MGR, [The Control Host D-Bus Object Manager]) |
| 151 | AS_IF([test "x$CONTROL_HOST_OBJ_MGR" == "x"], |
| 152 | [CONTROL_HOST_OBJ_MGR="/xyz/openbmc_project/control"]) |
| 153 | AC_DEFINE_UNQUOTED([CONTROL_HOST_OBJ_MGR], ["$CONTROL_HOST_OBJ_MGR"], [The Control Host D-Bus Object Manager]) |
Andrew Geissler | 62817fa9 | 2017-03-20 14:20:49 -0500 | [diff] [blame] | 154 | |
Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 155 | # Create configured output |
Vishwanatha Subbanna | 6dc9668 | 2017-02-06 21:47:18 +0530 | [diff] [blame] | 156 | AC_CONFIG_FILES([Makefile test/Makefile softoff/Makefile softoff/test/Makefile]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 157 | AC_OUTPUT |