blob: b192d790b23bca017f8ef7efbb752c439be72256 [file] [log] [blame]
Deepak Kodihalli1b24f972019-02-01 04:09:13 -06001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([pldm], [1.0],
4 [https://github.com/openbmc/pldm/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
23# 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
44# Create configured output
45AC_CONFIG_FILES([Makefile libpldm/Makefile libpldmresponder/Makefile test/Makefile])
46AC_CONFIG_FILES([libpldm/libpldm.pc])
47AC_OUTPUT