From 77d32d1b0b780b9ac773bc49a6c74c19508ff8e8 Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Wed, 12 Apr 2017 09:51:41 -0500 Subject: Fan control: Enable data generation Start running the python script that generates the fan zone data structures during the build. If the paths to the 2 yaml files aren't provided during configure, then the yaml in the example directory will be used instead. Change-Id: I9f67c1b94b5302c30ac87b0f80746854c42776b2 Signed-off-by: Matt Spinler --- configure.ac | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 12337c3..4a1cecd 100644 --- a/configure.ac +++ b/configure.ac @@ -57,6 +57,33 @@ AS_IF([test "x$enable_presence" != "xno"], [ ]) AS_IF([test "x$enable_control" != "xno"], [ + # Add optional yaml file arguments + AC_ARG_VAR(FAN_DEF_YAML_FILE, + [The fan definition file to use]) + AS_IF([test "x$FAN_DEF_YAML_FILE" == "x"], + [FAN_DEF_YAML_FILE="${srcdir}/control/example/fans.yaml"]) + AC_DEFINE_UNQUOTED([FAN_DEF_YAML_FILE], ["$FAN_DEF_YAML_FILE"], + [The fan definition file to use]) + + AC_ARG_VAR(FAN_ZONE_YAML_FILE, + [The fan zone definition file to use]) + AS_IF([test "x$FAN_ZONE_YAML_FILE" == "x"], + [FAN_ZONE_YAML_FILE="${srcdir}/control/example/zones.yaml"]) + AC_DEFINE_UNQUOTED([FAN_ZONE_YAML_FILE], ["$FAN_ZONE_YAML_FILE"], + [The fan zone definition file to use]) + + AC_ARG_VAR(FAN_ZONE_OUTPUT_DIR, + [The output directory for the generated fan zone data file]) + AS_IF([test "x$FAN_ZONE_OUTPUT_DIR" == "x"], + [FAN_ZONE_OUTPUT_DIR="${srcdir}/control/"]) + AC_DEFINE_UNQUOTED([FAN_ZONE_OUTPUT_DIR], ["$FAN_ZONE_OUTPUT_DIR"], + [The output directory for the generated fan zone data file]) + + AC_SUBST([GEN_FAN_ZONE_DEFS], + [$PYTHON ${srcdir}/control/gen-fan-zone-defs.py \ + -f $FAN_DEF_YAML_FILE \ + -z $FAN_ZONE_YAML_FILE \ + -o $FAN_ZONE_OUTPUT_DIR]) AC_CONFIG_FILES([control/Makefile]) ]) -- cgit v1.2.1