diff options
author | Matt Spinler <spinler@us.ibm.com> | 2017-04-12 09:51:41 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-05-04 16:01:30 +0000 |
commit | 77d32d1b0b780b9ac773bc49a6c74c19508ff8e8 (patch) | |
tree | c86bf7542d3eb1593678f77a89ffed3adaf129ab /configure.ac | |
parent | 78498c941d3f0445e2c62894123e05df057258f7 (diff) | |
download | phosphor-fan-presence-77d32d1b0b780b9ac773bc49a6c74c19508ff8e8.tar.gz phosphor-fan-presence-77d32d1b0b780b9ac773bc49a6c74c19508ff8e8.zip |
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 <spinler@us.ibm.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 27 |
1 files changed, 27 insertions, 0 deletions
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]) ]) |