Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-net-ipmid], [1.0], [https://github.com/openbmc/phosphor-net-ipmid/issues]) |
| 4 | AC_CONFIG_HEADERS([config.h]) |
| 5 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 6 | AM_SILENT_RULES([yes]) |
Patrick Venture | f611055 | 2018-10-29 18:38:23 -0700 | [diff] [blame] | 7 | AC_LANG([C++]) |
Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 8 | |
| 9 | # Checks for programs. |
| 10 | AC_PROG_CXX |
| 11 | AM_PROG_AR |
| 12 | AC_PROG_INSTALL |
| 13 | AC_PROG_MAKE_SET |
| 14 | |
Gunnar Mills | 541aee7 | 2017-10-25 14:47:10 -0500 | [diff] [blame] | 15 | # Suppress the --with-libtool-sysroot error |
Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 16 | LT_INIT |
| 17 | |
Tom Joseph | 1e5a76a | 2017-01-30 19:25:06 +0530 | [diff] [blame] | 18 | # Check/set gtest specific functions. |
| 19 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 20 | AC_SUBST(GTEST_CPPFLAGS) |
| 21 | AC_ARG_ENABLE([oe-sdk], |
| 22 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 23 | ) |
| 24 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 25 | [Path to the OE SDK SYSROOT]) |
| 26 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 27 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 28 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 29 | ) |
| 30 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 31 | [ |
| 32 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 33 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 34 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 35 | ] |
| 36 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 37 | ) |
| 38 | |
Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 39 | # Checks for typedefs, structures, and compiler characteristics. |
Vernon Mauery | 5e45209 | 2018-10-04 10:01:25 -0700 | [diff] [blame] | 40 | AX_CXX_COMPILE_STDCXX_17([noext]) |
Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 41 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 42 | |
| 43 | # Checks for libraries. |
| 44 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
| 45 | PKG_CHECK_MODULES([CRYPTO], [libcrypto >= 1.0.2g], ,[AC_MSG_ERROR([can't find openssl libcrypto])]) |
Patrick Venture | 27ebe58 | 2019-02-13 14:57:01 -0800 | [diff] [blame] | 46 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging]) |
| 47 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus]) |
| 48 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces]) |
William A. Kennington III | 4f09eae | 2019-02-12 17:10:35 -0800 | [diff] [blame] | 49 | PKG_CHECK_MODULES([LIBIPMID], [libipmid]) |
Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 50 | AC_CHECK_LIB([mapper], [mapper_get_service], ,[AC_MSG_ERROR([Could not find libmapper...openbmc/phosphor-objmgr package required])]) |
| 51 | |
Vernon Mauery | d92bc32 | 2019-03-15 15:24:30 -0700 | [diff] [blame] | 52 | # systemd unit general configuration |
| 53 | PKG_PROG_PKG_CONFIG |
| 54 | AC_ARG_WITH([systemdsystemunitdir], |
| 55 | [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], |
| 56 | [Directory for systemd service files])], [], |
| 57 | [with_systemdsystemunitdir=auto]) |
| 58 | AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], |
| 59 | [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) |
| 60 | AS_IF([test "x$def_systemdsystemunitdir" = "x"], |
| 61 | [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], |
| 62 | [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])], |
| 63 | [with_systemdsystemunitdir=no])], |
| 64 | [with_systemdsystemunitdir="$def_systemdsystemunitdir"])]) |
| 65 | AS_IF([test "x$with_systemdsystemunitdir" != "xno"], |
| 66 | [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]) |
| 67 | AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) |
| 68 | |
Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 69 | # Checks for header files. |
Gunnar Mills | 541aee7 | 2017-10-25 14:47:10 -0500 | [diff] [blame] | 70 | AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])]) |
Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 71 | |
Tom | 485038e | 2016-12-02 13:44:45 +0530 | [diff] [blame] | 72 | # Checks for library functions. |
Vernon Mauery | 6650164 | 2018-07-30 09:07:10 -0700 | [diff] [blame] | 73 | LT_INIT([disable-static shared]) |
Tom | 485038e | 2016-12-02 13:44:45 +0530 | [diff] [blame] | 74 | |
Tom Joseph | 1e5a76a | 2017-01-30 19:25:06 +0530 | [diff] [blame] | 75 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Tom Joseph | c35524e | 2016-08-29 08:17:59 -0500 | [diff] [blame] | 76 | AC_OUTPUT |