blob: dd05a59843b3c7db53c1afbe9ba7b5cb8c0dcbe0 [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.
17AX_CXX_COMPILE_STDCXX_14([noext])
18AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
19
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."])])
26
27# Checks for library functions.
28LT_INIT # Required for systemd linking
29
30# Check/set gtest specific functions.
31PKG_CHECK_MODULES([GTEST], [gtest], [], [AC_MSG_NOTICE([gtest not found, tests will not build])])
32PKG_CHECK_MODULES([GMOCK], [gmock], [], [AC_MSG_NOTICE([gmock not found, tests will not build])])
33PKG_CHECK_MODULES([GTEST_MAIN], [gtest_main], [], [AC_MSG_NOTICE([gtest_main not found, tests will not build])])
34
35# Do you want to register as a Google OEM IPMI handler as well as firmware?
36AC_ARG_ENABLE([google],
37 AS_HELP_STRING([--enable-google], [Enable registration as Google OEM IPMI Handler])
38)
39
40AC_ARG_VAR(ENABLE_GOOGLE, [Enable registration as Google OEM IPMI Handler])
41
42AS_IF([test "x$enable_google" == "xyes"],
43 [ENABLE_GOOGLE="yes"]
44 AC_DEFINE_UNQUOTED([ENABLE_GOOGLE], ["$ENABLE_GOOGLE"], [Enable registration as Google OEM IPMI Handler])
45)
46
47# Add --enable-oe-sdk flag to configure script
48AC_ARG_ENABLE([oe-sdk],
49 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
50)
51
52# Check for OECORE_TARGET_SYSROOT in the environment.
53AC_ARG_VAR(OECORE_TARGET_SYSROOT,
54 [Path to the OE SDK SYSROOT])
55
56# Configure OESDK_TESTCASE_FLAGS environment variable, which will be later
57# used in test/Makefile.am
58AS_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
Patrick Venture8ec019f2018-08-07 11:22:33 -070071AC_ARG_VAR(STAGING_PATH, [The staging path for the flash image.])
72AS_IF([test "x$STAGING_PATH" == "x"], [STAGING_PATH="/run/initramfs/bmc-image"])
73AC_DEFINE_UNQUOTED([STAGING_PATH], ["$STAGING_PATH"], [The staging path for the flash image.])
74
Patrick Ventureaccc9172018-07-24 10:51:58 -070075# Create configured output
Patrick Venture54c3b532018-08-01 11:45:49 -070076AC_CONFIG_FILES([Makefile test/Makefile])
Patrick Ventureaccc9172018-07-24 10:51:58 -070077AC_OUTPUT