Patrick Venture | accc917 | 2018-07-24 10:51:58 -0700 | [diff] [blame] | 1 | |
| 2 | # Initialization |
| 3 | AC_PREREQ([2.69]) |
| 4 | AC_INIT([flash-ipmi], [1.0], [https://www.google.com]) |
| 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 | AM_PROG_AR |
| 13 | AC_PROG_INSTALL |
| 14 | AC_PROG_MAKE_SET |
| 15 | |
| 16 | # Checks for typedefs, structures, and compiler characteristics. |
| 17 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 18 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 19 | |
| 20 | # Checks for libraries. |
| 21 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221], [], [AC_MSG_ERROR(["systemd required and not found"])]) |
| 22 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], ,[AC_MSG_ERROR([The openbmc/sdbusplus package is required])]) |
| 23 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging], ,[AC_MSG_ERROR([The openbmc/phosphor-logging package is required])]) |
| 24 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces], [], [AC_MSG_ERROR(["phosphor-dbus-interfaces required and not found."])]) |
| 25 | AC_CHECK_HEADER([host-ipmid], [AC_MSG_ERROR(["phosphor-host-ipmid required and not found."])]) |
| 26 | |
| 27 | # Checks for library functions. |
| 28 | LT_INIT # Required for systemd linking |
| 29 | |
| 30 | # Check/set gtest specific functions. |
| 31 | PKG_CHECK_MODULES([GTEST], [gtest], [], [AC_MSG_NOTICE([gtest not found, tests will not build])]) |
| 32 | PKG_CHECK_MODULES([GMOCK], [gmock], [], [AC_MSG_NOTICE([gmock not found, tests will not build])]) |
| 33 | PKG_CHECK_MODULES([GTEST_MAIN], [gtest_main], [], [AC_MSG_NOTICE([gtest_main not found, tests will not build])]) |
| 34 | |
| 35 | # Do you want to register as a Google OEM IPMI handler as well as firmware? |
| 36 | AC_ARG_ENABLE([google], |
| 37 | AS_HELP_STRING([--enable-google], [Enable registration as Google OEM IPMI Handler]) |
| 38 | ) |
| 39 | |
| 40 | AC_ARG_VAR(ENABLE_GOOGLE, [Enable registration as Google OEM IPMI Handler]) |
| 41 | |
| 42 | AS_IF([test "x$enable_google" == "xyes"], |
| 43 | [ENABLE_GOOGLE="yes"] |
| 44 | AC_DEFINE_UNQUOTED([ENABLE_GOOGLE], ["$ENABLE_GOOGLE"], [Enable registration as Google OEM IPMI Handler]) |
| 45 | ) |
| 46 | |
| 47 | # Add --enable-oe-sdk flag to configure script |
| 48 | AC_ARG_ENABLE([oe-sdk], |
| 49 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 50 | ) |
| 51 | |
| 52 | # Check for OECORE_TARGET_SYSROOT in the environment. |
| 53 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 54 | [Path to the OE SDK SYSROOT]) |
| 55 | |
| 56 | # Configure OESDK_TESTCASE_FLAGS environment variable, which will be later |
| 57 | # used in test/Makefile.am |
| 58 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 59 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 60 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 61 | ) |
| 62 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 63 | [ |
| 64 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 65 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 66 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 67 | ] |
| 68 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 69 | ) |
| 70 | |
Patrick Venture | 8ec019f | 2018-08-07 11:22:33 -0700 | [diff] [blame] | 71 | AC_ARG_VAR(STAGING_PATH, [The staging path for the flash image.]) |
| 72 | AS_IF([test "x$STAGING_PATH" == "x"], [STAGING_PATH="/run/initramfs/bmc-image"]) |
| 73 | AC_DEFINE_UNQUOTED([STAGING_PATH], ["$STAGING_PATH"], [The staging path for the flash image.]) |
| 74 | |
Patrick Venture | accc917 | 2018-07-24 10:51:58 -0700 | [diff] [blame] | 75 | # Create configured output |
Patrick Venture | 54c3b53 | 2018-08-01 11:45:49 -0700 | [diff] [blame] | 76 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Patrick Venture | accc917 | 2018-07-24 10:51:58 -0700 | [diff] [blame] | 77 | AC_OUTPUT |