Matt Spinler | d82a5f4 | 2017-07-24 13:40:37 -0500 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([witherspoon-pfault-analysis], [1.0], |
| 4 | [https://github.com/openbmc/witherspoon-pfault-analysis/issues]) |
| 5 | AC_LANG([C++]) |
| 6 | AC_CONFIG_HEADERS([config.h]) |
| 7 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 8 | AM_SILENT_RULES([yes]) |
| 9 | |
| 10 | # Checks for programs. |
| 11 | AC_PROG_CXX |
| 12 | AM_PROG_AR |
| 13 | AC_PROG_INSTALL |
| 14 | AC_PROG_MAKE_SET |
| 15 | |
| 16 | # Checks for typedefs, structures, and compiler characteristics. |
| 17 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 18 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 19 | |
Matt Spinler | ee7adb7 | 2017-08-21 15:17:19 -0500 | [diff] [blame] | 20 | # Download gpio.h from github if necessary. |
| 21 | AC_CHECK_HEADER(linux/gpio.h,[HAVE_LINUX_GPIO_H=""],[HAVE_LINUX_GPIO_H="-I linux/gpio.h"]) |
| 22 | AS_IF([test "$HAVE_LINUX_GPIO_H" != ""], |
| 23 | AC_MSG_WARN([Could not find linux/gpio.h: Attempting to download locally for building from https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/gpio.h]) |
| 24 | AC_SUBST([BT_BMC_DL],[`mkdir -p linux;wget https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/gpio.h -O linux/gpio.h`]) |
| 25 | ) |
| 26 | |
Matt Spinler | d82a5f4 | 2017-07-24 13:40:37 -0500 | [diff] [blame] | 27 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, |
| 28 | AC_MSG_ERROR(["Requires sdbusplus package."])) |
| 29 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\ |
| 30 | AC_MSG_ERROR(["Requires phosphor-logging package."])) |
| 31 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\ |
| 32 | AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."])) |
Matt Spinler | 84cd0a5 | 2017-08-04 08:53:30 -0500 | [diff] [blame] | 33 | # Check for sdbus++ |
| 34 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 35 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], |
| 36 | AC_MSG_ERROR(["Requires sdbus++"])) |
Matt Spinler | d82a5f4 | 2017-07-24 13:40:37 -0500 | [diff] [blame] | 37 | |
| 38 | # Checks for library functions. |
| 39 | LT_INIT # Required for systemd linking |
| 40 | |
Matt Spinler | 45a054a | 2017-08-22 15:07:07 -0500 | [diff] [blame^] | 41 | AC_ARG_ENABLE([turn-off-ucd90160-access], |
| 42 | AS_HELP_STRING([--enable-turn-off-ucd90160-access], [Turn off UCD90160 hardware access]) |
| 43 | ) |
| 44 | |
| 45 | AC_ARG_VAR(UCD90160_DEVICE_ACCESS, [Turn off UCD90160 hardware access]) |
| 46 | |
| 47 | # Always define UCD90160_DEVICE_ACCESS unless explicitly turned off |
| 48 | AS_IF([test "x$enable_turn_off_ucd90160_access" != "xyes"], |
| 49 | [UCD90160_DEVICE_ACCESS="yes"] |
| 50 | AC_DEFINE_UNQUOTED([UCD90160_DEVICE_ACCESS], ["$UCD90160_DEVICE_ACCESS"], [Turn off UCD90160 hardware access]) |
| 51 | ) |
| 52 | |
Matt Spinler | d82a5f4 | 2017-07-24 13:40:37 -0500 | [diff] [blame] | 53 | # Create configured output |
Matt Spinler | afb3913 | 2017-08-14 13:53:07 -0500 | [diff] [blame] | 54 | AC_CONFIG_FILES([Makefile power-sequencer/Makefile]) |
Matt Spinler | d82a5f4 | 2017-07-24 13:40:37 -0500 | [diff] [blame] | 55 | AC_OUTPUT |