blob: da35058751876b5b998b9d5eee90483364d66f8d [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
22PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\
23 AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
24PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,
25 AC_MSG_ERROR(["Requires sdbusplus package."]))
26PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
27 AC_MSG_ERROR(["Requires phosphor-logging package."]))
28
29# Code coverage
30AX_CODE_COVERAGE
31
Marri Devender Rao947258d2018-09-25 10:52:24 -050032# Check/set gtest specific functions.
33AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
34AC_SUBST(GTEST_CPPFLAGS)
35
36AC_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)
39AC_ARG_VAR(OECORE_TARGET_SYSROOT,
40 [Path to the OE SDK SYSROOT])
41AS_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 Othayothcfbc8dc2018-09-03 07:22:27 -050053AC_ARG_VAR(BUSNAME, [The D-Bus busname to own])
54AS_IF([test "x$BUSNAME" == "x"], [BUSNAME="xyz.openbmc_project.Certs.Manager"])
55AC_DEFINE_UNQUOTED([BUSNAME], ["$BUSNAME"], [The D-Bus busname to own])
56AC_ARG_VAR(OBJPATH, [The certificate manager D-Bus root])
57AS_IF([test "x$OBJPATH" == "x"], [OBJPATH="/xyz/openbmc_project/certs"])
58AC_DEFINE_UNQUOTED([OBJPATH], ["$OBJPATH"], [The certificate manager D-Bus root])
59
Jayanth Othayoth0aa0d112018-09-03 03:47:27 -050060# Create configured output
Marri Devender Rao947258d2018-09-25 10:52:24 -050061AC_CONFIG_FILES([Makefile test/Makefile])
Jayanth Othayoth0aa0d112018-09-03 03:47:27 -050062AC_OUTPUT