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]) |
Matthew Barth | f1d7c6e | 2016-11-15 11:22:30 -0600 | [diff] [blame] | 4 | AC_CONFIG_HEADERS([libmapper/config.h]) |
Matthew Barth | 7122244 | 2016-10-04 16:10:01 -0500 | [diff] [blame] | 5 | AC_CONFIG_MACRO_DIR([m4]) |
| 6 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 7 | AM_SILENT_RULES([yes]) |
| 8 | |
Matthew Barth | c6329c9 | 2016-11-15 11:13:37 -0600 | [diff] [blame] | 9 | # Modify header template |
| 10 | AH_TOP([#pragma once]) |
Matthew Barth | 66da92d | 2017-01-04 14:37:25 -0600 | [diff] [blame^] | 11 | AH_BOTTOM([#include "libmapper/workaround/systemd.h"]) |
Matthew Barth | c6329c9 | 2016-11-15 11:13:37 -0600 | [diff] [blame] | 12 | |
Matthew Barth | 7122244 | 2016-10-04 16:10:01 -0500 | [diff] [blame] | 13 | # Checks for programs. |
| 14 | AC_PROG_CC |
| 15 | AM_PROG_AR |
| 16 | AC_PROG_INSTALL |
| 17 | AC_PROG_MAKE_SET |
Matthew Barth | 4a6f998 | 2016-11-18 10:25:57 -0600 | [diff] [blame] | 18 | AC_PROG_AWK |
Matthew Barth | 7122244 | 2016-10-04 16:10:01 -0500 | [diff] [blame] | 19 | # Python |
| 20 | 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])]) |
| 21 | AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) |
| 22 | AC_SUBST([HAVE_PYTHON]) |
| 23 | AC_SUBST([PYTHONDIR], ${pythondir}) |
| 24 | |
| 25 | # Checks for libraries. |
| 26 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
| 27 | |
| 28 | # Checks for header files. |
| 29 | AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])]) |
| 30 | |
| 31 | # Checks for typedefs, structures, and compiler characteristics. |
| 32 | AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CFLAGS]) |
| 33 | |
| 34 | # Checks for library functions. |
| 35 | LT_INIT([disable-static shared]) |
| 36 | |
| 37 | # Check/set gtest specific functions. |
| 38 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 39 | AC_SUBST(GTEST_CPPFLAGS) |
| 40 | |
| 41 | AC_ARG_ENABLE([oe-sdk], |
| 42 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 43 | ) |
| 44 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 45 | [Path to the OE SDK SYSROOT]) |
| 46 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 47 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 48 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 49 | ) |
| 50 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 51 | [ |
| 52 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 53 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 54 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 55 | ] |
| 56 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 57 | ) |
| 58 | |
| 59 | # Add defines to config header |
| 60 | AC_DEFINE([MAPPER_BUSNAME], ["xyz.openbmc_project.ObjectMapper"], [Object mapper bus name]) |
| 61 | AC_DEFINE([MAPPER_INTERFACE], ["xyz.openbmc_project.ObjectMapper"], [Object mapper interface]) |
| 62 | AC_DEFINE([MAPPER_PATH], ["/xyz/openbmc_project/ObjectMapper"], [Object mapper DBUS path]) |
| 63 | |
Matthew Barth | c6329c9 | 2016-11-15 11:13:37 -0600 | [diff] [blame] | 64 | # Workaround for unpatched systemd installs |
| 65 | AC_ARG_ENABLE([unpatched-systemd], |
| 66 | AS_HELP_STRING([--enable-unpatched-systemd], [Enable unpatched systemd workarounds])) |
| 67 | AS_IF([test "x$enable_unpatched_systemd" == "xyes"], |
| 68 | AC_MSG_NOTICE([Enabling unpatched systemd workarounds]) |
| 69 | [ |
| 70 | AC_DEFINE([IS_UNPATCHED_SYSTEMD], ,[Enable unpatched systemd workarounds]) |
| 71 | ] |
| 72 | ) |
| 73 | |
Matthew Barth | 7122244 | 2016-10-04 16:10:01 -0500 | [diff] [blame] | 74 | # Create configured output |
| 75 | AC_CONFIG_FILES([Makefile setup.py]) |
| 76 | AC_OUTPUT |