From 14321846e57f483f472590b1c5fe35891511312f Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Fri, 28 Apr 2017 15:27:43 -0500 Subject: Generate data from yaml during build Run the python script to generate fan_zone_defs.cpp Change-Id: I242aa4246a277509ddbcf1c62fec96782a48b37b Signed-off-by: Matt Spinler --- configure.ac | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index eb6e086..93c1523 100644 --- a/configure.ac +++ b/configure.ac @@ -57,6 +57,8 @@ AC_ARG_ENABLE([control], AS_HELP_STRING([--disable-control], [Disable fan control package.])) AC_ARG_ENABLE([cooling-type], AS_HELP_STRING([--disable-cooling-type], [Disable cooling-type package.])) +AC_ARG_ENABLE([monitor-type], + AS_HELP_STRING([--disable-monitor-type], [Disable monitor-type package.])) AM_CONDITIONAL([WANT_PRESENCE], [test "x$enable_presence" != "xno"]) AM_CONDITIONAL([WANT_CONTROL], [test "x$enable_control" != "xno"]) @@ -115,6 +117,26 @@ AS_IF([test "x$enable_cooling-type" != "xno"], [ AC_CONFIG_FILES([chassis-cooling-type/Makefile]) ]) AS_IF([test "x$enable_monitor" != "xno"], [ + + AC_ARG_VAR(FAN_MONITOR_YAML_FILE, + [The fan monitor definition file to use]) + AS_IF([test "x$FAN_MONITOR_YAML_FILE" == "x"], + [FAN_MONITOR_YAML_FILE="${srcdir}/monitor/example/monitor.yaml"]) + AC_DEFINE_UNQUOTED([FAN_MONITOR_YAML_FILE], ["$FAN_MONITOR_YAML_FILE"], + [The fan monitor definition file to use]) + + AC_ARG_VAR(FAN_MONITOR_OUTPUT_DIR, + [The output directory for the generated fan monitor data file]) + AS_IF([test "x$FAN_MONITOR_OUTPUT_DIR" == "x"], + [FAN_MONITOR_OUTPUT_DIR="${srcdir}/monitor/"]) + AC_DEFINE_UNQUOTED([FAN_MONITOR_OUTPUT_DIR], ["$FAN_MONITOR_OUTPUT_DIR"], + [The output directory for the generated fan monitor data file]) + + AC_SUBST([GEN_FAN_MONITOR_DEFS], + [$PYTHON ${srcdir}/monitor/gen-fan-monitor-defs.py \ + -m $FAN_MONITOR_YAML_FILE \ + -o $FAN_MONITOR_OUTPUT_DIR]) + AC_CONFIG_FILES([monitor/Makefile]) ]) -- cgit v1.2.1