Vishwanatha Subbanna | 835571e | 2016-11-30 11:29:30 +0530 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-led-sysfs], [1.0], [https://github.com/openbmc/phosphor-led-sysfs/issues]) |
| 4 | AC_LANG([C++]) |
| 5 | AC_CONFIG_HEADERS([config.h]) |
| 6 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 7 | AM_SILENT_RULES([yes]) |
| 8 | |
| 9 | # Checks for programs. |
| 10 | AC_PROG_CXX |
| 11 | AC_PROG_INSTALL |
| 12 | AC_PROG_MAKE_SET |
| 13 | |
| 14 | # Checks for libraries. |
| 15 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221]) |
| 16 | |
| 17 | # Checks for typedefs, structures, and compiler characteristics. |
| 18 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 19 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 20 | |
Vishwanatha Subbanna | 179b671 | 2017-02-17 11:20:38 +0530 | [diff] [blame] | 21 | # For libtools |
| 22 | LT_INIT |
| 23 | |
Vishwanatha Subbanna | 835571e | 2016-11-30 11:29:30 +0530 | [diff] [blame] | 24 | # Checks for header files. |
Vishwanatha Subbanna | 7f6e809 | 2017-03-10 15:17:12 +0530 | [diff] [blame] | 25 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR([Could not find sdbusplus...openbmc/sdbusplus package required])]) |
Vishwanatha Subbanna | e089173 | 2017-03-10 15:27:23 +0530 | [diff] [blame] | 26 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],, [AC_MSG_ERROR([Could not find phosphor-dbus-interfaces...openbmc/phosphor-dbus-interfaces package required])]) |
Vishwanatha Subbanna | 835571e | 2016-11-30 11:29:30 +0530 | [diff] [blame] | 27 | |
| 28 | # Check/set gtest specific functions. |
| 29 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 30 | AC_SUBST(GTEST_CPPFLAGS) |
| 31 | |
| 32 | AC_ARG_VAR(BUSNAME, [The Dbus busname to own]) |
Vishwanatha Subbanna | 84ade67 | 2017-02-02 15:02:23 +0530 | [diff] [blame] | 33 | AS_IF([test "x$BUSNAME" == "x"], [BUSNAME="xyz.openbmc_project.LED.Controller"]) |
Vishwanatha Subbanna | 835571e | 2016-11-30 11:29:30 +0530 | [diff] [blame] | 34 | AC_DEFINE_UNQUOTED([BUSNAME], ["$BUSNAME"], [The Dbus busname to own]) |
Vishwanatha Subbanna | 84ade67 | 2017-02-02 15:02:23 +0530 | [diff] [blame] | 35 | AC_ARG_VAR(OBJPATH, [The physical LED controller Dbus root]) |
| 36 | AS_IF([test "x$OBJPATH" == "x"], [OBJPATH="/xyz/openbmc_project/led/physical"]) |
| 37 | AC_DEFINE_UNQUOTED([OBJPATH], ["$OBJPATH"], [The physical LED controller Dbus root]) |
Vishwanatha Subbanna | 835571e | 2016-11-30 11:29:30 +0530 | [diff] [blame] | 38 | |
Vishwanatha Subbanna | f9de54b | 2017-05-25 21:06:33 +0530 | [diff] [blame] | 39 | # Platform device path for led subsystem. |
| 40 | AC_ARG_VAR(DEVPATH, [Physical led device path]) |
| 41 | AS_IF([test "x$DEVPATH" == "x"], [DEVPATH="/sys/class/leds/"]) |
| 42 | AC_DEFINE_UNQUOTED([DEVPATH], ["$DEVPATH"], [Physical led device path]) |
| 43 | |
Vishwanatha Subbanna | 835571e | 2016-11-30 11:29:30 +0530 | [diff] [blame] | 44 | # Create configured output |
| 45 | AC_CONFIG_FILES([Makefile]) |
| 46 | AC_OUTPUT |