blob: cdd0292876f2e34a4bc0f291a28c1df591691bd2 [file] [log] [blame]
Matthew Barth70dbc582016-09-20 10:16:52 -05001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([openpower-host-ipmi-oem], [1.0], [https://github.com/openbmc/openpower-host-ipmi-oem/issues])
4AC_CONFIG_HEADERS([config.h])
5AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
6AM_SILENT_RULES([yes])
7
8# Checks for programs.
9AC_PROG_CXX
10AM_PROG_AR
11AC_PROG_INSTALL
12AC_PROG_MAKE_SET
13
14# Checks for libraries.
15PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
16
17# Checks for header files.
18AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
19AC_CHECK_HEADER(host-ipmid/ipmid-api.h, ,[AC_MSG_ERROR([Could not find host-ipmid/ipmid-api.h...host-ipmid package required])])
20
21# Checks for typedefs, structures, and compiler characteristics.
22AX_CXX_COMPILE_STDCXX(14, [noext])
23AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
24
25# Checks for library functions.
26LT_INIT([disable-static shared])
27
28# Check/set gtest specific functions.
29AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-GTEST_HAS_PTHREAD=0"])
30AC_SUBST(GTEST_CPPFLAGS)
31
32AC_ARG_ENABLE([oe-sdk],
33 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
34)
35AC_ARG_VAR(OECORE_TARGET_SYSROOT,
36 [Path to the OE SDK SYSROOT])
37AS_IF([test "x$enable_oe_sdk" == "xyes"],
38 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
39 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
40 )
41 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
42 [
43 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
44 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
45 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
46 ]
47 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
48)
49
50# Create configured output.
51AC_CONFIG_FILES([Makefile])
52AC_OUTPUT