Andrew Jeffery | 2c07f6f | 2018-08-10 16:24:32 +0930 | [diff] [blame] | 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | # Copyright (C) 2018 IBM Corp. |
| 3 | |
| 4 | # Initialization |
| 5 | AC_PREREQ([2.69]) |
| 6 | AC_INIT([openpower-host-ipmi-flash], [1.0], []) |
| 7 | AC_CONFIG_HEADERS([config.h]) |
| 8 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 9 | AM_SILENT_RULES([yes]) |
Patrick Venture | c000f2d | 2018-10-29 19:05:44 -0700 | [diff] [blame^] | 10 | AC_LANG([C++]) |
Andrew Jeffery | 2c07f6f | 2018-08-10 16:24:32 +0930 | [diff] [blame] | 11 | |
| 12 | # Checks for programs. |
| 13 | AC_PROG_CXX |
| 14 | AM_PROG_AR |
| 15 | AC_PROG_INSTALL |
| 16 | AC_PROG_MAKE_SET |
| 17 | |
| 18 | # Checks for libraries. |
| 19 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
| 20 | |
| 21 | # Checks for header files. |
| 22 | AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])]) |
| 23 | AC_CHECK_HEADER(host-ipmid/ipmid-api.h, ,[AC_MSG_ERROR([Could not find host-ipmid/ipmid-api.h...host-ipmid package required])]) |
| 24 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\ |
| 25 | AC_MSG_ERROR(["Requires sdbusplus package."])) |
| 26 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\ |
| 27 | AC_MSG_ERROR(["Requires phosphor-logging package."])) |
| 28 | |
| 29 | # Check for sdbus++ tool |
| 30 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 31 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], AC_MSG_ERROR([Cannot find sdbus++])) |
| 32 | |
| 33 | # Checks for typedefs, structures, and compiler characteristics. |
| 34 | AX_CXX_COMPILE_STDCXX(14, [noext]) |
| 35 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 36 | |
| 37 | # Checks for library functions. |
| 38 | LT_INIT([disable-static shared]) |
| 39 | |
| 40 | # Check/set gtest specific functions. |
| 41 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-GTEST_HAS_PTHREAD=0"]) |
| 42 | AC_SUBST(GTEST_CPPFLAGS) |
| 43 | |
| 44 | AC_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 | ) |
| 47 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 48 | [Path to the OE SDK SYSROOT]) |
| 49 | AS_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 |
| 63 | AC_ARG_VAR(HIOMAPD_OBJ_PATH, [The Control Host D-Bus Object Manager]) |
| 64 | AS_IF([test "x$HIOMAPD_OBJ_PATH" == "x"], |
| 65 | [CONTROL_HOST_OBJ_MGR="/xyz/openbmc_project/hiomapd"]) |
| 66 | AC_DEFINE_UNQUOTED([HIOMAPD_OBJ_PATH], ["$HIOMAPD_OBJ_PATH"], [The Control Host D-Bus Object Manager]) |
| 67 | |
| 68 | # Create configured output. |
| 69 | AC_CONFIG_FILES([Makefile]) |
| 70 | AC_OUTPUT |