blob: f3b8e5c3a54d9ab799c7c80104e07beaa86e8e2e [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
Matthew Barth4a6f9982016-11-18 10:25:57 -060014AC_PROG_AWK
Matthew Barth71222442016-10-04 16:10:01 -050015# Python
16AM_PATH_PYTHON([2.7], [AC_SUBST([PYTHON], [echo "$PYTHON"])], [AC_MSG_ERROR([Could not find python-2.7 installed...python-2.7 is required])])
17AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
18AC_SUBST([HAVE_PYTHON])
19AC_SUBST([PYTHONDIR], ${pythondir})
20
21# Checks for libraries.
22PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
23
24# Checks for header files.
25AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
26
27# Checks for typedefs, structures, and compiler characteristics.
28AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CFLAGS])
29
30# Checks for library functions.
31LT_INIT([disable-static shared])
32
33# Check/set gtest specific functions.
34AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
35AC_SUBST(GTEST_CPPFLAGS)
36
37AC_ARG_ENABLE([oe-sdk],
38 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
39)
40AC_ARG_VAR(OECORE_TARGET_SYSROOT,
41 [Path to the OE SDK SYSROOT])
42AS_IF([test "x$enable_oe_sdk" == "xyes"],
43 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
44 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
45 )
46 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
47 [
48 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
49 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
50 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
51 ]
52 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
53)
54
55# Add defines to config header
56AC_DEFINE([MAPPER_BUSNAME], ["xyz.openbmc_project.ObjectMapper"], [Object mapper bus name])
57AC_DEFINE([MAPPER_INTERFACE], ["xyz.openbmc_project.ObjectMapper"], [Object mapper interface])
58AC_DEFINE([MAPPER_PATH], ["/xyz/openbmc_project/ObjectMapper"], [Object mapper DBUS path])
59
60# Create configured output
61AC_CONFIG_FILES([Makefile setup.py])
62AC_OUTPUT