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])]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 29 | |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 30 | AS_IF([test "x$enable_softoff" != "xno"], |
| 31 | # Check for sdbusplus |
| 32 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR(["sdbusplus packaged required and not found"])]) |
| 33 | |
| 34 | # Check for sdbus++ tool |
| 35 | [AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])] |
| 36 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 37 | AC_MSG_ERROR([Cannot find sdbus++])) |
| 38 | ) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 39 | |
| 40 | # Checks for typedefs, structures, and compiler characteristics. |
Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 41 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 42 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS]) |
| 43 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 44 | |
| 45 | # Checks for library functions. |
Patrick Williams | 686df74 | 2016-09-02 17:52:59 -0500 | [diff] [blame] | 46 | LT_INIT([dlopen disable-static shared]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 47 | LT_LIB_DLLOAD |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 48 | |
Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 49 | # Check/set gtest specific functions. |
| 50 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 51 | AC_SUBST(GTEST_CPPFLAGS) |
| 52 | |
| 53 | AC_ARG_ENABLE([oe-sdk], |
| 54 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 55 | ) |
| 56 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 57 | [Path to the OE SDK SYSROOT]) |
| 58 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 59 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 60 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 61 | ) |
| 62 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 63 | [ |
| 64 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 65 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 66 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 67 | ] |
| 68 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 69 | ) |
| 70 | |
Tom Joseph | 51cb8ee | 2017-02-21 16:22:33 +0530 | [diff] [blame] | 71 | AC_ARG_VAR(WHITELIST_CONF, [Paths to IPMI whitelisted commands conf files. (default = ${srcdir}/host-ipmid-whitelist.conf)]) |
| 72 | if test -z "$WHITELIST_CONF"; then |
| 73 | WHITELIST_CONF=${srcdir}/host-ipmid-whitelist.conf |
| 74 | fi |
| 75 | |
Ratan Gupta | 28c2e73 | 2017-03-04 08:53:52 +0530 | [diff] [blame] | 76 | AS_IF([test "x$SENSOR_YAML_GEN" == "x"], [SENSOR_YAML_GEN="sensor-example.yaml"]) |
| 77 | SENSORGEN="$PYTHON ${srcdir}/scripts/sensor_gen.py -i $SENSOR_YAML_GEN" |
| 78 | AC_SUBST(SENSORGEN) |
| 79 | |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 80 | # Soft Power off related. |
| 81 | AS_IF([test "x$enable_softoff" != "xno"], |
| 82 | # Dbus service name |
| 83 | [AC_ARG_VAR(SOFTOFF_BUSNAME, [The Dbus busname to own])] |
| 84 | AS_IF([test "x$SOFTOFF_BUSNAME" == "x"], |
| 85 | [SOFTOFF_BUSNAME="xyz.openbmc_project.Ipmi.Internal.SoftPowerOff"]) |
| 86 | [AC_DEFINE_UNQUOTED([SOFTOFF_BUSNAME], ["$SOFTOFF_BUSNAME"], [The Dbus busname to own])] |
| 87 | |
| 88 | # Service dbus root |
| 89 | [AC_ARG_VAR(SOFTOFF_OBJPATH, [The SoftPowerOff Dbus root])] |
| 90 | AS_IF([test "x$SOFTOFF_OBJPATH" == "x"], |
Vishwanatha Subbanna | b891a57 | 2017-03-31 11:34:48 +0530 | [diff] [blame] | 91 | [SOFTOFF_OBJPATH="/xyz/openbmc_project/ipmi/internal/soft_power_off"]) |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 92 | [AC_DEFINE_UNQUOTED([SOFTOFF_OBJPATH], ["$SOFTOFF_OBJPATH"], [The SoftPowerOff Dbus root])] |
Vishwanatha Subbanna | d27e71e | 2017-02-01 18:02:38 +0530 | [diff] [blame] | 93 | |
| 94 | # Timeouts in SECONDS for SoftPowerOff protocol |
| 95 | [AC_ARG_VAR(IPMI_SMS_ATN_ACK_TIMEOUT_SECS, [Initial timeout for host to ack SMS_ATN from BMC])] |
| 96 | [AC_DEFINE_UNQUOTED([IPMI_SMS_ATN_ACK_TIMEOUT_SECS], [3], [Initial timeout for host to ack SMS_ATN from BMC])] |
Vishwanatha Subbanna | 31272b8 | 2017-02-01 18:53:14 +0530 | [diff] [blame] | 97 | |
| 98 | [AC_ARG_VAR(IPMI_HOST_SHUTDOWN_COMPLETE_TIMEOUT_SECS, [Wait time until Host can quiesce])] |
| 99 | [AC_DEFINE_UNQUOTED([IPMI_HOST_SHUTDOWN_COMPLETE_TIMEOUT_SECS], [45*60], [Wait time until Host can quiesce])] |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 100 | ) |
| 101 | |
Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 102 | # Create configured output |
Vishwanatha Subbanna | 6dc9668 | 2017-02-06 21:47:18 +0530 | [diff] [blame] | 103 | AC_CONFIG_FILES([Makefile test/Makefile softoff/Makefile softoff/test/Makefile]) |
Matthew Barth | 3cff7ed | 2016-07-27 14:50:51 -0500 | [diff] [blame] | 104 | AC_OUTPUT |