Tom Joseph | ff4642c | 2019-04-10 13:41:32 +0530 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([pldm], [1.0], |
| 4 | [https://github.com/openbmc/ibm-pldm-oem/issues]) |
| 5 | AC_LANG([C++]) |
| 6 | AC_CONFIG_HEADERS([config.h]) |
| 7 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 8 | AM_SILENT_RULES([yes]) |
| 9 | |
| 10 | # Checks for programs. |
| 11 | AC_PROG_CXX |
| 12 | AC_PROG_CC |
| 13 | AM_PROG_AR |
| 14 | AC_PROG_INSTALL |
| 15 | |
| 16 | # Checks for typedefs, structures, and compiler characteristics. |
| 17 | AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory]) |
| 18 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 19 | |
| 20 | # For linking |
| 21 | LT_INIT |
| 22 | |
Tom Joseph | f8329ac | 2019-04-11 22:13:22 +0530 | [diff] [blame] | 23 | # Check for needed modules |
| 24 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging]) |
| 25 | |
Tom Joseph | 7dae777 | 2019-04-10 14:44:44 +0530 | [diff] [blame] | 26 | # Check/set gtest specific functions. |
| 27 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 28 | AC_SUBST(GTEST_CPPFLAGS) |
| 29 | AC_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 | ) |
| 32 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 33 | [Path to the OE SDK SYSROOT]) |
| 34 | AS_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 Joseph | ff4642c | 2019-04-10 13:41:32 +0530 | [diff] [blame] | 47 | # Create configured output |
Tom Joseph | f8329ac | 2019-04-11 22:13:22 +0530 | [diff] [blame] | 48 | AC_CONFIG_FILES([Makefile libpldm/Makefile libpldmresponder/Makefile test/Makefile]) |
Tom Joseph | ff4642c | 2019-04-10 13:41:32 +0530 | [diff] [blame] | 49 | AC_OUTPUT |