| Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 1 | # Initialization | 
|  | 2 | AC_PREREQ([2.69]) | 
|  | 3 | AC_INIT([phosphor-ipmi-flash], [0.1], [https://github.com/openbmc/phosphor-ipmi-flash/issues]) | 
|  | 4 | AC_LANG([C++]) | 
|  | 5 | AC_CONFIG_HEADERS([config.h]) | 
|  | 6 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) | 
|  | 7 | AM_SILENT_RULES([yes]) | 
|  | 8 |  | 
|  | 9 | # Checks for programs. | 
|  | 10 | AC_PROG_CXX | 
|  | 11 | AM_PROG_AR | 
|  | 12 | AC_PROG_INSTALL | 
|  | 13 | AC_PROG_MAKE_SET | 
|  | 14 |  | 
|  | 15 | # Checks for typedefs, structures, and compiler characteristics. | 
|  | 16 | AX_CXX_COMPILE_STDCXX_17([noext]) | 
|  | 17 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) | 
|  | 18 |  | 
|  | 19 | # Checks for library functions. | 
|  | 20 | LT_INIT # Required for systemd linking | 
|  | 21 |  | 
|  | 22 | # Checks for libraries. | 
|  | 23 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],, [AC_MSG_ERROR([Could not find phosphor-logging...openbmc/phosphor-logging package required])]) | 
|  | 24 | AC_CHECK_HEADER([blobs-ipmid], [AC_MSG_ERROR(["phosphor-ipmi-blobs required and not found."])]) | 
|  | 25 | AX_PTHREAD([], [AC_MSG_ERROR(["pthread required and not found"])]) | 
|  | 26 |  | 
| Patrick Venture | fa6c4d9 | 2018-11-02 18:34:53 -0700 | [diff] [blame^] | 27 | # Configurability | 
|  | 28 | # Enable static layout for firmware image staging. | 
|  | 29 | AC_ARG_ENABLE([static-layout], | 
|  | 30 | AS_HELP_STRING([--enable-static-layout], | 
|  | 31 | [Enable static layout firmware update via Blobs])) | 
|  | 32 | AS_IF([test "x$enable_static_layout" = "xyes"], [ | 
|  | 33 | AX_APPEND_COMPILE_FLAGS([-DENABLE_STATIC_LAYOUT], [CXXFLAGS]) | 
|  | 34 | ]) | 
|  | 35 | # Enable BlockTransfer, P2A, and or LPC. | 
|  | 36 |  | 
| Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 37 | # Check/set gtest specific functions. | 
|  | 38 | PKG_CHECK_MODULES([GTEST], [gtest], [], [AC_MSG_NOTICE([gtest not found, tests will not build])]) | 
|  | 39 | PKG_CHECK_MODULES([GMOCK], [gmock], [], [AC_MSG_NOTICE([gmock not found, tests will not build])]) | 
|  | 40 | PKG_CHECK_MODULES([GTEST_MAIN], [gtest_main], [], [AC_MSG_NOTICE([gtest_main not found, tests will not build])]) | 
|  | 41 |  | 
|  | 42 | # Add --enable-oe-sdk flag to configure script | 
|  | 43 | AC_ARG_ENABLE([oe-sdk], | 
|  | 44 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) | 
|  | 45 | ) | 
|  | 46 |  | 
|  | 47 | # Check for OECORE_TARGET_SYSROOT in the environment. | 
|  | 48 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, | 
|  | 49 | [Path to the OE SDK SYSROOT]) | 
|  | 50 |  | 
|  | 51 | # Configure OESDK_TESTCASE_FLAGS environment variable, which will be later | 
|  | 52 | # used in test/Makefile.am | 
|  | 53 | AS_IF([test "x$enable_oe_sdk" == "xyes"], | 
|  | 54 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], | 
|  | 55 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) | 
|  | 56 | ) | 
|  | 57 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) | 
|  | 58 | [ | 
|  | 59 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" | 
|  | 60 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" | 
|  | 61 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" | 
|  | 62 | ] | 
|  | 63 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) | 
|  | 64 | ) | 
|  | 65 |  | 
|  | 66 | # Create configured output | 
|  | 67 | AC_CONFIG_FILES([Makefile]) | 
|  | 68 | AC_OUTPUT |