blob: 6a08be339e16ea8317ae1ac0fd6a551d77b191f9 [file] [log] [blame]
Vishwanatha Subbanna835571e2016-11-30 11:29:30 +05301# Initialization
2AC_PREREQ([2.69])
3AC_INIT([phosphor-led-sysfs], [1.0], [https://github.com/openbmc/phosphor-led-sysfs/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 libraries.
15PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
16
17# Checks for typedefs, structures, and compiler characteristics.
18AX_CXX_COMPILE_STDCXX_14([noext])
19AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
20
Vishwanatha Subbanna179b6712017-02-17 11:20:38 +053021# For libtools
22LT_INIT
23
Vishwanatha Subbanna835571e2016-11-30 11:29:30 +053024# Checks for header files.
Vishwanatha Subbanna7f6e8092017-03-10 15:17:12 +053025PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR([Could not find sdbusplus...openbmc/sdbusplus package required])])
Vishwanatha Subbannae0891732017-03-10 15:27:23 +053026PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],, [AC_MSG_ERROR([Could not find phosphor-dbus-interfaces...openbmc/phosphor-dbus-interfaces package required])])
Vishwanatha Subbanna835571e2016-11-30 11:29:30 +053027
28# Check/set gtest specific functions.
29AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
30AC_SUBST(GTEST_CPPFLAGS)
31
32AC_ARG_VAR(BUSNAME, [The Dbus busname to own])
Vishwanatha Subbanna84ade672017-02-02 15:02:23 +053033AS_IF([test "x$BUSNAME" == "x"], [BUSNAME="xyz.openbmc_project.LED.Controller"])
Vishwanatha Subbanna835571e2016-11-30 11:29:30 +053034AC_DEFINE_UNQUOTED([BUSNAME], ["$BUSNAME"], [The Dbus busname to own])
Vishwanatha Subbanna84ade672017-02-02 15:02:23 +053035AC_ARG_VAR(OBJPATH, [The physical LED controller Dbus root])
36AS_IF([test "x$OBJPATH" == "x"], [OBJPATH="/xyz/openbmc_project/led/physical"])
37AC_DEFINE_UNQUOTED([OBJPATH], ["$OBJPATH"], [The physical LED controller Dbus root])
Vishwanatha Subbanna835571e2016-11-30 11:29:30 +053038
Vishwanatha Subbannaf9de54b2017-05-25 21:06:33 +053039# Platform device path for led subsystem.
40AC_ARG_VAR(DEVPATH, [Physical led device path])
41AS_IF([test "x$DEVPATH" == "x"], [DEVPATH="/sys/class/leds/"])
42AC_DEFINE_UNQUOTED([DEVPATH], ["$DEVPATH"], [Physical led device path])
43
Vishwanatha Subbanna835571e2016-11-30 11:29:30 +053044# Create configured output
45AC_CONFIG_FILES([Makefile])
46AC_OUTPUT