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