Brad Bishop | 73b776b | 2016-10-19 07:50:28 -0400 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-inventory-manager], [1.0], [https://github.com/openbmc/phosphor-inventory-manager/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 | |
Brad Bishop | 49aefb3 | 2016-10-19 11:54:14 -0400 | [diff] [blame] | 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 developement package required])]) |
| 19 | AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...sdbusplus developement package required])]) |
| 20 | |
Brad Bishop | 73b776b | 2016-10-19 07:50:28 -0400 | [diff] [blame] | 21 | # Checks for typedefs, structures, and compiler characteristics. |
| 22 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 23 | AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS]) |
| 24 | |
| 25 | # Checks for library functions. |
| 26 | LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot' |
Brad Bishop | b9fa433 | 2016-10-31 13:40:47 -0500 | [diff] [blame^] | 27 | # Check/set gtest specific functions. |
| 28 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 29 | AC_SUBST(GTEST_CPPFLAGS) |
| 30 | |
| 31 | AC_ARG_ENABLE([oe-sdk], |
| 32 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 33 | ) |
| 34 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 35 | [Path to the OE SDK SYSROOT]) |
| 36 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 37 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 38 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 39 | ) |
| 40 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 41 | [ |
| 42 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 43 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 44 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 45 | ] |
| 46 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 47 | ) |
Brad Bishop | 73b776b | 2016-10-19 07:50:28 -0400 | [diff] [blame] | 48 | |
Brad Bishop | 49aefb3 | 2016-10-19 11:54:14 -0400 | [diff] [blame] | 49 | AC_ARG_VAR(BUSNAME, [The DBus busname to own.]) |
| 50 | AC_ARG_VAR(INVENTORY_ROOT, [The DBus inventory namespace root.]) |
| 51 | AC_ARG_VAR(IFACE, [The manager DBus interface.]) |
| 52 | AS_IF([test "x$BUSNAME" == "x"], [BUSNAME="xyz.openbmc_project.Inventory.Manager"]) |
| 53 | AS_IF([test "x$INVENTORY_ROOT" == "x"], [INVENTORY_ROOT="/xyz/openbmc_project/Inventory"]) |
| 54 | AS_IF([test "x$IFACE" == "x"], [IFACE="xyz.openbmc_project.Inventory.Manager"]) |
| 55 | AC_DEFINE_UNQUOTED([BUSNAME], ["$BUSNAME"], [The DBus busname to own.]) |
| 56 | AC_DEFINE_UNQUOTED([INVENTORY_ROOT], ["$INVENTORY_ROOT"], [The DBus inventory namespace root.]) |
| 57 | AC_DEFINE_UNQUOTED([IFACE], ["$IFACE"], [The manager DBus interface.]) |
Brad Bishop | 64d994a | 2016-10-31 10:24:27 -0500 | [diff] [blame] | 58 | AC_ARG_ENABLE([example], |
| 59 | AS_HELP_STRING([--enable-example], [Enable example configuration.])) |
| 60 | AM_CONDITIONAL([EXAMPLE], [test x$enable_example = xyes]) |
Brad Bishop | 49aefb3 | 2016-10-19 11:54:14 -0400 | [diff] [blame] | 61 | |
Brad Bishop | 73b776b | 2016-10-19 07:50:28 -0400 | [diff] [blame] | 62 | # Create configured output |
Brad Bishop | 49aefb3 | 2016-10-19 11:54:14 -0400 | [diff] [blame] | 63 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Brad Bishop | 73b776b | 2016-10-19 07:50:28 -0400 | [diff] [blame] | 64 | AC_OUTPUT |