blob: 059f612df9907759b33e117f28806d1d6e2a9e7c [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])
4AC_CONFIG_HEADERS([config.h])
5AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
6AM_SILENT_RULES([yes])
7
8# Checks for programs.
9AC_PROG_CXX
10AX_CXX_COMPILE_STDCXX_14([noext])
11AM_PROG_AR
12AC_PROG_INSTALL
13AC_PROG_MAKE_SET
14LT_INIT
15
16# Python
17AM_PATH_PYTHON([2.7], [AC_SUBST([PYTHON], [echo "$PYTHON"])], [AC_MSG_ERROR([Could not find python-2.7 installed...python-2.7 is required])])
18
19# Checks for libraries.
20PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
21
22# Checks for header files.
23AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd developement package required])])
24#AC_CHECK_HEADER(sdbusplus/vtable.hpp, ,[AC_MSG_ERROR([Could not find vtable.hpp...openbmc/sdbusplus package required])])
25#AC_CHECK_HEADER(dbusplus/message.hpp, ,[AC_MSG_ERROR([Could not find messsage.hpp...openbmc/sdbusplus package required])])
26#AC_CHECK_HEADER(sdbusplus/bus.hpp, ,[AC_MSG_ERROR([Could not find bus.hpp...openbmc/sdbusplus package required])])
27
28# Checks for typedefs, structures, and compiler characteristics.
29AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
30AC_ARG_VAR(BUSNAME, [The Dbus busname to own])
31AC_ARG_VAR(OBJPATH, [The Ledmanager Dbus root])
32AC_ARG_VAR(INTERFACE, [The Ledmanager Dbus interface])
33AS_IF([test "x$BUSNAME" == "x"], [BUSNAME="xyz.openbmc_project.ledmanager"])
34AS_IF([test "x$OBJPATH" == "x"], [OBJPATH="/xyz/openbmc_project/ledmanager/groups"])
35AS_IF([test "x$INTERFACE" == "x"], [INTERFACE="xyz.openbmc_project.Ledmanager"])
36AC_DEFINE_UNQUOTED([BUSNAME], ["$BUSNAME"], [The DBus busname to own])
37AC_DEFINE_UNQUOTED([OBJPATH], ["$OBJPATH"], [The Ledmanager Dbus root])
38AC_DEFINE_UNQUOTED([INTERFACE], ["$INTERFACE"], [The Ledmanager Dbus interface])
39
40# Create configured output
41AC_CONFIG_FILES([Makefile])
42AC_OUTPUT