blob: 305b7f3b1521a4e0b6666c7dcdec1a6c1d78fb6b [file] [log] [blame]
Tom Josephc35524e2016-08-29 08:17:59 -05001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([phosphor-net-ipmid], [1.0], [https://github.com/openbmc/phosphor-net-ipmid/issues])
4AC_CONFIG_HEADERS([config.h])
5AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
6AM_SILENT_RULES([yes])
Patrick Venturef6110552018-10-29 18:38:23 -07007AC_LANG([C++])
Tom Josephc35524e2016-08-29 08:17:59 -05008
9# Checks for programs.
10AC_PROG_CXX
11AM_PROG_AR
12AC_PROG_INSTALL
13AC_PROG_MAKE_SET
14
Gunnar Mills541aee72017-10-25 14:47:10 -050015# Suppress the --with-libtool-sysroot error
Tom Josephc35524e2016-08-29 08:17:59 -050016LT_INIT
17
Tom Joseph1e5a76a2017-01-30 19:25:06 +053018# Check/set gtest specific functions.
19AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
20AC_SUBST(GTEST_CPPFLAGS)
21AC_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)
24AC_ARG_VAR(OECORE_TARGET_SYSROOT,
25 [Path to the OE SDK SYSROOT])
26AS_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 Josephc35524e2016-08-29 08:17:59 -050039# Checks for typedefs, structures, and compiler characteristics.
Vernon Mauery5e452092018-10-04 10:01:25 -070040AX_CXX_COMPILE_STDCXX_17([noext])
Tom Josephc35524e2016-08-29 08:17:59 -050041AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
42
43# Checks for libraries.
44PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
45PKG_CHECK_MODULES([CRYPTO], [libcrypto >= 1.0.2g], ,[AC_MSG_ERROR([can't find openssl libcrypto])])
Patrick Venture27ebe582019-02-13 14:57:01 -080046PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
47PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
48PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces])
William A. Kennington III4f09eae2019-02-12 17:10:35 -080049PKG_CHECK_MODULES([LIBIPMID], [libipmid])
Tom Josephc35524e2016-08-29 08:17:59 -050050AC_CHECK_LIB([mapper], [mapper_get_service], ,[AC_MSG_ERROR([Could not find libmapper...openbmc/phosphor-objmgr package required])])
51
52# Checks for header files.
Gunnar Mills541aee72017-10-25 14:47:10 -050053AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
Tom Josephc35524e2016-08-29 08:17:59 -050054
Tom485038e2016-12-02 13:44:45 +053055# Checks for library functions.
Vernon Mauery66501642018-07-30 09:07:10 -070056LT_INIT([disable-static shared])
Tom485038e2016-12-02 13:44:45 +053057
Tom Joseph1e5a76a2017-01-30 19:25:06 +053058AC_CONFIG_FILES([Makefile test/Makefile])
Tom Josephc35524e2016-08-29 08:17:59 -050059AC_OUTPUT