blob: b23d799f607da1603de4ad60070302e555e2f104 [file] [log] [blame]
Brad Bishop73b776b2016-10-19 07:50:28 -04001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([phosphor-inventory-manager], [1.0], [https://github.com/openbmc/phosphor-inventory-manager/issues])
Brad Bishopaa7e6bf2016-11-09 21:06:14 -05004AC_LANG([C++])
Brad Bishop73b776b2016-10-19 07:50:28 -04005AC_CONFIG_HEADERS([config.h])
6AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
7AM_SILENT_RULES([yes])
8
9# Checks for programs.
10AC_PROG_CXX
11AM_PROG_AR
12AC_PROG_INSTALL
13AC_PROG_MAKE_SET
14
Brad Bishop49aefb32016-10-19 11:54:14 -040015# Checks for libraries.
16PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
17
Brad Bishop73b776b2016-10-19 07:50:28 -040018# Checks for typedefs, structures, and compiler characteristics.
19AX_CXX_COMPILE_STDCXX_14([noext])
20AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS])
21
Brad Bishopaa7e6bf2016-11-09 21:06:14 -050022# Checks for header files.
23AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd developement package required])])
24AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...sdbusplus developement package required])])
25
Brad Bishop73b776b2016-10-19 07:50:28 -040026# Checks for library functions.
27LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot'
Brad Bishopb9fa4332016-10-31 13:40:47 -050028# Check/set gtest specific functions.
29AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
30AC_SUBST(GTEST_CPPFLAGS)
31
32AC_ARG_ENABLE([oe-sdk],
33 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
34)
35AC_ARG_VAR(OECORE_TARGET_SYSROOT,
36 [Path to the OE SDK SYSROOT])
37AS_IF([test "x$enable_oe_sdk" == "xyes"],
38 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
39 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
40 )
41 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
42 [
43 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
44 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
45 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
46 ]
47 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
48)
Brad Bishop73b776b2016-10-19 07:50:28 -040049
Brad Bishop49aefb32016-10-19 11:54:14 -040050AC_ARG_VAR(BUSNAME, [The DBus busname to own.])
51AC_ARG_VAR(INVENTORY_ROOT, [The DBus inventory namespace root.])
52AC_ARG_VAR(IFACE, [The manager DBus interface.])
53AS_IF([test "x$BUSNAME" == "x"], [BUSNAME="xyz.openbmc_project.Inventory.Manager"])
54AS_IF([test "x$INVENTORY_ROOT" == "x"], [INVENTORY_ROOT="/xyz/openbmc_project/Inventory"])
55AS_IF([test "x$IFACE" == "x"], [IFACE="xyz.openbmc_project.Inventory.Manager"])
56AC_DEFINE_UNQUOTED([BUSNAME], ["$BUSNAME"], [The DBus busname to own.])
57AC_DEFINE_UNQUOTED([INVENTORY_ROOT], ["$INVENTORY_ROOT"], [The DBus inventory namespace root.])
58AC_DEFINE_UNQUOTED([IFACE], ["$IFACE"], [The manager DBus interface.])
Brad Bishop64d994a2016-10-31 10:24:27 -050059AC_ARG_ENABLE([example],
60 AS_HELP_STRING([--enable-example], [Enable example configuration.]))
61AM_CONDITIONAL([EXAMPLE], [test x$enable_example = xyes])
Brad Bishop49aefb32016-10-19 11:54:14 -040062
Brad Bishop73b776b2016-10-19 07:50:28 -040063# Create configured output
Brad Bishop49aefb32016-10-19 11:54:14 -040064AC_CONFIG_FILES([Makefile test/Makefile])
Brad Bishop73b776b2016-10-19 07:50:28 -040065AC_OUTPUT