blob: 28719bdabd05ecb3d816b8c4286ccfdec8f77025 [file] [log] [blame]
Matt Spinlerd82a5f42017-07-24 13:40:37 -05001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([witherspoon-pfault-analysis], [1.0],
4[https://github.com/openbmc/witherspoon-pfault-analysis/issues])
5AC_LANG([C++])
6AC_CONFIG_HEADERS([config.h])
7AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
8AM_SILENT_RULES([yes])
9
10# Checks for programs.
11AC_PROG_CXX
12AM_PROG_AR
13AC_PROG_INSTALL
14AC_PROG_MAKE_SET
15
16# Checks for typedefs, structures, and compiler characteristics.
17AX_CXX_COMPILE_STDCXX_14([noext])
18AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
19
Matt Spinleree7adb72017-08-21 15:17:19 -050020# Download gpio.h from github if necessary.
21AC_CHECK_HEADER(linux/gpio.h,[HAVE_LINUX_GPIO_H=""],[HAVE_LINUX_GPIO_H="-I linux/gpio.h"])
22AS_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 Spinlerd82a5f42017-07-24 13:40:37 -050027PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,
28 AC_MSG_ERROR(["Requires sdbusplus package."]))
29PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
30 AC_MSG_ERROR(["Requires phosphor-logging package."]))
31PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\
32 AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
Matt Spinler84cd0a52017-08-04 08:53:30 -050033# Check for sdbus++
34AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
35AS_IF([test "x$SDBUSPLUSPLUS" == "x"],
36 AC_MSG_ERROR(["Requires sdbus++"]))
Matt Spinlerd82a5f42017-07-24 13:40:37 -050037
38# Checks for library functions.
39LT_INIT # Required for systemd linking
40
41# Create configured output
Matt Spinlerafb39132017-08-14 13:53:07 -050042AC_CONFIG_FILES([Makefile power-sequencer/Makefile])
Matt Spinlerd82a5f42017-07-24 13:40:37 -050043AC_OUTPUT