Matthew Barth | 70dbc58 | 2016-09-20 10:16:52 -0500 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([openpower-host-ipmi-oem], [1.0], [https://github.com/openbmc/openpower-host-ipmi-oem/issues]) |
| 4 | AC_CONFIG_HEADERS([config.h]) |
| 5 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 6 | AM_SILENT_RULES([yes]) |
Patrick Venture | 5dd0c1b | 2018-10-29 18:57:00 -0700 | [diff] [blame^] | 7 | AC_LANG([C++]) |
Matthew Barth | 70dbc58 | 2016-09-20 10:16:52 -0500 | [diff] [blame] | 8 | |
| 9 | # Checks for programs. |
| 10 | AC_PROG_CXX |
| 11 | AM_PROG_AR |
| 12 | AC_PROG_INSTALL |
| 13 | AC_PROG_MAKE_SET |
| 14 | |
| 15 | # Checks for libraries. |
| 16 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
| 17 | |
| 18 | # Checks for header files. |
| 19 | AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])]) |
| 20 | AC_CHECK_HEADER(host-ipmid/ipmid-api.h, ,[AC_MSG_ERROR([Could not find host-ipmid/ipmid-api.h...host-ipmid package required])]) |
Vishwanatha Subbanna | 0765506 | 2017-07-14 20:31:57 +0530 | [diff] [blame] | 21 | PKG_CHECK_MODULES([OPENPOWER_DBUS_INTERFACES], [openpower-dbus-interfaces],, |
| 22 | [AC_MSG_ERROR([Could not find openpower-dbus-interfaces...openbmc/openpower-dbus-interfaces package required])]) |
Tom Joseph | 56c534b | 2017-10-17 12:38:42 +0530 | [diff] [blame] | 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++])) |
Matthew Barth | 70dbc58 | 2016-09-20 10:16:52 -0500 | [diff] [blame] | 31 | |
| 32 | # Checks for typedefs, structures, and compiler characteristics. |
Vernon Mauery | d6c7b2e | 2018-10-04 10:29:19 -0700 | [diff] [blame] | 33 | AX_CXX_COMPILE_STDCXX_17([noext]) |
Matthew Barth | 70dbc58 | 2016-09-20 10:16:52 -0500 | [diff] [blame] | 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 | |
Vishwanatha Subbanna | 0765506 | 2017-07-14 20:31:57 +0530 | [diff] [blame] | 61 | # Host object name in the D-Bus |
| 62 | AC_ARG_VAR(HOST_NAME, [The Host name in the object path]) |
| 63 | AS_IF([test "x$HOST_NAME" == "x"], |
| 64 | [HOST_NAME="host"]) |
| 65 | AC_DEFINE_UNQUOTED([HOST_NAME], ["$HOST_NAME"], [The Host name in the object path]) |
| 66 | |
| 67 | # Service dbus object manager |
| 68 | AC_ARG_VAR(CONTROL_HOST_OBJ_MGR, [The Control Host D-Bus Object Manager]) |
| 69 | AS_IF([test "x$CONTROL_HOST_OBJ_MGR" == "x"], |
| 70 | [CONTROL_HOST_OBJ_MGR="/org/open_power/control"]) |
| 71 | AC_DEFINE_UNQUOTED([CONTROL_HOST_OBJ_MGR], ["$CONTROL_HOST_OBJ_MGR"], [The Control Host D-Bus Object Manager]) |
| 72 | |
Matt Spinler | 34aca01 | 2018-09-25 11:21:06 -0500 | [diff] [blame] | 73 | AC_DEFINE(MAPPER_BUS_NAME, "xyz.openbmc_project.ObjectMapper", |
| 74 | [The object mapper bus name]) |
| 75 | |
| 76 | AC_DEFINE(MAPPER_OBJ, "/xyz/openbmc_project/object_mapper", |
| 77 | [The object mapper object path]) |
| 78 | |
| 79 | AC_DEFINE(MAPPER_IFACE, "xyz.openbmc_project.ObjectMapper", |
| 80 | [The object mapper interface]) |
| 81 | |
Matthew Barth | 70dbc58 | 2016-09-20 10:16:52 -0500 | [diff] [blame] | 82 | # Create configured output. |
| 83 | AC_CONFIG_FILES([Makefile]) |
| 84 | AC_OUTPUT |