Add --strict-failsafe-pwm compile flag

This build flag is used to set the fans strictly at the failsafe
percent when in failsafe mode, even when the calculated PWM is higher
than failsafe PWM. Without this enabled, the PWM is calculated and set
to the calculated PWM  the failsafe PWM, whichever is higher.

Added a unit test that can test this new build flag code path if the
compile flag is defined.

Tested:

Verified on an internal machine that by adding the following to the
bbappend:

EXTRA_OECONF:append = " --enable-strict-failsafe-pwm=yes"

With flag:
ipmitool sensor list
fan_pwm         | 89.768

Without flag:
ipmitool sensor list
fan_pwm         | 99.960

We can see that the fan pwm was limited to the failsafe percentage when
in failsafe mode with the flag. Without the flag, it ran at 100%

Bug-Id: openbmc/phosphor-pid-control#17
Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: I72a1e5aab8d3e5b0e3716f0b3720d704a6f05008
diff --git a/configure.ac b/configure.ac
index d30af1f..622b091 100644
--- a/configure.ac
+++ b/configure.ac
@@ -204,6 +204,14 @@
     )
 )
 
+AC_ARG_ENABLE([strict-failsafe-pwm],
+    AS_HELP_STRING([--strict-failsafe-pwm],
+                   [Set the fans strictly at the failsafe PWM when in failsafe mode]))
+AM_CONDITIONAL(ENABLE_STRICT_FAILSAFE_PWM, [test "x$enable_strict_failsafe_pwm" = "xyes"])
+AS_IF([test "x$enable_strict_failsafe_pwm" = "xyes"], [
+    AX_APPEND_COMPILE_FLAGS([-DSTRICT_FAILSAFE_PWM], [CXXFLAGS])
+])
+
 AC_ARG_VAR(SYSTEMD_TARGET, "Target for starting this service")
 AS_IF([test "x$SYSTEMD_TARGET" == "x"], [SYSTEMD_TARGET="multi-user.target"])