blob: 12e6b0fa2427149f7daea91150db68ba201543c3 [file] [log] [blame]
Andrew Jeffery2c07f6f2018-08-10 16:24:32 +09301# SPDX-License-Identifier: Apache-2.0
2# Copyright (C) 2018 IBM Corp.
3
4# Initialization
5AC_PREREQ([2.69])
6AC_INIT([openpower-host-ipmi-flash], [1.0], [])
7AC_CONFIG_HEADERS([config.h])
8AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
9AM_SILENT_RULES([yes])
Patrick Venturec000f2d2018-10-29 19:05:44 -070010AC_LANG([C++])
Andrew Jeffery2c07f6f2018-08-10 16:24:32 +093011
12# Checks for programs.
13AC_PROG_CXX
14AM_PROG_AR
15AC_PROG_INSTALL
16AC_PROG_MAKE_SET
17
18# Checks for libraries.
19PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
20
21# Checks for header files.
22AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
23AC_CHECK_HEADER(host-ipmid/ipmid-api.h, ,[AC_MSG_ERROR([Could not find host-ipmid/ipmid-api.h...host-ipmid package required])])
24PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\
25 AC_MSG_ERROR(["Requires sdbusplus package."]))
26PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
27 AC_MSG_ERROR(["Requires phosphor-logging package."]))
28
29# Check for sdbus++ tool
30AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
31AS_IF([test "x$SDBUSPLUSPLUS" == "x"], AC_MSG_ERROR([Cannot find sdbus++]))
32
33# Checks for typedefs, structures, and compiler characteristics.
34AX_CXX_COMPILE_STDCXX(14, [noext])
35AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
36
37# Checks for library functions.
38LT_INIT([disable-static shared])
39
40# Check/set gtest specific functions.
41AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-GTEST_HAS_PTHREAD=0"])
42AC_SUBST(GTEST_CPPFLAGS)
43
44AC_ARG_ENABLE([oe-sdk],
45 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
46)
47AC_ARG_VAR(OECORE_TARGET_SYSROOT,
48 [Path to the OE SDK SYSROOT])
49AS_IF([test "x$enable_oe_sdk" == "xyes"],
50 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
51 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
52 )
53 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
54 [
55 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
56 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
57 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
58 ]
59 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
60)
61
62# Service dbus object manager
63AC_ARG_VAR(HIOMAPD_OBJ_PATH, [The Control Host D-Bus Object Manager])
64AS_IF([test "x$HIOMAPD_OBJ_PATH" == "x"],
65 [CONTROL_HOST_OBJ_MGR="/xyz/openbmc_project/hiomapd"])
66AC_DEFINE_UNQUOTED([HIOMAPD_OBJ_PATH], ["$HIOMAPD_OBJ_PATH"], [The Control Host D-Bus Object Manager])
67
68# Create configured output.
69AC_CONFIG_FILES([Makefile])
70AC_OUTPUT