Patrick Williams | 5e0b681 | 2016-11-04 16:45:33 -0500 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([sdbusplus], [1.0], [https://github.com/openbmc/sdbusplus/issues]) |
| 4 | AC_CONFIG_HEADERS([config.h]) |
William A. Kennington III | c65d74e | 2018-06-19 18:32:09 -0700 | [diff] [blame^] | 5 | AC_CONFIG_MACRO_DIRS([m4]) |
| 6 | AC_CONFIG_AUX_DIR([build-aux]) |
Patrick Williams | 5e0b681 | 2016-11-04 16:45:33 -0500 | [diff] [blame] | 7 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 8 | AM_SILENT_RULES([yes]) |
| 9 | |
| 10 | # Checks for programs. |
Patrick Williams | 83a9d0b | 2016-11-04 17:06:13 -0500 | [diff] [blame] | 11 | AC_PROG_CXX |
Patrick Williams | 5e0b681 | 2016-11-04 16:45:33 -0500 | [diff] [blame] | 12 | AC_PROG_CC |
| 13 | AM_PROG_AR |
| 14 | AC_PROG_INSTALL |
| 15 | AC_PROG_MAKE_SET |
| 16 | |
Brad Bishop | bba7f8c | 2016-11-10 09:32:58 -0500 | [diff] [blame] | 17 | # setup sdbus++ |
| 18 | AM_PATH_PYTHON([2.7], [AC_SUBST([PYTHON], [echo "$PYTHON"])]) |
| 19 | AC_SUBST([PYTHONDIR], ${pythondir}) |
| 20 | AS_IF([test "$PYTHON" != :], [have_python=yes], [have_python=no]) |
| 21 | |
| 22 | AC_ARG_ENABLE([sdbuspp], |
| 23 | AS_HELP_STRING([--disable-sdbuspp], [Disable sdbus++])) |
| 24 | |
| 25 | AS_IF([test "x$enable_sdbuspp" != "xno"], |
| 26 | [AS_IF([test "x$have_python" = "xno"], [AC_MSG_ERROR([sdbus++ requires python])])]) |
| 27 | |
| 28 | AM_CONDITIONAL([WANT_SDBUSPP], [test "x$enable_sdbuspp" != "xno"]) |
| 29 | |
Brad Bishop | 14275cf | 2016-11-10 16:24:48 -0500 | [diff] [blame] | 30 | # setup libsdbusplus |
Brad Bishop | 5e70389 | 2017-02-10 11:52:48 -0500 | [diff] [blame] | 31 | AX_PKG_CHECK_MODULES( |
| 32 | [SYSTEMD], |
| 33 | [libsystemd >= 221], |
| 34 | [], |
| 35 | [have_systemd=yes], |
| 36 | [have_systemd=no]) |
Brad Bishop | 14275cf | 2016-11-10 16:24:48 -0500 | [diff] [blame] | 37 | AC_ARG_ENABLE([libsdbusplus], |
| 38 | AS_HELP_STRING([--disable-libsdbusplus], [Disable libsdbusplus])) |
| 39 | |
| 40 | AS_IF([test "x$enable_libsdbusplus" != "xno"], |
| 41 | [AS_IF([test "x$have_systemd" = "xno"], [AC_MSG_ERROR([libsdbusplus requires systemd])])]) |
| 42 | |
| 43 | AM_CONDITIONAL([WANT_LIBSDBUSPLUS], [test "x$enable_libsdbusplus" != "xno"]) |
Patrick Williams | 5e0b681 | 2016-11-04 16:45:33 -0500 | [diff] [blame] | 44 | |
Adriana Kobylak | fd43ef7 | 2017-02-12 09:12:37 -0600 | [diff] [blame] | 45 | # setup transaction |
| 46 | AC_ARG_ENABLE([transaction], |
| 47 | AS_HELP_STRING([--enable-transaction], [Enable transaction id support.])) |
| 48 | AC_ARG_VAR(WANT_TRANSACTION, [Enable transaction id support.]) |
| 49 | AS_IF([test "x$enable_transaction" = "xyes"], \ |
| 50 | [WANT_TRANSACTION="1"], \ |
| 51 | [WANT_TRANSACTION="0"]) |
| 52 | AM_CONDITIONAL([WANT_TRANSACTION], [test "x$enable_transaction" = "xyes"]) |
| 53 | |
Patrick Williams | 5e0b681 | 2016-11-04 16:45:33 -0500 | [diff] [blame] | 54 | # Checks for header files. |
Patrick Williams | ab7de32 | 2017-01-06 15:14:45 -0600 | [diff] [blame] | 55 | AS_IF([test "x$enable_libsdbusplus" != "xno"], |
Gunnar Mills | a4b4a0b | 2018-04-08 14:30:38 -0500 | [diff] [blame] | 56 | [AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])]) |
Patrick Williams | 5e0b681 | 2016-11-04 16:45:33 -0500 | [diff] [blame] | 57 | |
| 58 | # Checks for typedefs, structures, and compiler characteristics. |
Patrick Williams | ab7de32 | 2017-01-06 15:14:45 -0600 | [diff] [blame] | 59 | AS_IF([test "x$enable_libsdbusplus" != "xno"], |
Brad Bishop | 14275cf | 2016-11-10 16:24:48 -0500 | [diff] [blame] | 60 | [AX_CXX_COMPILE_STDCXX_14([noext])]) |
Patrick Williams | 83a9d0b | 2016-11-04 17:06:13 -0500 | [diff] [blame] | 61 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS]) |
| 62 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
Patrick Williams | 5e0b681 | 2016-11-04 16:45:33 -0500 | [diff] [blame] | 63 | |
| 64 | # Checks for library functions. |
| 65 | LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot' |
| 66 | |
| 67 | # Check/set gtest specific functions. |
| 68 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 69 | AC_SUBST(GTEST_CPPFLAGS) |
| 70 | |
| 71 | AC_ARG_ENABLE([oe-sdk], |
| 72 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 73 | ) |
| 74 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 75 | [Path to the OE SDK SYSROOT]) |
| 76 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 77 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 78 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 79 | ) |
| 80 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 81 | [ |
| 82 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 83 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 84 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 85 | ] |
| 86 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 87 | ) |
| 88 | |
| 89 | # Create configured output |
Brad Bishop | bba7f8c | 2016-11-10 09:32:58 -0500 | [diff] [blame] | 90 | AC_CONFIG_FILES([Makefile test/Makefile tools/Makefile tools/setup.py]) |
Patrick Williams | 4edb785 | 2017-07-03 11:50:11 -0500 | [diff] [blame] | 91 | AC_CONFIG_FILES([example/Makefile]) |
Adriana Kobylak | a1fb5e6 | 2017-01-30 11:41:19 -0600 | [diff] [blame] | 92 | AC_CONFIG_FILES([sdbusplus.pc]) |
Adriana Kobylak | fd43ef7 | 2017-02-12 09:12:37 -0600 | [diff] [blame] | 93 | AC_CONFIG_FILES([sdbusplus/bus.hpp]) |
| 94 | AC_CONFIG_FILES([sdbusplus/server.hpp]) |
| 95 | AC_CONFIG_FILES([tools/sdbusplus/templates/interface.mako.server.cpp]) |
| 96 | AC_CONFIG_FILES([tools/sdbusplus/templates/method.mako.prototype.hpp]) |
Adriana Kobylak | ee6ac69 | 2018-06-06 09:36:51 -0500 | [diff] [blame] | 97 | AC_CONFIG_FILES([tools/sdbusplus/templates/property.mako.prototype.hpp]) |
Patrick Williams | 5e0b681 | 2016-11-04 16:45:33 -0500 | [diff] [blame] | 98 | AC_OUTPUT |