Remove autotools files

Now that meson is enabled in the bitbake build, remove support for
building with autotools.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I49d66ca766d7d3475f454675124b3008f70bde4f
diff --git a/.gitignore b/.gitignore
index 51fda67..378eac2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,56 +1 @@
-# Test suite logs
-*.log
-
-# Code Coverage
-*.gcda
-*.gcno
-*.trs
-*-coverage*
-
-# CC / CXX Compiler
-*.ii
-*.i
-*.o
-*.s
-
-# Libtool
-*.la
-*.lo
-
-# Autotools
-.deps
-.dirstamp
-.libs
-/aclocal.m4
-/aminclude_static.am
-/autom4te.cache
-/build-aux
-/confdefs.h
-/config.guess
-/config.h
-/config.h.in
-/config.h.in~
-/config.log
-/config.status
-/config.sub
-/configure
-/m4
-/libtool
-Makefile
-Makefile.in
-/stamp-h1
-
-*.sw*
-phosphor-hwmon-readd
-ar-lib
-arm-openbmc-linux-gnueabi-libtool
-compile
-depcomp
-install-sh
-ltmain.sh
-missing
-test-driver
-*_unittest
-*_unittest.trs
-libtool
-*~
+build
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index 706a6cc..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,74 +0,0 @@
-# Ignore system headers
-CODE_COVERAGE_IGNORE_PATTERN = '/include/*' '/usr/include/*' '$(includedir)/*'
-export CODE_COVERAGE_IGNORE_PATTERN
-
-CODE_COVERAGE_LCOV_SHOPTS = $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
-# Use our configuration file for lcov
-CODE_COVERAGE_LCOV_SHOPTS += --config-file $(abs_srcdir)/.lcovrc
-export CODE_COVERAGE_LCOV_SHOPTS
-
-CODE_COVERAGE_LCOV_OPTIONS = $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
-# Use our configuration file for lcov
-CODE_COVERAGE_LCOV_OPTIONS += --config-file $(abs_srcdir)/.lcovrc
-export CODE_COVERAGE_LCOV_OPTIONS
-
-CODE_COVERAGE_LCOV_RMOPTS = $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
-# Use our configuration file for lcov
-CODE_COVERAGE_LCOV_RMOPTS += --config-file $(abs_srcdir)/.lcovrc
-export CODE_COVERAGE_LCOV_RMOPTS
-
-CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
-# Use our configuration file for genhtml
-CODE_COVERAGE_GENHTML_OPTIONS += --config-file $(abs_srcdir)/.lcovrc
-# Don't generate the absolute path for each file in the HTML output
-CODE_COVERAGE_GENHTML_OPTIONS += --prefix $(abs_srcdir) --prefix $(abs_builddir)
-export CODE_COVERAGE_GENHTML_OPTIONS
-
-if AUTOCONF_CODE_COVERAGE_2019_01_06
-include $(top_srcdir)/aminclude_static.am
-clean-local: code-coverage-clean
-distclean-local: code-coverage-dist-clean
-else
-@CODE_COVERAGE_RULES@
-endif
-
-bin_PROGRAMS = phosphor-hwmon-readd
-
-phosphor_hwmon_readd_SOURCES = readd.cpp
-phosphor_hwmon_readd_LDADD = $(SDBUSPLUS_LIBS) $(CODE_COVERAGE_LIBS) libhwmon.la
-phosphor_hwmon_readd_CXXFLAGS = $(SDBUSPLUS_CFLAGS) $(CODE_COVERAGE_CXXFLAGS)
-
-noinst_LTLIBRARIES = libhwmon.la
-libhwmon_la_LDFLAGS = -static
-libhwmon_la_LIBADD = \
-	-lstdc++fs \
-	$(SDBUSPLUS_LIBS) \
-	$(SDEVENTPLUS_LIBS) \
-	$(PHOSPHOR_DBUS_INTERFACES_LIBS) \
-	$(PHOSPHOR_LOGGING_LIBS) \
-	$(GPIOPLUS_LIBS) \
-	$(STDPLUS_LIBS) \
-	$(CODE_COVERAGE_LIBS) \
-	$(FMT_LIBS)
-libhwmon_la_CXXFLAGS = \
-	$(SDBUSPLUS_CFLAGS) \
-	$(SDEVENTPLUS_CFLAGS) \
-	$(PHOSPHOR_DBUS_INTERFACES_CFLAGS) \
-	$(PHOSPHOR_LOGGING_CFLAGS) \
-	$(STDPLUS_CFLAGS) \
-	$(CODE_COVERAGE_CXXFLAGS)
-
-libhwmon_la_SOURCES = \
-	sensorset.cpp \
-	mainloop.cpp \
-	sysfs.cpp \
-	env.cpp \
-	fan_speed.cpp \
-	fan_pwm.cpp \
-	hwmon.cpp \
-	hwmonio.cpp \
-	sensor.cpp \
-	gpio_handle.cpp \
-	average.cpp
-
-SUBDIRS = . msl test tools
diff --git a/README.md b/README.md
index 8136daf..8a1948f 100644
--- a/README.md
+++ b/README.md
@@ -6,11 +6,10 @@
 ```
 To build this package, do the following steps:
 
-    1. ./bootstrap.sh
-    2. ./configure ${CONFIGURE_FLAGS}
-    3. make
+    1. meson build
+    2. ninja -C build
 
-To clean the repository run `./bootstrap.sh clean`.
+To clean the repository run `rm -rf build`.
 ```
 
 ## D-Bus bus names
diff --git a/bootstrap.sh b/bootstrap.sh
deleted file mode 100755
index 9fdf674..0000000
--- a/bootstrap.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-AUTOCONF_FILES="Makefile.in aclocal.m4 ar-lib autom4te.cache compile \
-        config.guess config.h.in config.sub configure depcomp install-sh \
-        ltmain.sh missing *libtool test-driver"
-
-case $1 in
-    clean)
-        test -f Makefile && make maintainer-clean
-        for file in ${AUTOCONF_FILES}; do
-            find . -name "$file" -print0 | xargs -0 -r rm -rf
-        done
-        exit 0
-        ;;
-esac
-
-autoreconf -i
-# shellcheck disable=SC2016
-echo 'Run "./configure ${CONFIGURE_FLAGS} && make"'
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 8c59696..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,245 +0,0 @@
-# Initialization
-AC_PREREQ([2.69])
-AC_INIT([phosphor-hwmon], [1.0], [https://github.com/openbmc/phosphor-hwmon/issues])
-AC_LANG([C++])
-AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([subdir-objects -Wall -Wno-portability -Werror foreign dist-xz])
-AM_SILENT_RULES([yes])
-
-# Make sure the default CFLAGS of `-O2 -g` don't override CODE_COVERAGE_CFLAGS
-# It is important that this comes before AC_PROG_C{C,XX}, as we are attempting
-# to stop them from populating default CFLAGS and CXXFLAGS.
-AS_IF([test "x$enable_tests" = "xno"], [enable_code_coverage=no])
-AS_IF([test "x$enable_code_coverage" != "xno"], [
-    AS_IF([test "x${CXXFLAGS+set}" != "xset"], [
-        AC_SUBST(CXXFLAGS, [""])
-    ])
-    AS_IF([test "x${CFLAGS+set}" != "xset"], [
-        AC_SUBST(CFLAGS, [""])
-    ])
-])
-
-# Checks for programs.
-AC_PROG_CXX
-AM_PROG_AR
-AC_PROG_INSTALL
-AC_PROG_MAKE_SET
-
-# Checks for libraries.
-PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
-PKG_CHECK_MODULES([SDEVENTPLUS], [sdeventplus])
-PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces])
-PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
-PKG_CHECK_MODULES([GPIOPLUS], [gpioplus])
-PKG_CHECK_MODULES([STDPLUS], [stdplus])
-PKG_CHECK_MODULES([FMT], [fmt])
-# We need the header only CLI library
-AC_CHECK_HEADERS(
-    [CLI/CLI.hpp],
-    [],
-    [AC_MSG_ERROR([Could not find CLI11 CLI/CLI.hpp])]
-)
-AX_PTHREAD([], [AC_MSG_ERROR(["pthread required and not found"])])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AX_CXX_COMPILE_STDCXX_17([noext])
-AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS])
-
-# Checks for library functions.
-LT_INIT
-
-# Make it possible for users to choose if they want test support
-# explicitly or not at all
-AC_ARG_ENABLE([tests], AC_HELP_STRING([--disable-tests],
-                                      [Build test cases]))
-
-# Check/set gtest specific functions.
-AS_IF([test "x$enable_tests" != "xno"], [
-    PKG_CHECK_MODULES([GTEST], [gtest], [], [true])
-    PKG_CHECK_MODULES([GMOCK], [gmock], [], [true])
-    AX_PTHREAD
-
-    AX_SAVE_FLAGS_WITH_PREFIX(OLD, [CPPFLAGS])
-    AX_APPEND_COMPILE_FLAGS([$GTEST_CFLAGS], [CPPFLAGS])
-    AC_LANG_PUSH([C++])
-    AC_CHECK_HEADERS([gtest/gtest.h], [
-        AS_IF([test "x$GTEST_CFLAGS" = "x"], [
-            AS_IF([test "x$PTHREAD_CFLAGS" = "x"], [
-                AX_APPEND_COMPILE_FLAGS(["-DGTEST_HAS_PTHREAD=0"], [GTEST_CFLAGS])
-            ], [
-                AX_APPEND_COMPILE_FLAGS(["-DGTEST_HAS_PTHREAD=1"], [GTEST_CFLAGS])
-                AX_APPEND_COMPILE_FLAGS([$PTHREAD_CFLAGS], [GTEST_CFLAGS])
-            ])
-        ])
-    ], [
-        AS_IF([test "x$enable_tests" = "xyes"], [
-            AC_MSG_ERROR([Testing enabled but could not find gtest/gtest.h])
-        ])
-    ])
-    AC_LANG_POP([C++])
-    AX_RESTORE_FLAGS_WITH_PREFIX(OLD, [CPPFLAGS])
-
-    AX_SAVE_FLAGS_WITH_PREFIX(OLD, [CPPFLAGS])
-    AX_APPEND_COMPILE_FLAGS([$GMOCK_CFLAGS], [CPPFLAGS])
-    AC_LANG_PUSH([C++])
-    AC_CHECK_HEADERS([gmock/gmock.h], [], [
-        AS_IF([test "x$enable_tests" = "xyes"], [
-            AC_MSG_ERROR([Testing enabled but could not find gmock/gmock.h])
-        ])
-    ])
-    AC_LANG_POP([C++])
-    AX_RESTORE_FLAGS_WITH_PREFIX(OLD, [CPPFLAGS])
-
-    AX_SAVE_FLAGS_WITH_PREFIX(OLD, [LDFLAGS])
-    AX_APPEND_COMPILE_FLAGS([$GTEST_LIBS], [LDFLAGS])
-    AC_CHECK_LIB([gtest], [main], [
-        AS_IF([test "x$GTEST_LIBS" = "x"], [
-            AX_APPEND_COMPILE_FLAGS([-lgtest], [GTEST_LIBS])
-        ])
-    ], [
-        AS_IF([test "x$enable_tests" = "xyes"], [
-            AC_MSG_ERROR([Testing enabled but couldn't find gtest libs])
-        ])
-    ])
-    AX_RESTORE_FLAGS_WITH_PREFIX(OLD, [LDFLAGS])
-
-    AX_SAVE_FLAGS_WITH_PREFIX(OLD, [LDFLAGS])
-    AX_APPEND_COMPILE_FLAGS([$GMOCK_LIBS], [LDFLAGS])
-    AC_CHECK_LIB([gmock], [main], [
-        AS_IF([test "x$GMOCK_LIBS" = "x"], [
-            AX_APPEND_COMPILE_FLAGS([-lgmock], [GMOCK_LIBS])
-        ])
-    ], [
-        AS_IF([test "x$enable_tests" = "xyes"], [
-            AC_MSG_ERROR([Testing enabled but couldn't find gmock libs])
-        ])
-    ])
-    AX_RESTORE_FLAGS_WITH_PREFIX(OLD, [LDFLAGS])
-])
-
-# Add --enable-oe-sdk flag to configure script
-AC_ARG_ENABLE([oe-sdk],
-    AS_HELP_STRING(
-        [--enable-oe-sdk],
-        [Link testcases absolutely against OE SDK so they can be ran within it.]
-    )
-)
-
-# Check for valgrind
-AS_IF([test "x$enable_tests" = "xno"], [enable_valgrind=no])
-m4_foreach([vgtool], [valgrind_tool_list],
-    [AX_VALGRIND_DFLT(vgtool, [off])])
-AX_VALGRIND_DFLT([memcheck], [on])
-AX_VALGRIND_CHECK
-AM_EXTRA_RECURSIVE_TARGETS([check-valgrind])
-m4_foreach([vgtool], [valgrind_tool_list],
-    [AM_EXTRA_RECURSIVE_TARGETS([check-valgrind-]vgtool)])
-
-# Code coverage
-AX_CODE_COVERAGE
-m4_ifdef([_AX_CODE_COVERAGE_RULES],
-    [AM_CONDITIONAL(AUTOCONF_CODE_COVERAGE_2019_01_06, [true])],
-    [AM_CONDITIONAL(AUTOCONF_CODE_COVERAGE_2019_01_06, [false])])
-AX_ADD_AM_MACRO_STATIC([])
-
-# Check for OECORE_TARGET_SYSROOT in the environment.
-AC_ARG_VAR(OECORE_TARGET_SYSROOT,
-    [Path to the OE SDK SYSROOT]
-)
-
-# Configure OESDK_TESTCASE_FLAGS environment variable, which will be later
-# used in test/Makefile.am
-AS_IF([test "x$enable_oe_sdk" == "xyes"],
-    AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
-          AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
-    )
-    AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
-    [
-        testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
-        testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
-        testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
-    ]
-    AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
-)
-
-# When a sensor read fails, set the Value on dbus with -errno.
-# It will also skip the "Remove RCs" check.
-# Incompatible with update-functional-on-fail.
-AC_ARG_ENABLE([negative-errno-on-fail],
-    AS_HELP_STRING(
-        [--enable-negative-errno-on-fail],
-        [Set sensor value to -errno on read failures. Incompatible with update-functional-on-fail]
-    )
-)
-
-AC_ARG_VAR(NEGATIVE_ERRNO_ON_FAIL, [Set sensor value to -errno on read failures])
-AS_IF(
-    [test "x$enable_negative_errno_on_fail" == "xyes"],
-    [NEGATIVE_ERRNO_ON_FAIL="yes"]
-    AC_DEFINE_UNQUOTED(
-        [NEGATIVE_ERRNO_ON_FAIL],
-        ["$NEGATIVE_ERRNO_ON_FAIL"],
-        [Set sensor value to -errno on read failures]
-    )
-)
-
-# When a sensor read fails, update the OperationalState interface's Functional property.
-# This will mark the sensor as not functional and skip reading from that sensor.
-# It will skip the "Remove RCs" check during value interface creation in MainLoop::getObject.
-# However, it will perform the "Remove RCs" checks during MainLoop::read.
-# Incompatible with negative-errno-on-fail.
-AC_ARG_ENABLE([update-functional-on-fail],
-    AS_HELP_STRING(
-        [--enable-update-functional-on-fail],
-        [Update functional property on read failures. Incompatible with negative-errno-on-fail]
-    )
-)
-
-AC_ARG_VAR(UPDATE_FUNCTIONAL_ON_FAIL, [Update functional property on read failures])
-AS_IF(
-    [test "x$enable_update_functional_on_fail" == "xyes"],
-    [UPDATE_FUNCTIONAL_ON_FAIL="yes"]
-    AC_DEFINE_UNQUOTED(
-        [UPDATE_FUNCTIONAL_ON_FAIL],
-        ["$UPDATE_FUNCTIONAL_ON_FAIL"],
-        [Update functional property on sensor read failures]
-    )
-)
-
-AS_IF([test "x$enable_negative_errno_on_fail" == "xyes"], [
-    AS_IF([test "x$enable_update_functional_on_fail" == "xyes"], [
-        AC_MSG_ERROR([Invalid configuration enabling both negative-errno-on-fail and update-functional-on-fail.])
-    ])
-])
-
-# 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(
-    [test "x$BUSNAME_PREFIX" == "x"],
-    [BUSNAME_PREFIX="xyz.openbmc_project.Hwmon"]
-)
-AS_IF(
-    [test "x$SENSOR_ROOT" == "x"],
-    [SENSOR_ROOT="/xyz/openbmc_project/sensors"]
-)
-AC_DEFINE_UNQUOTED(
-    [BUSNAME_PREFIX],
-    ["$BUSNAME_PREFIX"],
-    [The DBus busname prefix.]
-)
-AC_DEFINE_UNQUOTED(
-    [SENSOR_ROOT],
-    ["$SENSOR_ROOT"],
-    [The DBus sensors namespace root.]
-)
-
-# Create configured output
-AC_CONFIG_FILES([Makefile test/Makefile tools/Makefile msl/Makefile])
-AC_OUTPUT
diff --git a/msl/Makefile.am b/msl/Makefile.am
deleted file mode 100644
index f9fd604..0000000
--- a/msl/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-if WANT_MAX31785_MSL
-dist_bin_SCRIPTS = max31785-msl
-endif
diff --git a/test/Makefile.am b/test/Makefile.am
deleted file mode 100644
index 3674dca..0000000
--- a/test/Makefile.am
+++ /dev/null
@@ -1,53 +0,0 @@
-@VALGRIND_CHECK_RULES@
-
-AM_CPPFLAGS = \
-	-I$(top_srcdir)/ \
-	$(GTEST_CFLAGS) \
-	$(GMOCK_CFLAGS) \
-	$(SDBUSPLUS_CFLAGS) \
-	$(PHOSPHOR_DBUS_INTERFACES_CFLAGS)
-AM_CFLAGS = \
-	$(CODE_COVERAGE_CFLAGS)
-AM_CXXFLAGS = \
-	$(CODE_COVERAGE_CXXFLAGS)
-AM_LDFLAGS = \
-	$(GTEST_LIBS) \
-	$(GMOCK_LIBS) \
-	-lgmock_main \
-	$(OESDK_TESTCASE_FLAGS) \
-	$(SDBUSPLUS_LIBS) \
-	$(PHOSPHOR_DBUS_INTERFACES_LIBS) \
-	$(CODE_COVERAGE_LIBS) \
-	$(FMT_LIBS)
-
-# Run all 'check' test programs
-check_PROGRAMS = hwmon_unittest fanpwm_unittest sensor_unittest hwmonio_default_unittest env_unittest average_unittest
-TESTS = $(check_PROGRAMS)
-
-env_unittest_SOURCES = env_unittest.cpp
-
-average_unittest_SOURCES = average_unittest.cpp
-average_unittest_LDADD = $(top_builddir)/average.o
-
-hwmon_unittest_SOURCES = hwmon_unittest.cpp
-hwmon_unittest_LDADD = $(top_builddir)/hwmon.o
-
-fanpwm_unittest_SOURCES = fanpwm_unittest.cpp
-fanpwm_unittest_LDADD = $(PHOSPHOR_LOGGING_LIBS) $(top_builddir)/fan_pwm.o
-
-sensor_unittest_SOURCES = sensor_unittest.cpp
-sensor_unittest_CXXFLAGS = \
-	$(PHOSPHOR_LOGGING_CFLAGS) \
-	$(GPIOPLUS_CFLAGS)
-	$(STDPLUS_CFLAGS)
-sensor_unittest_LDADD = \
-	-lstdc++fs \
-	$(PHOSPHOR_LOGGING_LIBS) \
-	$(GPIOPLUS_LIBS) \
-	$(STDPLUS_LIBS) \
-	$(top_builddir)/sensor.o \
-	$(top_builddir)/hwmon.o \
-	gpio.o
-
-hwmonio_default_unittest_SOURCES = hwmonio_default_unittest.cpp
-hwmonio_default_unittest_LDADD = $(top_builddir)/hwmonio.o
diff --git a/tools/Makefile.am b/tools/Makefile.am
deleted file mode 100644
index e737eed..0000000
--- a/tools/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-noinst_PROGRAMS = find_callout_path find_hwmon
-
-find_callout_path_SOURCES = find_callout_path.cpp
-find_callout_path_LDFLAGS = -static
-find_callout_path_LDADD = \
-	-lstdc++fs \
-	$(SDBUSPLUS_LIBS) \
-	$(PHOSPHOR_LOGGING_LIBS) \
-	${top_builddir}/sysfs.o
-find_callout_path_CXXFLAGS =
-
-find_hwmon_SOURCES = find_hwmon.cpp
-find_hwmon_LDFLAGS = -static
-find_hwmon_LDADD = \
-	-lstdc++fs \
-	$(SDBUSPLUS_LIBS) \
-	$(PHOSPHOR_LOGGING_LIBS) \
-	${top_builddir}/sysfs.o
-find_hwmon_CXXFLAGS =