blob: 612c3f488089195b100c8d4bc91ae81da8a99e26 [file] [log] [blame]
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +05301# Initialization
2AC_PREREQ([2.69])
3AC_INIT([phosphor-led-manager], [1.0], [https://github.com/openbmc/phosphor-led-manager/issues])
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +05304AC_LANG([C++])
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +05305AC_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
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053011AC_PROG_INSTALL
12AC_PROG_MAKE_SET
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +053013
14# Checks for typedefs, structures, and compiler characteristics.
15AX_CXX_COMPILE_STDCXX_14([noext])
16AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053017
18# Python
19AM_PATH_PYTHON([2.7], [AC_SUBST([PYTHON], [echo "$PYTHON"])], [AC_MSG_ERROR([Could not find python-2.7 installed...python-2.7 is required])])
20
21# Checks for libraries.
22PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
23
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +053024# Check/set gtest specific functions.
25AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
26AC_SUBST(GTEST_CPPFLAGS)
27
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053028# Checks for header files.
29AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd developement package required])])
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +053030AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...openbmc/sdbusplus package required])])
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053031
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +053032# Dbus service name
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053033AC_ARG_VAR(BUSNAME, [The Dbus busname to own])
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053034AS_IF([test "x$BUSNAME" == "x"], [BUSNAME="xyz.openbmc_project.ledmanager"])
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +053035AC_DEFINE_UNQUOTED([BUSNAME], ["$BUSNAME"], [The Dbus busname to own])
36
37# Service dbus root
38AC_ARG_VAR(OBJPATH, [The Ledmanager Dbus root])
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053039AS_IF([test "x$OBJPATH" == "x"], [OBJPATH="/xyz/openbmc_project/ledmanager/groups"])
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053040AC_DEFINE_UNQUOTED([OBJPATH], ["$OBJPATH"], [The Ledmanager Dbus root])
Vishwanatha Subbannabb8fe0b2016-11-12 18:29:38 +053041
Vishwanatha Subbannab21fda72016-10-17 17:46:37 +053042# Create configured output
43AC_CONFIG_FILES([Makefile])
44AC_OUTPUT