blob: c54b16c3c23354f42e2080d6a000a91e5c9750c5 [file] [log] [blame]
Matthew Barth71222442016-10-04 16:10:01 -05001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([phosphor-objmgr], [1.0], [https://github.com/openbmc/phosphor-objmgr/issues])
4AC_CONFIG_HEADERS([config.h])
5AC_CONFIG_MACRO_DIR([m4])
6AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
7AM_SILENT_RULES([yes])
8
9# Checks for programs.
10AC_PROG_CC
11AM_PROG_AR
12AC_PROG_INSTALL
13AC_PROG_MAKE_SET
14# Python
15AM_PATH_PYTHON([2.7], [AC_SUBST([PYTHON], [echo "$PYTHON"])], [AC_MSG_ERROR([Could not find python-2.7 installed...python-2.7 is required])])
16AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
17AC_SUBST([HAVE_PYTHON])
18AC_SUBST([PYTHONDIR], ${pythondir})
19
20# Checks for libraries.
21PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
22
23# Checks for header files.
24AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
25
26# Checks for typedefs, structures, and compiler characteristics.
27AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CFLAGS])
28
29# Checks for library functions.
30LT_INIT([disable-static shared])
31
32# Check/set gtest specific functions.
33AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
34AC_SUBST(GTEST_CPPFLAGS)
35
36AC_ARG_ENABLE([oe-sdk],
37 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
38)
39AC_ARG_VAR(OECORE_TARGET_SYSROOT,
40 [Path to the OE SDK SYSROOT])
41AS_IF([test "x$enable_oe_sdk" == "xyes"],
42 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
43 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
44 )
45 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
46 [
47 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
48 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
49 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
50 ]
51 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
52)
53
54# Add defines to config header
55AC_DEFINE([MAPPER_BUSNAME], ["xyz.openbmc_project.ObjectMapper"], [Object mapper bus name])
56AC_DEFINE([MAPPER_INTERFACE], ["xyz.openbmc_project.ObjectMapper"], [Object mapper interface])
57AC_DEFINE([MAPPER_PATH], ["/xyz/openbmc_project/ObjectMapper"], [Object mapper DBUS path])
58
59# Create configured output
60AC_CONFIG_FILES([Makefile setup.py])
61AC_OUTPUT