blob: 667b8cb3b5d2f446561e7835cc6727c399b977eb [file] [log] [blame]
Patrick Ventureaccc9172018-07-24 10:51:58 -07001
2# Initialization
3AC_PREREQ([2.69])
4AC_INIT([flash-ipmi], [1.0], [https://www.google.com])
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.
Patrick Venture004fb902018-09-10 13:08:48 -070017AX_CXX_COMPILE_STDCXX_17([noext])
Patrick Venture7dc46702018-08-08 09:43:33 -070018AX_APPEND_COMPILE_FLAGS([-Wall], [CXXFLAGS])
Patrick Ventureaccc9172018-07-24 10:51:58 -070019
20# Checks for libraries.
21PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221], [], [AC_MSG_ERROR(["systemd required and not found"])])
22PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], ,[AC_MSG_ERROR([The openbmc/sdbusplus package is required])])
23PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging], ,[AC_MSG_ERROR([The openbmc/phosphor-logging package is required])])
24PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces], [], [AC_MSG_ERROR(["phosphor-dbus-interfaces required and not found."])])
25AC_CHECK_HEADER([host-ipmid], [AC_MSG_ERROR(["phosphor-host-ipmid required and not found."])])
Patrick Venture7dc46702018-08-08 09:43:33 -070026AC_CHECK_HEADER(experimental/filesystem, ,[AC_MSG_ERROR([Could not find experimental/filesystem...libstdc++fs development package required])])
Patrick Ventureaccc9172018-07-24 10:51:58 -070027
28# Checks for library functions.
29LT_INIT # Required for systemd linking
30
31# Check/set gtest specific functions.
32PKG_CHECK_MODULES([GTEST], [gtest], [], [AC_MSG_NOTICE([gtest not found, tests will not build])])
33PKG_CHECK_MODULES([GMOCK], [gmock], [], [AC_MSG_NOTICE([gmock not found, tests will not build])])
34PKG_CHECK_MODULES([GTEST_MAIN], [gtest_main], [], [AC_MSG_NOTICE([gtest_main not found, tests will not build])])
35
36# Do you want to register as a Google OEM IPMI handler as well as firmware?
37AC_ARG_ENABLE([google],
38 AS_HELP_STRING([--enable-google], [Enable registration as Google OEM IPMI Handler])
39)
40
41AC_ARG_VAR(ENABLE_GOOGLE, [Enable registration as Google OEM IPMI Handler])
42
43AS_IF([test "x$enable_google" == "xyes"],
44 [ENABLE_GOOGLE="yes"]
45 AC_DEFINE_UNQUOTED([ENABLE_GOOGLE], ["$ENABLE_GOOGLE"], [Enable registration as Google OEM IPMI Handler])
46)
47
48# Add --enable-oe-sdk flag to configure script
49AC_ARG_ENABLE([oe-sdk],
50 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
51)
52
53# Check for OECORE_TARGET_SYSROOT in the environment.
54AC_ARG_VAR(OECORE_TARGET_SYSROOT,
55 [Path to the OE SDK SYSROOT])
56
57# Configure OESDK_TESTCASE_FLAGS environment variable, which will be later
58# used in test/Makefile.am
59AS_IF([test "x$enable_oe_sdk" == "xyes"],
60 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
61 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
62 )
63 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
64 [
65 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
66 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
67 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
68 ]
69 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
70)
71
Patrick Venture8ec019f2018-08-07 11:22:33 -070072AC_ARG_VAR(STAGING_PATH, [The staging path for the flash image.])
73AS_IF([test "x$STAGING_PATH" == "x"], [STAGING_PATH="/run/initramfs/bmc-image"])
74AC_DEFINE_UNQUOTED([STAGING_PATH], ["$STAGING_PATH"], [The staging path for the flash image.])
75
Patrick Venture6f17bd22018-08-07 13:24:17 -070076AC_ARG_VAR(HASH_PATH, [The path for the hash file.])
77AS_IF([test "x$HASH_PATH" == "x"], [HASH_PATH="/tmp/bmc.sig"])
78AC_DEFINE_UNQUOTED([HASH_PATH], ["$HASH_PATH"], [The path for the hash file.])
79
Patrick Venturefdc65b22018-08-07 14:37:58 -070080AC_ARG_VAR(STATUS_PATH, [The path for the verification status file.])
81AS_IF([test "x$STATUS_PATH" == "x"], [STATUS_PATH="/tmp/bmc.verify"])
82AC_DEFINE_UNQUOTED([STATUS_PATH], ["$STATUS_PATH"], [The path for the verification status file.])
83
Patrick Ventureaccc9172018-07-24 10:51:58 -070084# Create configured output
Patrick Venture7dc46702018-08-08 09:43:33 -070085AC_CONFIG_FILES([Makefile test/Makefile tools/Makefile tools/test/Makefile])
Patrick Ventureaccc9172018-07-24 10:51:58 -070086AC_OUTPUT