max31785-msl: Default not to install
Default not to install the max31785-msl script and provide autoconf and
meson options to install it. This is a tool used to check the revision
of the MAX31785 fan controller chip against a configuration defining
what the minimum ship level is required. Always installing this script
isn't necessary where a MAX31785 chip doesn't exist in a machine or
where the revision of it needs to be verified.
Tested:
Built using autoconf where the max31785-msl script is only installed
when `--enable-max31785-msl` is given
Build using meson where the max31785-msl script is only installed
when `-Denable-max31785-msl=true` is given
Change-Id: I563e30f093340ee035fd55c5fb0a10bef879ca12
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/configure.ac b/configure.ac
index 5e4bbdd..8c59696 100644
--- a/configure.ac
+++ b/configure.ac
@@ -212,6 +212,13 @@
])
])
+# By default, do not include MSL(minimum ship level) applications since these
+# would be specific to the machine using BMC hwmon. Each MSL application should
+# have its own enable argument to be built/installed.
+AC_ARG_ENABLE([max31785-msl],
+ AS_HELP_STRING([--enable-max31785-msl], [Include building and installing the MAX31785 chip's minimum ship level checking application.]))
+AM_CONDITIONAL([WANT_MAX31785_MSL], [test "x$enable_max31785_msl" == "xyes"])
+
AC_ARG_VAR(BUSNAME_PREFIX, [The DBus busname prefix.])
AC_ARG_VAR(SENSOR_ROOT, [The DBus sensors namespace root.])
AS_IF(
diff --git a/meson_options.txt b/meson_options.txt
index 24fe700..ccf3f90 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -19,3 +19,9 @@
'update-functional-on-fail',
description: 'Update functional property on read failures. Incompatible with negative-errno-on-fail.',
type: 'boolean')
+option(
+ 'enable-max31785-msl',
+ type: 'boolean',
+ value: false,
+ description: 'Include building and installing the MAX31785 chip\'s minimum ship level checking application.'
+)
diff --git a/msl/Makefile.am b/msl/Makefile.am
index fff55d6..f9fd604 100644
--- a/msl/Makefile.am
+++ b/msl/Makefile.am
@@ -1 +1,3 @@
+if WANT_MAX31785_MSL
dist_bin_SCRIPTS = max31785-msl
+endif
diff --git a/msl/meson.build b/msl/meson.build
index f92bb3e..f63f722 100644
--- a/msl/meson.build
+++ b/msl/meson.build
@@ -1,3 +1,4 @@
+if get_option('enable-max31785-msl')
configure_file(
copy: true,
input: 'max31785-msl',
@@ -5,3 +6,4 @@
install_dir: get_option('bindir'),
output: 'max31785-msl',
)
+endif