Jayanth Othayoth | 0aa0d11 | 2018-09-03 03:47:27 -0500 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-certificate-manager], [1.0], [https://github.com/openbmc/phosphor-certificate-manager/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 | AC_PROG_INSTALL |
| 12 | AC_PROG_MAKE_SET |
| 13 | |
| 14 | # Checks for library functions |
| 15 | LT_INIT # Required for systemd linking |
| 16 | |
| 17 | # Checks for typedefs, structures, and compiler characteristics. |
| 18 | AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory]) |
| 19 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 20 | |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 21 | # Check for libraries |
| 22 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\ |
| 23 | AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."])) |
| 24 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, |
| 25 | AC_MSG_ERROR(["Requires sdbusplus package."])) |
| 26 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\ |
| 27 | AC_MSG_ERROR(["Requires phosphor-logging package."])) |
| 28 | |
| 29 | # Code coverage |
| 30 | AX_CODE_COVERAGE |
| 31 | |
Marri Devender Rao | 947258d | 2018-09-25 10:52:24 -0500 | [diff] [blame] | 32 | # Check/set gtest specific functions. |
| 33 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 34 | AC_SUBST(GTEST_CPPFLAGS) |
| 35 | |
| 36 | AC_ARG_ENABLE([oe-sdk], |
| 37 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 38 | ) |
| 39 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 40 | [Path to the OE SDK SYSROOT]) |
| 41 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 42 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 43 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 44 | ) |
| 45 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 46 | [ |
| 47 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 48 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 49 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 50 | ] |
| 51 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 52 | ) |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 53 | AC_ARG_VAR(BUSNAME, [The D-Bus busname to own]) |
| 54 | AS_IF([test "x$BUSNAME" == "x"], [BUSNAME="xyz.openbmc_project.Certs.Manager"]) |
| 55 | AC_DEFINE_UNQUOTED([BUSNAME], ["$BUSNAME"], [The D-Bus busname to own]) |
| 56 | AC_ARG_VAR(OBJPATH, [The certificate manager D-Bus root]) |
| 57 | AS_IF([test "x$OBJPATH" == "x"], [OBJPATH="/xyz/openbmc_project/certs"]) |
| 58 | AC_DEFINE_UNQUOTED([OBJPATH], ["$OBJPATH"], [The certificate manager D-Bus root]) |
| 59 | |
Jayanth Othayoth | 0aa0d11 | 2018-09-03 03:47:27 -0500 | [diff] [blame] | 60 | # Create configured output |
Marri Devender Rao | 947258d | 2018-09-25 10:52:24 -0500 | [diff] [blame] | 61 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Jayanth Othayoth | 0aa0d11 | 2018-09-03 03:47:27 -0500 | [diff] [blame] | 62 | AC_OUTPUT |