Deepak Kodihalli | 1b24f97 | 2019-02-01 04:09:13 -0600 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([pldm], [1.0], |
| 4 | [https://github.com/openbmc/pldm/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 | |
| 23 | # Check/set gtest specific functions. |
| 24 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 25 | AC_SUBST(GTEST_CPPFLAGS) |
| 26 | AC_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 | ) |
| 29 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 30 | [Path to the OE SDK SYSROOT]) |
| 31 | AS_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 |
| 45 | AC_CONFIG_FILES([Makefile libpldm/Makefile libpldmresponder/Makefile test/Makefile]) |
| 46 | AC_CONFIG_FILES([libpldm/libpldm.pc]) |
| 47 | AC_OUTPUT |