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])]) |
Matthew Barth | 70dbc58 | 2016-09-20 10:16:52 -0500 | [diff] [blame] | 22 | |
| 23 | # Checks for typedefs, structures, and compiler characteristics. |
| 24 | AX_CXX_COMPILE_STDCXX(14, [noext]) |
| 25 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 26 | |
| 27 | # Checks for library functions. |
| 28 | LT_INIT([disable-static shared]) |
| 29 | |
| 30 | # Check/set gtest specific functions. |
| 31 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-GTEST_HAS_PTHREAD=0"]) |
| 32 | AC_SUBST(GTEST_CPPFLAGS) |
| 33 | |
| 34 | AC_ARG_ENABLE([oe-sdk], |
| 35 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 36 | ) |
| 37 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 38 | [Path to the OE SDK SYSROOT]) |
| 39 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 40 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 41 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 42 | ) |
| 43 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 44 | [ |
| 45 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 46 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 47 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 48 | ] |
| 49 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 50 | ) |
| 51 | |
Vishwanatha Subbanna | 0765506 | 2017-07-14 20:31:57 +0530 | [diff] [blame] | 52 | # Host object name in the D-Bus |
| 53 | AC_ARG_VAR(HOST_NAME, [The Host name in the object path]) |
| 54 | AS_IF([test "x$HOST_NAME" == "x"], |
| 55 | [HOST_NAME="host"]) |
| 56 | AC_DEFINE_UNQUOTED([HOST_NAME], ["$HOST_NAME"], [The Host name in the object path]) |
| 57 | |
| 58 | # Service dbus object manager |
| 59 | AC_ARG_VAR(CONTROL_HOST_OBJ_MGR, [The Control Host D-Bus Object Manager]) |
| 60 | AS_IF([test "x$CONTROL_HOST_OBJ_MGR" == "x"], |
| 61 | [CONTROL_HOST_OBJ_MGR="/org/open_power/control"]) |
| 62 | AC_DEFINE_UNQUOTED([CONTROL_HOST_OBJ_MGR], ["$CONTROL_HOST_OBJ_MGR"], [The Control Host D-Bus Object Manager]) |
| 63 | |
Matthew Barth | 70dbc58 | 2016-09-20 10:16:52 -0500 | [diff] [blame] | 64 | # Create configured output. |
| 65 | AC_CONFIG_FILES([Makefile]) |
| 66 | AC_OUTPUT |