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]) |
William A. Kennington III | 5023aa9 | 2019-04-04 18:00:09 -0700 | [diff] [blame] | 5 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Wno-portability -Werror foreign dist-xz]) |
Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 6 | AM_SILENT_RULES([yes]) |
Patrick Venture | 98c7bfc | 2018-10-29 18:43:35 -0700 | [diff] [blame] | 7 | AC_LANG([C++]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 8 | |
William A. Kennington III | 5023aa9 | 2019-04-04 18:00:09 -0700 | [diff] [blame] | 9 | # Make sure the default CFLAGS of `-O2 -g` don't override CODE_COVERAGE_CFLAGS |
| 10 | # It is important that this comes before AC_PROG_C{C,XX}, as we are attempting |
| 11 | # to stop them from populating default CFLAGS and CXXFLAGS. |
| 12 | AS_IF([test "x$enable_code_coverage" != "xno"], [ |
| 13 | AS_IF([test "x${CXXFLAGS+set}" != "xset"], [ |
| 14 | AC_SUBST(CXXFLAGS, [""]) |
| 15 | ]) |
| 16 | AS_IF([test "x${CFLAGS+set}" != "xset"], [ |
| 17 | AC_SUBST(CFLAGS, [""]) |
| 18 | ]) |
| 19 | ]) |
| 20 | |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 21 | # Checks for programs. |
| 22 | AC_PROG_CXX |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 23 | AC_PROG_CC |
Patrick Williams | 686df74 | 2016-09-02 17:52:59 -0500 | [diff] [blame] | 24 | AM_PROG_AR |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 25 | AC_PROG_INSTALL |
| 26 | AC_PROG_MAKE_SET |
| 27 | |
Yong Li | 5833cb6 | 2019-10-30 13:27:12 +0800 | [diff] [blame] | 28 | # Add an option to enable/disable safe mode in boot flags |
| 29 | AC_ARG_ENABLE([boot-flag-safe-mode-support], |
| 30 | AS_HELP_STRING([--disable-boot-flag-safe-mode-support], [Disable safe mode option in boot flags. [default=enable]]) |
| 31 | ) |
| 32 | AS_IF([test "x$enable_boot_flag_safe_mode_support" != "xno"], |
| 33 | AC_MSG_NOTICE([Enabling safe mode option in boot flags]) |
Konstantin Aladyshev | 41aca83 | 2021-03-20 21:26:13 +0300 | [diff] [blame] | 34 | [cpp_flags="$cpp_flags -DENABLE_BOOT_FLAG_SAFE_MODE_SUPPORT"] |
Yong Li | 5833cb6 | 2019-10-30 13:27:12 +0800 | [diff] [blame] | 35 | AC_SUBST([CPPFLAGS], [$cpp_flags]), |
| 36 | AC_MSG_WARN([Disabling safe mode option in boot flags]) |
| 37 | ) |
| 38 | |
Yong Li | bd0503a | 2019-08-22 17:17:17 +0800 | [diff] [blame] | 39 | # Add an option to enable/disable i2c master write read command white list checking |
| 40 | AC_ARG_ENABLE([i2c-whitelist-check], |
| 41 | AS_HELP_STRING([--disable-i2c-whitelist-check], [Disable I2C master write read command white list check. [default=enable]]) |
| 42 | ) |
| 43 | AS_IF([test "x$enable_i2c_whitelist_check" != "xno"], |
| 44 | AC_MSG_NOTICE([Enabling I2C master write read command white list check]) |
Konstantin Aladyshev | 41aca83 | 2021-03-20 21:26:13 +0300 | [diff] [blame] | 45 | [cpp_flags="$cpp_flags -DENABLE_I2C_WHITELIST_CHECK"] |
Yong Li | bd0503a | 2019-08-22 17:17:17 +0800 | [diff] [blame] | 46 | AC_SUBST([CPPFLAGS], [$cpp_flags]), |
| 47 | AC_MSG_WARN([Disabling I2C master write read command white list check]) |
| 48 | ) |
| 49 | |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 50 | # softoff dir specific ones |
| 51 | AC_ARG_ENABLE([softoff], |
| 52 | AS_HELP_STRING([--enable-softoff], [Builds soft power off]) |
| 53 | ) |
| 54 | AS_IF([test "x$enable_softoff" != "xno"], |
| 55 | [AC_PROG_MKDIR_P] |
| 56 | [AC_CHECK_PROG([DIRNAME], dirname, dirname)] |
| 57 | ) |
| 58 | |
William A. Kennington III | 194375f | 2018-12-14 02:14:33 -0800 | [diff] [blame] | 59 | # Make sure the pkgconfigdata is configured for automake |
| 60 | PKG_INSTALLDIR |
| 61 | |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 62 | # Checks for libraries. |
Patrick Venture | 15bc918 | 2018-12-03 12:22:50 -0800 | [diff] [blame] | 63 | AC_CHECK_LIB([pam], [pam_start], [], [AC_MSG_ERROR([libpam not found])]) |
Matthew Barth | 80f714b | 2016-11-09 15:04:48 -0600 | [diff] [blame] | 64 | 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] | 65 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221], [], [AC_MSG_ERROR(["systemd required and not found"])]) |
Richard Marian Thomaiyar | 4654d99 | 2018-04-19 05:38:37 +0530 | [diff] [blame] | 66 | PKG_CHECK_MODULES([CRYPTO], [libcrypto >= 1.0.2g], ,[AC_MSG_ERROR([can't find openssl libcrypto])]) |
Patrick Venture | 6719586 | 2019-02-13 08:24:00 -0800 | [diff] [blame] | 67 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging]) |
| 68 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces]) |
| 69 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus]) |
Patrick Venture | 97c22e1 | 2019-02-12 07:39:02 -0800 | [diff] [blame] | 70 | AC_CHECK_HEADER(nlohmann/json.hpp, [], [AC_MSG_ERROR([Could not find nlohmann/json.hpp])]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 71 | |
William A. Kennington III | 047412c | 2018-12-10 15:26:19 -0800 | [diff] [blame] | 72 | AS_IF([test "x$enable_softoff" != "xno"], [ |
Patrick Venture | 6719586 | 2019-02-13 08:24:00 -0800 | [diff] [blame] | 73 | PKG_CHECK_MODULES([SDEVENTPLUS], [sdeventplus]) |
William A. Kennington III | 4f67cc3 | 2018-10-18 15:24:49 -0700 | [diff] [blame] | 74 | |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 75 | # Check for sdbus++ tool |
William A. Kennington III | 047412c | 2018-12-10 15:26:19 -0800 | [diff] [blame] | 76 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 77 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 78 | AC_MSG_ERROR([Cannot find sdbus++])) |
William A. Kennington III | 047412c | 2018-12-10 15:26:19 -0800 | [diff] [blame] | 79 | ]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 80 | |
| 81 | # Checks for typedefs, structures, and compiler characteristics. |
Patrick Williams | f53696e | 2022-04-15 10:13:53 -0500 | [diff] [blame] | 82 | AX_CXX_COMPILE_STDCXX([20], [noext], [mandatory]) |
Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 83 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS]) |
| 84 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 85 | |
| 86 | # Checks for library functions. |
Patrick Williams | 686df74 | 2016-09-02 17:52:59 -0500 | [diff] [blame] | 87 | LT_INIT([dlopen disable-static shared]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 88 | LT_LIB_DLLOAD |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 89 | |
Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 90 | # Check/set gtest specific functions. |
Peter Hanson | 4a58985 | 2017-06-07 17:40:45 -0700 | [diff] [blame] | 91 | PKG_CHECK_MODULES([GTEST], [gtest], [], [AC_MSG_NOTICE([gtest not found, tests will not build])]) |
| 92 | PKG_CHECK_MODULES([GTEST_MAIN], [gtest_main], [], [AC_MSG_NOTICE([gtest_main not found, tests will not build])]) |
Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 93 | |
| 94 | AC_ARG_ENABLE([oe-sdk], |
| 95 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 96 | ) |
| 97 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 98 | [Path to the OE SDK SYSROOT]) |
| 99 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 100 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 101 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 102 | ) |
| 103 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 104 | [ |
| 105 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 106 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 107 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 108 | ] |
| 109 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 110 | ) |
| 111 | |
Emily Shaffer | c07e72c | 2018-06-18 10:37:31 -0700 | [diff] [blame] | 112 | # Add code coverage tool |
| 113 | AX_CODE_COVERAGE |
William A. Kennington III | 5023aa9 | 2019-04-04 18:00:09 -0700 | [diff] [blame] | 114 | AS_IF([test "x$CODE_COVERAGE_ENABLED" = "xyes"], [ |
| 115 | AX_APPEND_COMPILE_FLAGS([-DHAVE_GCOV], [CODE_COVERAGE_CPPFLAGS]) |
| 116 | ]) |
| 117 | m4_ifdef([_AX_CODE_COVERAGE_RULES], |
| 118 | [AM_CONDITIONAL(AUTOCONF_CODE_COVERAGE_2019_01_06, [true])], |
| 119 | [AM_CONDITIONAL(AUTOCONF_CODE_COVERAGE_2019_01_06, [false])]) |
| 120 | AX_ADD_AM_MACRO_STATIC([]) |
| 121 | |
Emily Shaffer | c07e72c | 2018-06-18 10:37:31 -0700 | [diff] [blame] | 122 | |
Tom Joseph | 51cb8ee | 2017-02-21 16:22:33 +0530 | [diff] [blame] | 123 | AC_ARG_VAR(WHITELIST_CONF, [Paths to IPMI whitelisted commands conf files. (default = ${srcdir}/host-ipmid-whitelist.conf)]) |
| 124 | if test -z "$WHITELIST_CONF"; then |
| 125 | WHITELIST_CONF=${srcdir}/host-ipmid-whitelist.conf |
| 126 | fi |
| 127 | |
Brad Bishop | 2a5d8d1 | 2019-06-06 21:43:56 -0400 | [diff] [blame] | 128 | AS_IF([test "x$SENSOR_YAML_GEN" == "x"], [SENSOR_YAML_GEN="$srcdir/scripts/sensor-example.yaml"]) |
Ratan Gupta | 28c2e73 | 2017-03-04 08:53:52 +0530 | [diff] [blame] | 129 | SENSORGEN="$PYTHON ${srcdir}/scripts/sensor_gen.py -i $SENSOR_YAML_GEN" |
Vernon Mauery | 5f7ac71 | 2019-04-30 11:19:08 -0700 | [diff] [blame] | 130 | AC_SUBST(SENSOR_YAML_GEN) |
Ratan Gupta | 28c2e73 | 2017-03-04 08:53:52 +0530 | [diff] [blame] | 131 | AC_SUBST(SENSORGEN) |
| 132 | |
Brad Bishop | 2a5d8d1 | 2019-06-06 21:43:56 -0400 | [diff] [blame] | 133 | AS_IF([test "x$INVSENSOR_YAML_GEN" == "x"], [INVSENSOR_YAML_GEN="$srcdir/scripts/inventory-sensor-example.yaml"]) |
Tom Joseph | e19540e | 2019-02-04 14:06:58 +0530 | [diff] [blame] | 134 | INVSENSORGEN="$PYTHON ${srcdir}/scripts/inventory-sensor.py -i $INVSENSOR_YAML_GEN" |
Vernon Mauery | 5f7ac71 | 2019-04-30 11:19:08 -0700 | [diff] [blame] | 135 | AC_SUBST(INVSENSOR_YAML_GEN) |
Tom Joseph | e19540e | 2019-02-04 14:06:58 +0530 | [diff] [blame] | 136 | AC_SUBST(INVSENSORGEN) |
| 137 | |
Brad Bishop | 2a5d8d1 | 2019-06-06 21:43:56 -0400 | [diff] [blame] | 138 | AS_IF([test "x$FRU_YAML_GEN" == "x"], [FRU_YAML_GEN="$srcdir/scripts/fru-read-example.yaml"]) |
Marri Devender Rao | a62bacc | 2017-06-04 23:40:16 -0500 | [diff] [blame] | 139 | FRUGEN="$PYTHON $srcdir/scripts/fru_gen.py -i $FRU_YAML_GEN" |
Vernon Mauery | 5f7ac71 | 2019-04-30 11:19:08 -0700 | [diff] [blame] | 140 | AC_SUBST(FRU_YAML_GEN) |
Marri Devender Rao | a62bacc | 2017-06-04 23:40:16 -0500 | [diff] [blame] | 141 | AC_SUBST(FRUGEN) |
| 142 | |
Brad Bishop | 2a5d8d1 | 2019-06-06 21:43:56 -0400 | [diff] [blame] | 143 | AS_IF([test "x$ENTITY_YAML_GEN" == "x"], [ENTITY_YAML_GEN="$srcdir/scripts/entity-example.yaml"]) |
Jaghathiswari Rankappagounder Natarajan | 9c11894 | 2019-02-12 13:22:55 -0800 | [diff] [blame] | 144 | ENTITYGEN="$PYTHON $srcdir/scripts/entity_gen.py -i $ENTITY_YAML_GEN" |
Vernon Mauery | 5f7ac71 | 2019-04-30 11:19:08 -0700 | [diff] [blame] | 145 | AC_SUBST(ENTITY_YAML_GEN) |
Jaghathiswari Rankappagounder Natarajan | 9c11894 | 2019-02-12 13:22:55 -0800 | [diff] [blame] | 146 | AC_SUBST(ENTITYGEN) |
| 147 | |
Tom Joseph | 6edc8a0 | 2017-06-30 18:52:56 +0530 | [diff] [blame] | 148 | AC_DEFINE(CALLOUT_FWD_ASSOCIATION, "callout", [The name of the callout's forward association.]) |
| 149 | AC_DEFINE(BOARD_SENSOR, "/xyz/openbmc_project/inventory/system/chassis/motherboard", [The inventory path to the motherboard fault sensor.]) |
| 150 | AC_DEFINE(SYSTEM_SENSOR, "/xyz/openbmc_project/inventory/system", [The inventory path to the system event sensor.]) |
| 151 | |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 152 | # Soft Power off related. |
| 153 | AS_IF([test "x$enable_softoff" != "xno"], |
| 154 | # Dbus service name |
| 155 | [AC_ARG_VAR(SOFTOFF_BUSNAME, [The Dbus busname to own])] |
| 156 | AS_IF([test "x$SOFTOFF_BUSNAME" == "x"], |
| 157 | [SOFTOFF_BUSNAME="xyz.openbmc_project.Ipmi.Internal.SoftPowerOff"]) |
| 158 | [AC_DEFINE_UNQUOTED([SOFTOFF_BUSNAME], ["$SOFTOFF_BUSNAME"], [The Dbus busname to own])] |
| 159 | |
| 160 | # Service dbus root |
| 161 | [AC_ARG_VAR(SOFTOFF_OBJPATH, [The SoftPowerOff Dbus root])] |
| 162 | AS_IF([test "x$SOFTOFF_OBJPATH" == "x"], |
Vishwanatha Subbanna | b891a57 | 2017-03-31 11:34:48 +0530 | [diff] [blame] | 163 | [SOFTOFF_OBJPATH="/xyz/openbmc_project/ipmi/internal/soft_power_off"]) |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 164 | [AC_DEFINE_UNQUOTED([SOFTOFF_OBJPATH], ["$SOFTOFF_OBJPATH"], [The SoftPowerOff Dbus root])] |
Vishwanatha Subbanna | d27e71e | 2017-02-01 18:02:38 +0530 | [diff] [blame] | 165 | |
| 166 | # Timeouts in SECONDS for SoftPowerOff protocol |
Andrew Geissler | 6fcdc21 | 2018-01-26 11:53:46 -0800 | [diff] [blame] | 167 | [AC_ARG_VAR(IPMI_SMS_ATN_ACK_TIMEOUT_SECS, \ |
| 168 | [Initial timeout for host to ack and query SMS_ATN from BMC])] |
Andrew Geissler | 8ba1d87 | 2021-05-03 13:06:35 -0500 | [diff] [blame] | 169 | [AC_DEFINE_UNQUOTED([IPMI_SMS_ATN_ACK_TIMEOUT_SECS], [3], \ |
Andrew Geissler | 6fcdc21 | 2018-01-26 11:53:46 -0800 | [diff] [blame] | 170 | [Timeout for host to ack and query SMS_ATN from BMC])] |
Vishwanatha Subbanna | 31272b8 | 2017-02-01 18:53:14 +0530 | [diff] [blame] | 171 | |
Andrew Geissler | 48ce072 | 2017-08-16 19:51:51 -0500 | [diff] [blame] | 172 | [AC_ARG_VAR(IPMI_HOST_SHUTDOWN_COMPLETE_TIMEOUT_SECS, [Wait time for host to shutdown])] |
| 173 | [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] | 174 | |
| 175 | # Indicates an in-band power off or reboot request from the host |
| 176 | # This file is used to ensure the soft off service does not run for host |
| 177 | # initiated shutdown or reboot requests |
| 178 | [AC_ARG_VAR(HOST_INBAND_REQUEST_DIR, [Directory used to indicate the host has initiated a shutdown or reboot])] |
| 179 | AS_IF([test "x$HOST_INBAND_REQUEST_DIR" == "x"], |
| 180 | [HOST_INBAND_REQUEST_DIR="/run/openbmc/"]) |
| 181 | [AC_DEFINE_UNQUOTED([HOST_INBAND_REQUEST_DIR], ["$HOST_INBAND_REQUEST_DIR"], [Directory to store host initiated shutdown file])] |
| 182 | |
| 183 | [AC_ARG_VAR(HOST_INBAND_REQUEST_FILE, [File which indicates the host has initiated a shutdown or reboot])] |
| 184 | AS_IF([test "x$HOST_INBAND_REQUEST_FILE" == "x"], |
| 185 | [HOST_INBAND_REQUEST_FILE="host@%u-request"]) |
| 186 | [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] | 187 | ) |
| 188 | |
Andrew Geissler | 62817fa9 | 2017-03-20 14:20:49 -0500 | [diff] [blame] | 189 | # Control Host Interfaces |
| 190 | # Dbus service name |
| 191 | AC_ARG_VAR(CONTROL_HOST_BUSNAME, [The Control Host Dbus busname to own]) |
| 192 | AS_IF([test "x$CONTROL_HOST_BUSNAME" == "x"], |
| 193 | [CONTROL_HOST_BUSNAME="xyz.openbmc_project.Control.Host"]) |
| 194 | AC_DEFINE_UNQUOTED([CONTROL_HOST_BUSNAME], ["$CONTROL_HOST_BUSNAME"], [The Control Host Dbus busname to own]) |
| 195 | |
Vishwanatha Subbanna | 3eb117a | 2017-07-12 16:13:49 +0530 | [diff] [blame] | 196 | # Host object name in the D-Bus |
| 197 | AC_ARG_VAR(HOST_NAME, [The Host name in the object path]) |
| 198 | AS_IF([test "x$HOST_NAME" == "x"], |
| 199 | [HOST_NAME="host"]) |
| 200 | AC_DEFINE_UNQUOTED([HOST_NAME], ["$HOST_NAME"], [The Host name in the object path]) |
| 201 | |
| 202 | # Service dbus object manager |
| 203 | AC_ARG_VAR(CONTROL_HOST_OBJ_MGR, [The Control Host D-Bus Object Manager]) |
| 204 | AS_IF([test "x$CONTROL_HOST_OBJ_MGR" == "x"], |
| 205 | [CONTROL_HOST_OBJ_MGR="/xyz/openbmc_project/control"]) |
| 206 | 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] | 207 | |
Marri Devender Rao | 66c5fda | 2018-01-18 10:48:37 -0600 | [diff] [blame] | 208 | # Power reading sensor configuration file |
| 209 | AC_ARG_VAR(POWER_READING_SENSOR, [Power reading sensor configuration file]) |
| 210 | AS_IF([test "x$POWER_READING_SENSOR" == "x"],[POWER_READING_SENSOR="/usr/share/ipmi-providers/power_reading.json"]) |
| 211 | AC_DEFINE_UNQUOTED([POWER_READING_SENSOR], ["$POWER_READING_SENSOR"], [Power reading sensor configuration file]) |
| 212 | |
Patrick Venture | 15e95f2 | 2018-11-14 19:25:08 -0800 | [diff] [blame] | 213 | AC_ARG_VAR(HOST_IPMI_LIB_PATH, [The file path to search for libraries.]) |
Vernon Mauery | 41c79e6 | 2019-02-04 15:54:28 -0800 | [diff] [blame] | 214 | AS_IF([test "x$HOST_IPMI_LIB_PATH" == "x"], [HOST_IPMI_LIB_PATH="/usr/lib/ipmid-providers/"]) |
Patrick Venture | 15e95f2 | 2018-11-14 19:25:08 -0800 | [diff] [blame] | 215 | AC_DEFINE_UNQUOTED([HOST_IPMI_LIB_PATH], ["$HOST_IPMI_LIB_PATH"], [The file path to search for libraries.]) |
| 216 | |
Brandon Kim | 9cf8562 | 2019-06-19 12:05:08 -0700 | [diff] [blame] | 217 | # When a sensor read fails, hwmon will update the OperationalState interface's Functional property. |
| 218 | # This will mark the sensor as not functional and we will skip reading from that sensor. |
| 219 | AC_ARG_ENABLE([update-functional-on-fail], |
| 220 | AS_HELP_STRING( |
| 221 | [--enable-update-functional-on-fail], |
| 222 | [Check functional property to skip reading from faulty sensors.] |
| 223 | ) |
| 224 | ) |
| 225 | |
| 226 | AC_ARG_VAR(UPDATE_FUNCTIONAL_ON_FAIL, [Check functional property to skip reading from faulty sensors.]) |
| 227 | AS_IF( |
| 228 | [test "x$enable_update_functional_on_fail" == "xyes"], |
| 229 | [UPDATE_FUNCTIONAL_ON_FAIL="yes"] |
| 230 | AC_DEFINE_UNQUOTED( |
| 231 | [UPDATE_FUNCTIONAL_ON_FAIL], |
| 232 | ["$UPDATE_FUNCTIONAL_ON_FAIL"], |
| 233 | [Check functional property to skip reading from faulty sensors.] |
| 234 | ) |
| 235 | ) |
| 236 | |
ofery | 61d8dcc | 2019-06-10 16:02:37 -0700 | [diff] [blame] | 237 | # When disable-libuserlayer flag is set, libuserlayer won't be included in the build. |
| 238 | AC_ARG_ENABLE([libuserlayer], |
| 239 | AS_HELP_STRING([--disable-libuserlayer], [Set a flag to exclude libuserlayer]) |
| 240 | ) |
| 241 | AM_CONDITIONAL(FEATURE_LIBUSERLAYER, [test "x$enable_libuserlayer" != "xno"]) |
| 242 | |
Johnathan Mantey | b87034e | 2019-09-16 10:50:50 -0700 | [diff] [blame] | 243 | # When enable-transport-oem flag is set, the transporthandler_oem.cpp contents |
| 244 | # are compiled and added to the project. The transporthandler_oem.cpp file is |
| 245 | # copied from your own customization layer in the |
| 246 | # phosphor-ipmi-host_%.bbappend file. It is not necessary to create this file |
| 247 | # unless OEM Parameter extensions are required. |
| 248 | AC_ARG_ENABLE([transport_oem], |
| 249 | [ --enable-transport-oem Enable/disable OEM Parameter extensions], |
| 250 | [case "${enableval}" in |
| 251 | yes) transport_oem=true ;; |
| 252 | no) transport_oem=false ;; |
| 253 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-transport_oem]) ;; |
| 254 | esac],[transport_oem=false] |
| 255 | ) |
| 256 | AM_CONDITIONAL([FEATURE_TRANSPORT_OEM], [test x$transport_oem = xtrue]) |
| 257 | |
Vernon Mauery | e9f8857 | 2020-01-30 16:11:34 -0800 | [diff] [blame] | 258 | # IPMI whitelist mechanism is not needed by everyone; offer a way to disable it |
| 259 | AC_ARG_ENABLE([ipmi-whitelist], |
| 260 | [ --enable-ipmi-whitelist Enable/disable IPMI whitelist filtering], |
| 261 | [case "${enableval}" in |
| 262 | yes) ipmi_whitelist=true ;; |
| 263 | no) ipmi_whitelist=false ;; |
| 264 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-ipmi-whitelist]) ;; |
| 265 | esac],[ipmi_whitelist=true] |
| 266 | ) |
| 267 | AM_CONDITIONAL([FEATURE_IPMI_WHITELIST], [test x$ipmi_whitelist = xtrue]) |
| 268 | |
Willy Tu | de54f48 | 2021-01-26 15:59:09 -0800 | [diff] [blame] | 269 | # Dynamic sensors stack is enabled by default; offer a way to disable it |
Willy Tu | 8f1b0b9 | 2021-08-04 21:50:33 +0000 | [diff] [blame] | 270 | AC_ARG_ENABLE([dynamic_sensors], |
| 271 | [ --enable-dynamic_sensors Enable/disable Dynamic Sensors stack], |
Willy Tu | de54f48 | 2021-01-26 15:59:09 -0800 | [diff] [blame] | 272 | [case "${enableval}" in |
Willy Tu | 8f1b0b9 | 2021-08-04 21:50:33 +0000 | [diff] [blame] | 273 | yes) dynamic_sensors=true ;; |
| 274 | no) dynamic_sensors=false ;; |
| 275 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-dynamic_sensors]) ;; |
| 276 | esac],[dynamic_sensors=true] |
Willy Tu | de54f48 | 2021-01-26 15:59:09 -0800 | [diff] [blame] | 277 | ) |
Willy Tu | 8f1b0b9 | 2021-08-04 21:50:33 +0000 | [diff] [blame] | 278 | AM_CONDITIONAL([FEATURE_DYNAMIC_SENSORS], [test x$dynamic_sensors = xtrue]) |
Willy Tu | de54f48 | 2021-01-26 15:59:09 -0800 | [diff] [blame] | 279 | |
Willy Tu | d351a72 | 2021-08-12 14:33:40 -0700 | [diff] [blame] | 280 | AS_IF([test x$dynamic_sensors = xtrue], |
| 281 | AC_MSG_NOTICE([Enabling dynamic sensors feature]) |
| 282 | [cpp_flags="$cpp_flags -DFEATURE_DYNAMIC_SENSORS"] |
| 283 | AC_SUBST([CPPFLAGS], [$cpp_flags]), |
| 284 | AC_MSG_WARN([Disabling dynamic sensors feature]) |
| 285 | ) |
| 286 | |
Scron Chang | 2703b02 | 2021-07-06 15:47:45 +0800 | [diff] [blame] | 287 | # hybrid sensors stack is disabled by default; offer a way to enable it |
| 288 | AC_ARG_ENABLE([hybrid-sensors], |
| 289 | [ --enable-hybrid-sensors Enable/disable Hybrid Sensors stack], |
| 290 | [case "${enableval}" in |
| 291 | yes) hybrid_sensors=true ;; |
| 292 | no) hybrid_sensors=false ;; |
| 293 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-hybrid-sensors]) ;; |
| 294 | esac],[hybrid-sensors=false] |
| 295 | ) |
| 296 | AM_CONDITIONAL([FEATURE_HYBRID_SENSORS], [test x$hybrid_sensors = xtrue]) |
| 297 | |
| 298 | AS_IF([test x$hybrid_sensors = xtrue], |
| 299 | AC_MSG_NOTICE([Enabling hybrid sensors stack]) |
| 300 | [cpp_flags="$cpp_flags -DFEATURE_HYBRID_SENSORS"] |
| 301 | AC_SUBST([CPPFLAGS], [$cpp_flags]), |
| 302 | AC_MSG_WARN([Disabling hybrid sensors feature]) |
| 303 | ) |
| 304 | |
Lei YU | 962e68b | 2021-09-16 16:25:34 +0800 | [diff] [blame] | 305 | # Sensor cache stack is disabled by default; offer a way to enable it |
| 306 | AC_ARG_ENABLE([sensors-cache], |
| 307 | [ --enable-sensors-cache Enable/disable sensors cache stack], |
| 308 | [case "${enableval}" in |
| 309 | yes) sensors_cache=true ;; |
| 310 | no) sensors_cache=false ;; |
| 311 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-sensors-cache]) ;; |
| 312 | esac],[sensors_cache=false] |
| 313 | ) |
| 314 | AM_CONDITIONAL([FEATURE_SENSORS_CACHE], [test x$sensors_cache= xtrue]) |
| 315 | |
| 316 | AS_IF([test x$sensors_cache = xtrue], |
| 317 | AC_MSG_NOTICE([Enabling sensors cache stack]) |
| 318 | [cpp_flags="$cpp_flags -DFEATURE_SENSORS_CACHE"] |
| 319 | AC_SUBST([CPPFLAGS], [$cpp_flags]), |
| 320 | AC_MSG_WARN([Disabling sensors cache feature]) |
| 321 | ) |
| 322 | |
Charles Boyer | 818bea1 | 2021-09-20 16:56:36 -0500 | [diff] [blame] | 323 | # Clearing SEL through sel-logger is disabled by default; offer a way to enable it |
| 324 | AC_ARG_ENABLE([sel_logger_clears_sel], |
| 325 | [ --enable-sel_logger_clears_sel Enable/disable sel-logger to Clear SEL], |
| 326 | [case "${enableval}" in |
| 327 | yes) sel_logger_clears_sel=true ;; |
| 328 | no) sel_logger_clears_sel=false ;; |
| 329 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-sel_logger_clears_sel]) ;; |
| 330 | esac],[sel_logger_clears_sel=false] |
| 331 | ) |
| 332 | AM_CONDITIONAL([FEATURE_SEL_LOGGER_CLEARS_SEL], [test x$sel_logger_clears_sel = xtrue]) |
| 333 | |
| 334 | AS_IF([test x$sel_logger_clears_sel = xtrue], |
| 335 | AC_MSG_NOTICE([Enabling sel-logger to Clear SEL]) |
| 336 | [cpp_flags="$cpp_flags -DFEATURE_SEL_LOGGER_CLEARS_SEL"] |
| 337 | AC_SUBST([CPPFLAGS], [$cpp_flags]), |
| 338 | AC_MSG_WARN([Disabling sel-logger to Clear SEL]) |
| 339 | ) |
| 340 | |
Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 341 | # Create configured output |
William A. Kennington III | 194375f | 2018-12-14 02:14:33 -0800 | [diff] [blame] | 342 | AC_CONFIG_FILES([ |
| 343 | Makefile |
| 344 | include/Makefile |
| 345 | libipmid/Makefile |
| 346 | libipmid/libipmid.pc |
| 347 | libipmid-host/Makefile |
| 348 | libipmid-host/libipmid-host.pc |
| 349 | softoff/Makefile |
| 350 | test/Makefile |
| 351 | user_channel/Makefile |
| 352 | ]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 353 | AC_OUTPUT |