Matthew Barth | 7122244 | 2016-10-04 16:10:01 -0500 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-objmgr], [1.0], [https://github.com/openbmc/phosphor-objmgr/issues]) |
| 4 | AC_CONFIG_HEADERS([config.h]) |
| 5 | AC_CONFIG_MACRO_DIR([m4]) |
| 6 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 7 | AM_SILENT_RULES([yes]) |
| 8 | |
| 9 | # Checks for programs. |
| 10 | AC_PROG_CC |
| 11 | AM_PROG_AR |
| 12 | AC_PROG_INSTALL |
| 13 | AC_PROG_MAKE_SET |
Matthew Barth | 4a6f998 | 2016-11-18 10:25:57 -0600 | [diff] [blame] | 14 | AC_PROG_AWK |
Matthew Barth | 7122244 | 2016-10-04 16:10:01 -0500 | [diff] [blame] | 15 | # Python |
| 16 | AM_PATH_PYTHON([2.7], [AC_SUBST([PYTHON], [echo "$PYTHON"])], [AC_MSG_ERROR([Could not find python-2.7 installed...python-2.7 is required])]) |
| 17 | AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) |
| 18 | AC_SUBST([HAVE_PYTHON]) |
| 19 | AC_SUBST([PYTHONDIR], ${pythondir}) |
| 20 | |
| 21 | # Checks for libraries. |
| 22 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
| 23 | |
| 24 | # Checks for header files. |
| 25 | AC_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. |
| 28 | AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CFLAGS]) |
| 29 | |
| 30 | # Checks for library functions. |
| 31 | LT_INIT([disable-static shared]) |
| 32 | |
| 33 | # Check/set gtest specific functions. |
| 34 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 35 | AC_SUBST(GTEST_CPPFLAGS) |
| 36 | |
| 37 | AC_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 | ) |
| 40 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 41 | [Path to the OE SDK SYSROOT]) |
| 42 | AS_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 |
| 56 | AC_DEFINE([MAPPER_BUSNAME], ["xyz.openbmc_project.ObjectMapper"], [Object mapper bus name]) |
| 57 | AC_DEFINE([MAPPER_INTERFACE], ["xyz.openbmc_project.ObjectMapper"], [Object mapper interface]) |
| 58 | AC_DEFINE([MAPPER_PATH], ["/xyz/openbmc_project/ObjectMapper"], [Object mapper DBUS path]) |
| 59 | |
| 60 | # Create configured output |
| 61 | AC_CONFIG_FILES([Makefile setup.py]) |
| 62 | AC_OUTPUT |