Vishwanatha Subbanna | b21fda7 | 2016-10-17 17:46:37 +0530 | [diff] [blame] | 1 | # Initialization |
| 2 | AC_PREREQ([2.69]) |
| 3 | AC_INIT([phosphor-led-manager], [1.0], [https://github.com/openbmc/phosphor-led-manager/issues]) |
Vishwanatha Subbanna | bb8fe0b | 2016-11-12 18:29:38 +0530 | [diff] [blame] | 4 | AC_LANG([C++]) |
Vishwanatha Subbanna | b21fda7 | 2016-10-17 17:46:37 +0530 | [diff] [blame] | 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 |
Vishwanatha Subbanna | b21fda7 | 2016-10-17 17:46:37 +0530 | [diff] [blame] | 11 | AC_PROG_INSTALL |
| 12 | AC_PROG_MAKE_SET |
Vishwanatha Subbanna | bb8fe0b | 2016-11-12 18:29:38 +0530 | [diff] [blame] | 13 | |
| 14 | # Checks for typedefs, structures, and compiler characteristics. |
Vernon Mauery | 2ff07f3 | 2018-10-04 10:22:26 -0700 | [diff] [blame] | 15 | AX_CXX_COMPILE_STDCXX_17([noext]) |
Vishwanatha Subbanna | bb8fe0b | 2016-11-12 18:29:38 +0530 | [diff] [blame] | 16 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
Vishwanatha Subbanna | b21fda7 | 2016-10-17 17:46:37 +0530 | [diff] [blame] | 17 | |
| 18 | # Python |
Vishwanatha Subbanna | 4f43f5e | 2020-03-09 03:56:57 -0500 | [diff] [blame] | 19 | AM_PATH_PYTHON([3], [AC_SUBST([PYTHON], [echo "$PYTHON"])], [AC_MSG_ERROR([Could not find python-3 installed...python-3 is required])]) |
Vishwanatha Subbanna | b21fda7 | 2016-10-17 17:46:37 +0530 | [diff] [blame] | 20 | |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 21 | LT_INIT # Removes WARNING: unrecognized options: --with-libtool-sysroot |
Vishwanatha Subbanna | bb8fe0b | 2016-11-12 18:29:38 +0530 | [diff] [blame] | 22 | # Check/set gtest specific functions. |
| 23 | AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) |
| 24 | AC_SUBST(GTEST_CPPFLAGS) |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 25 | AC_ARG_ENABLE([oe-sdk], |
| 26 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 27 | ) |
| 28 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 29 | [Path to the OE SDK SYSROOT]) |
| 30 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 31 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 32 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 33 | ) |
| 34 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 35 | [ |
| 36 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 37 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 38 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 39 | ] |
| 40 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 41 | ) |
Vishwanatha Subbanna | bb8fe0b | 2016-11-12 18:29:38 +0530 | [diff] [blame] | 42 | |
Vishwanatha Subbanna | e89f727 | 2017-03-10 13:16:20 +0530 | [diff] [blame] | 43 | # Checks for modules |
| 44 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR([Could not find sdbusplus...openbmc/sdbusplus package required])]) |
Vishwanatha Subbanna | 11ca8f9 | 2017-02-27 19:33:45 +0530 | [diff] [blame] | 45 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],, [AC_MSG_ERROR([Could not find phosphor-logging...openbmc/phosphor-logging package required])]) |
Vishwanatha Subbanna | 55ef5b0 | 2017-03-10 13:32:08 +0530 | [diff] [blame] | 46 | PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],, [AC_MSG_ERROR([Could not find phosphor-dbus-interfaces...openbmc/phosphor-dbus-interfaces package required])]) |
George Liu | e91bc4c | 2020-07-01 10:49:13 +0800 | [diff] [blame] | 47 | AC_CHECK_HEADER(nlohmann/json.hpp, ,[AC_MSG_ERROR([Could not find nlohmann/json.hpp...nlohmann/json package required])]) |
Vishwanatha Subbanna | b21fda7 | 2016-10-17 17:46:37 +0530 | [diff] [blame] | 48 | |
Dhruvaraj Subhashchandran | 3c6f29a | 2017-04-20 09:47:28 -0500 | [diff] [blame] | 49 | # Check for sdbus++ tool |
| 50 | AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) |
| 51 | AS_IF([test "x$SDBUSPLUSPLUS" == "x"], AC_MSG_ERROR([Cannot find sdbus++])) |
| 52 | |
Vishwanatha Subbanna | bb8fe0b | 2016-11-12 18:29:38 +0530 | [diff] [blame] | 53 | # Dbus service name |
Vishwanatha Subbanna | b21fda7 | 2016-10-17 17:46:37 +0530 | [diff] [blame] | 54 | AC_ARG_VAR(BUSNAME, [The Dbus busname to own]) |
Vishwanatha Subbanna | a1c7f6a | 2017-02-02 14:51:42 +0530 | [diff] [blame] | 55 | AS_IF([test "x$BUSNAME" == "x"], [BUSNAME="xyz.openbmc_project.LED.GroupManager"]) |
Vishwanatha Subbanna | bb8fe0b | 2016-11-12 18:29:38 +0530 | [diff] [blame] | 56 | AC_DEFINE_UNQUOTED([BUSNAME], ["$BUSNAME"], [The Dbus busname to own]) |
| 57 | |
| 58 | # Service dbus root |
Vishwanatha Subbanna | a1c7f6a | 2017-02-02 14:51:42 +0530 | [diff] [blame] | 59 | AC_ARG_VAR(OBJPATH, [The LED group Dbus root]) |
| 60 | AS_IF([test "x$OBJPATH" == "x"], [OBJPATH="/xyz/openbmc_project/led/groups"]) |
| 61 | AC_DEFINE_UNQUOTED([OBJPATH], ["$OBJPATH"], [The LED group Dbus root]) |
Vishwanatha Subbanna | bb8fe0b | 2016-11-12 18:29:38 +0530 | [diff] [blame] | 62 | |
Vishwanatha Subbanna | a352376 | 2017-01-23 17:26:46 +0530 | [diff] [blame] | 63 | # Handling configuration files |
| 64 | AC_ARG_VAR(YAML_PATH, [The path to the yaml config files.]) |
| 65 | AS_IF([test "x$YAML_PATH" == "x"], [YAML_PATH="$srcdir"]) |
Brad Bishop | 513f58e | 2017-02-08 13:25:17 -0500 | [diff] [blame] | 66 | LEDGEN="$PYTHON $srcdir/parse_led.py -i $YAML_PATH" |
Brad Bishop | d782d8e | 2017-02-01 21:23:50 -0500 | [diff] [blame] | 67 | AC_SUBST(LEDGEN) |
Vishwanatha Subbanna | a352376 | 2017-01-23 17:26:46 +0530 | [diff] [blame] | 68 | |
George Liu | def5f5a | 2020-04-10 11:23:52 +0800 | [diff] [blame] | 69 | # JSON configuration file |
| 70 | AC_ARG_VAR(LED_JSON_FILE, [The LED configuration JSON file]) |
| 71 | AS_IF([test "x$LED_JSON_FILE" == "x"], [LED_JSON_FILE="/usr/share/phosphor-led-manager/led-group-config.json"]) |
| 72 | AC_DEFINE_UNQUOTED([LED_JSON_FILE], ["$LED_JSON_FILE"], [The LED configuration JSON file]) |
| 73 | |
George Liu | 2098aa6 | 2020-05-09 11:26:35 +0800 | [diff] [blame] | 74 | AC_ARG_VAR(CLASS_VERSION, [Class version to register with Cereal]) |
| 75 | AS_IF([test "x$CLASS_VERSION" == "x"], [CLASS_VERSION=1]) |
| 76 | AC_DEFINE_UNQUOTED([CLASS_VERSION], [$CLASS_VERSION], [Class version to register with Cereal]) |
| 77 | |
George Liu | def5f5a | 2020-04-10 11:23:52 +0800 | [diff] [blame] | 78 | # enable JSON configuration |
George Liu | e06270c | 2020-07-17 16:45:35 +0800 | [diff] [blame] | 79 | AC_ARG_ENABLE([use-json], |
| 80 | AS_HELP_STRING([--enable-use-json], [Enable JSON configuration.])) |
George Liu | 937a0bd | 2020-07-03 15:29:20 +0800 | [diff] [blame] | 81 | AM_CONDITIONAL([WANTS_JSON], [test "x$enable_use_json" == "xyes"]) |
| 82 | AS_IF([test "x$enable_use_json" == "xyes"], |
| 83 | AC_DEFINE([LED_USE_JSON],[],[Enable JSON configuration.]) |
| 84 | ) |
George Liu | def5f5a | 2020-04-10 11:23:52 +0800 | [diff] [blame] | 85 | |
George Liu | 19c48e1 | 2020-09-21 14:41:33 +0800 | [diff] [blame] | 86 | # enable lamp test configuration |
| 87 | AC_ARG_ENABLE([use-lamp-test], |
| 88 | AS_HELP_STRING([--enable-use-lamp-test], [Enable lamp test configuration.])) |
| 89 | AM_CONDITIONAL([WANTS_LAMP_TEST], [test "x$enable_use_lamp_test" == "xyes"]) |
| 90 | AS_IF([test "x$enable_use_lamp_test" == "xyes"], |
| 91 | AC_DEFINE([USE_LAMP_TEST],[],[Enable lamp test configuration.]) |
| 92 | ) |
| 93 | |
George Liu | 2098aa6 | 2020-05-09 11:26:35 +0800 | [diff] [blame] | 94 | # Path of file for storing the names of asserted groups |
| 95 | AC_ARG_VAR(SAVED_GROUPS_FILE, [Path of file for storing the names of asserted groups]) |
| 96 | AS_IF([test "x$SAVED_GROUPS_FILE" == "x"], [SAVED_GROUPS_FILE="/var/lib/phosphor-led-manager/savedGroups"]) |
| 97 | AC_DEFINE_UNQUOTED([SAVED_GROUPS_FILE], ["$SAVED_GROUPS_FILE"], [Path of file for storing the names of asserted groups]) |
| 98 | |
Dhruvaraj Subhashchandran | 59b86cd | 2017-04-13 00:19:44 -0500 | [diff] [blame] | 99 | AC_DEFINE(CALLOUT_FWD_ASSOCIATION, "callout", [The name of the callout's forward association.]) |
| 100 | AC_DEFINE(CALLOUT_REV_ASSOCIATION, "fault", [The name of the callout's reverse association.]) |
Dhruvaraj Subhashchandran | 3c6f29a | 2017-04-20 09:47:28 -0500 | [diff] [blame] | 101 | AC_DEFINE(ELOG_ENTRY, "entry", [Path element indicates an error log entry under logging namespace.]) |
| 102 | AC_DEFINE(LED_FAULT, "fault", [Path element to indicates a fault led under led groups.]) |
Dhruvaraj Subhashchandran | 59b86cd | 2017-04-13 00:19:44 -0500 | [diff] [blame] | 103 | |
Vishwanatha Subbanna | b21fda7 | 2016-10-17 17:46:37 +0530 | [diff] [blame] | 104 | # Create configured output |
Dhruvaraj Subhashchandran | 59b86cd | 2017-04-13 00:19:44 -0500 | [diff] [blame] | 105 | AC_CONFIG_FILES([Makefile test/Makefile fault-monitor/Makefile]) |
Vishwanatha Subbanna | b21fda7 | 2016-10-17 17:46:37 +0530 | [diff] [blame] | 106 | AC_OUTPUT |