blob: 6eec9851dadb22b955c6642fb63a94985324b310 [file] [log] [blame]
Jayanth Othayoth0aa0d112018-09-03 03:47:27 -05001# Initialization
2AC_PREREQ([2.69])
3AC_INIT([phosphor-certificate-manager], [1.0], [https://github.com/openbmc/phosphor-certificate-manager/issues])
4AC_LANG([C++])
5AC_CONFIG_HEADERS([config.h])
6AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
7AM_SILENT_RULES([yes])
8
9# Checks for programs.
10AC_PROG_CXX
11AC_PROG_INSTALL
12AC_PROG_MAKE_SET
13
14# Checks for library functions
15LT_INIT # Required for systemd linking
16
17# Checks for typedefs, structures, and compiler characteristics.
18AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
19AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
20
Jayanth Othayothcfbc8dc2018-09-03 07:22:27 -050021# Check for libraries
Patrick Venture8d100c12018-12-03 08:36:00 -080022AX_CHECK_OPENSSL([], [AC_MSG_ERROR(["openssl required and not found"])])
Jayanth Othayothcfbc8dc2018-09-03 07:22:27 -050023PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\
24 AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
25PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,
26 AC_MSG_ERROR(["Requires sdbusplus package."]))
27PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
28 AC_MSG_ERROR(["Requires phosphor-logging package."]))
29
30# Code coverage
31AX_CODE_COVERAGE
32
Marri Devender Rao947258d2018-09-25 10:52:24 -050033# Check/set gtest specific functions.
34AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
35AC_SUBST(GTEST_CPPFLAGS)
36
37AC_ARG_ENABLE([oe-sdk],
38 AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
39)
40AC_ARG_VAR(OECORE_TARGET_SYSROOT,
41 [Path to the OE SDK SYSROOT])
42AS_IF([test "x$enable_oe_sdk" == "xyes"],
43 AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
44 AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
45 )
46 AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
47 [
48 testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
49 testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
50 testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
51 ]
52 AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
53)
Jayanth Othayothcfbc8dc2018-09-03 07:22:27 -050054AC_ARG_VAR(BUSNAME, [The D-Bus busname to own])
55AS_IF([test "x$BUSNAME" == "x"], [BUSNAME="xyz.openbmc_project.Certs.Manager"])
56AC_DEFINE_UNQUOTED([BUSNAME], ["$BUSNAME"], [The D-Bus busname to own])
57AC_ARG_VAR(OBJPATH, [The certificate manager D-Bus root])
58AS_IF([test "x$OBJPATH" == "x"], [OBJPATH="/xyz/openbmc_project/certs"])
59AC_DEFINE_UNQUOTED([OBJPATH], ["$OBJPATH"], [The certificate manager D-Bus root])
60
Jayanth Othayoth0aa0d112018-09-03 03:47:27 -050061# Create configured output
Marri Devender Rao947258d2018-09-25 10:52:24 -050062AC_CONFIG_FILES([Makefile test/Makefile])
Jayanth Othayoth0aa0d112018-09-03 03:47:27 -050063AC_OUTPUT