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