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]) |
| 10 | |
| 11 | # Checks for programs. |
| 12 | AC_PROG_CXX |
| 13 | AM_PROG_AR |
| 14 | AC_PROG_INSTALL |
| 15 | AC_PROG_MAKE_SET |
| 16 | |
| 17 | # Checks for libraries. |
| 18 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
| 19 | |
| 20 | # Checks for header files. |
| 21 | AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])]) |
| 22 | AC_CHECK_HEADER(host-ipmid/ipmid-api.h, ,[AC_MSG_ERROR([Could not find host-ipmid/ipmid-api.h...host-ipmid package required])]) |
| 23 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\ |
| 24 | AC_MSG_ERROR(["Requires sdbusplus package."])) |
| 25 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\ |
| 26 | AC_MSG_ERROR(["Requires phosphor-logging package."])) |
| 27 | |
| 28 | # Check for sdbus++ tool |
| 29 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 30 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], AC_MSG_ERROR([Cannot find sdbus++])) |
| 31 | |
| 32 | # Checks for typedefs, structures, and compiler characteristics. |
| 33 | AX_CXX_COMPILE_STDCXX(14, [noext]) |
| 34 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 35 | |
| 36 | # Checks for library functions. |
| 37 | LT_INIT([disable-static shared]) |
| 38 | |
| 39 | # Check/set gtest specific functions. |
| 40 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-GTEST_HAS_PTHREAD=0"]) |
| 41 | AC_SUBST(GTEST_CPPFLAGS) |
| 42 | |
| 43 | AC_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 | ) |
| 46 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 47 | [Path to the OE SDK SYSROOT]) |
| 48 | AS_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 |
| 62 | AC_ARG_VAR(HIOMAPD_OBJ_PATH, [The Control Host D-Bus Object Manager]) |
| 63 | AS_IF([test "x$HIOMAPD_OBJ_PATH" == "x"], |
| 64 | [CONTROL_HOST_OBJ_MGR="/xyz/openbmc_project/hiomapd"]) |
| 65 | AC_DEFINE_UNQUOTED([HIOMAPD_OBJ_PATH], ["$HIOMAPD_OBJ_PATH"], [The Control Host D-Bus Object Manager]) |
| 66 | |
| 67 | # Create configured output. |
| 68 | AC_CONFIG_FILES([Makefile]) |
| 69 | AC_OUTPUT |