blob: 88c4d9b912582c70c8906cf7ac63b886af02b2cf [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 Joseph7dae7772019-04-10 14:44:44 +053023# Check/set gtest specific functions.
24AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
25AC_SUBST(GTEST_CPPFLAGS)
26AC_ARG_ENABLE([oe-sdk],
27 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
28)
29AC_ARG_VAR(OECORE_TARGET_SYSROOT,
30 [Path to the OE SDK SYSROOT])
31AS_IF([test "x$enable_oe_sdk" == "xyes"],
32 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
33 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
34 )
35 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
36 [
37 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
38 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
39 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
40 ]
41 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
42)
43
Tom Josephff4642c2019-04-10 13:41:32 +053044# Create configured output
Tom Joseph7dae7772019-04-10 14:44:44 +053045AC_CONFIG_FILES([Makefile libpldm/Makefile test/Makefile])
Tom Josephff4642c2019-04-10 13:41:32 +053046AC_OUTPUT