diff options
author | Lei YU <mine260309@gmail.com> | 2017-01-20 14:02:03 +0800 |
---|---|---|
committer | Lei YU <mine260309@gmail.com> | 2017-08-01 10:31:07 +0800 |
commit | 2f9c0cc25478709f25f449d46ab9836152cf1cd9 (patch) | |
tree | 6af0f8cee0041350da38ca7b91a85e5b3a520577 /configure.ac | |
parent | 4188567ae87609943489e559ab2067f1cbc76f40 (diff) | |
download | phosphor-time-manager-2f9c0cc25478709f25f449d46ab9836152cf1cd9.tar.gz phosphor-time-manager-2f9c0cc25478709f25f449d46ab9836152cf1cd9.zip |
Intialize new phosphor-time-manager
phosphor-time-manager will be refactored to use sdbusplus interfaces.
This is a initial commit that EpochBase is implemented based on dbus
interface xyz/openbmc_project/Time/EpochTime.interface.yaml.
EpochBase is the base class that wraps EpochTime interface, and is
initialized with time mode and owner from settingsd.
An initial unit test case is added.
Change-Id: Ic944b70f63ec3c0329762cc8874f0f57b09ddce3
Signed-off-by: Lei YU <mine260309@gmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac index fc0da82..03f8347 100644 --- a/configure.ac +++ b/configure.ac @@ -1,43 +1,34 @@ # Initialization AC_PREREQ([2.69]) AC_INIT([phosphor-time-manager], [1.0], [https://github.com/openbmc/phosphor-time-manager/issues]) +AC_LANG([C++]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) AM_SILENT_RULES([yes]) -# Checks for programs. +# Checks for programs AC_PROG_CXX -AX_CXX_COMPILE_STDCXX_14([noext]) -AC_PROG_CC AM_PROG_AR -AC_PROG_INSTALL -AC_PROG_MAKE_SET -# Checks for libraries. -AC_CHECK_LIB([mapper], [mapper_get_service], ,[AC_MSG_ERROR([Could not find libmapper...openbmc/phosphor-objmgr package required])]) -PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) +# Surpress the --with-libtool-sysroot error +LT_INIT + +# Check for libraries +PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221],,\ + AC_MSG_ERROR(["Systemd required and not found"])) PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\ AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."])) -PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, +PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\ AC_MSG_ERROR(["Requires sdbusplus package."])) PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\ AC_MSG_ERROR(["Requires phosphor-logging package."])) -# Checks for header files. -AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd developement package required])]) - -# Checks for typedefs, structures, and compiler characteristics. -AX_CXX_COMPILE_STDCXX_14([noext]) -AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS]) -AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) - -# Checks for library functions. -LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot' - +# gtest # Check/set gtest specific functions. AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) AC_SUBST(GTEST_CPPFLAGS) +# Test cases require SDK so only build if we're told to (and SDK is available) AC_ARG_ENABLE([oe-sdk], AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) ) @@ -56,6 +47,23 @@ AS_IF([test "x$enable_oe_sdk" == "xyes"], AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) ) -# Create configured output -AC_CONFIG_FILES([Makefile]) +# Checks for typedefs, structures, and compiler characteristics. +AX_CXX_COMPILE_STDCXX_14([noext]) +AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS]) + +# DBUS interface +AC_ARG_VAR(BUSNAME, [The Time Manager Dbus busname to own]) +AS_IF([test "x$BUSNAME" == "x"], [BUSNAME="xyz.openbmc_project.Time.Manager"]) +AC_DEFINE_UNQUOTED([BUSNAME], ["$BUSNAME"], [The Time Manager DBus busname to own]) + +AC_ARG_VAR(OBJPATH_BMC, [The bmc epoch Dbus root]) +AS_IF([test "x$OBJPATH_BMC" == "x"], [OBJPATH_BMC="/xyz/openbmc_project/time/bmc"]) +AC_DEFINE_UNQUOTED([OBJPATH_BMC], ["$OBJPATH_BMC"], [The bmc epoch Dbus root]) + +AC_ARG_VAR(OBJPATH_HOST, [The host epoch Dbus root]) +AS_IF([test "x$OBJPATH_HOST" == "x"], [OBJPATH_HOST="/xyz/openbmc_project/time/host"]) +AC_DEFINE_UNQUOTED([OBJPATH_HOST], ["$OBJPATH_HOST"], [The host epoch Dbus root]) + + +AC_CONFIG_FILES([Makefile test/Makefile]) AC_OUTPUT |