blob: 53d92286159fa21c2666fdeb6c6e0439b2ef15a3 [file] [log] [blame]
Tom Josephff4642c2019-04-10 13:41:32 +05301# Initialization
2AC_PREREQ([2.69])
3AC_INIT([pldm], [1.0],
4 [https://github.com/openbmc/ibm-pldm-oem/issues])
5AC_LANG([C++])
6AC_CONFIG_HEADERS([config.h])
7AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
8AM_SILENT_RULES([yes])
9
10# Checks for programs.
11AC_PROG_CXX
12AC_PROG_CC
13AM_PROG_AR
14AC_PROG_INSTALL
15
16# Checks for typedefs, structures, and compiler characteristics.
17AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
18AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
19
20# For linking
21LT_INIT
22
Tom Josephf8329ac2019-04-11 22:13:22 +053023# Check for needed modules
24PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
25
Tom Joseph7dae7772019-04-10 14:44:44 +053026# Check/set gtest specific functions.
27AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
28AC_SUBST(GTEST_CPPFLAGS)
29AC_ARG_ENABLE([oe-sdk],
30 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
31)
32AC_ARG_VAR(OECORE_TARGET_SYSROOT,
33 [Path to the OE SDK SYSROOT])
34AS_IF([test "x$enable_oe_sdk" == "xyes"],
35 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
36 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
37 )
38 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
39 [
40 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
41 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
42 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
43 ]
44 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
45)
46
Tom Josephff4642c2019-04-10 13:41:32 +053047# Create configured output
Tom Josephf8329ac2019-04-11 22:13:22 +053048AC_CONFIG_FILES([Makefile libpldm/Makefile libpldmresponder/Makefile test/Makefile])
Tom Josephff4642c2019-04-10 13:41:32 +053049AC_OUTPUT