build: Remove autotools
Change-Id: I01464a3631013ea801b9e415d4927a2e5eaf3a14
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/.gitignore b/.gitignore
index 69009e6..327ea97 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,71 +1,2 @@
-# Template from:
-# https://github.com/github/gitignore/blob/master/Autotools.gitignore
-
-# http://www.gnu.org/software/automake
-
-Makefile.in
-/ar-lib
-/mdate-sh
-/py-compile
-/test-driver
-/ylwrap
-
-# Code Coverage
-*.gcda
-*.gcno
-*.trs
-*-coverage*
-
-# http://www.gnu.org/software/autoconf
-
-/autom4te.cache
-/autoscan.log
-/autoscan-*.log
-/aclocal.m4
-/aminclude_static.am
-/compile
-/config.guess
-/config.h.in
-/config.sub
-/configure
-/configure.scan
-/depcomp
-/install-sh
-/missing
-/stamp-h1
-
-# https://www.gnu.org/software/libtool/
-
-/ltmain.sh
-
-# http://www.gnu.org/software/texinfo
-
-/texinfo.tex
-
-# Repo Specific Items
-*.o
-/config.h
-/config.h.in~
-/config.log
-/config.status
-Makefile
-.deps
-.dirstamp
-/lib*
-.libs/
-/*-libtool
-/ipmid
-.project
-/test/*_unittest
-/test/*.log
-/test/*.trs
-
-# ignore vim swap files
-.*.sw*
-# failures from patch
-*.orig
-*.rej
-# backup files from some editors
-*~
-.cscope/
-build/
+/build*/
+/subprojects/*/
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index 5e06d0c..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,80 +0,0 @@
-AM_DEFAULT_SOURCE_EXT = .cpp
-
-if HAVE_SYSTEMD
-systemdsystemunit_DATA = \
- gbmc-psu-hardreset.target \
- gbmc-host-poweroff.target
-endif
-
-# 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
-
-noinst_LTLIBRARIES = libsyscmds_common.la
-libsyscmds_common_la_SOURCES = \
- cable.cpp \
- cpld.cpp \
- eth.cpp \
- flash_size.cpp \
- psu.cpp \
- pcie_i2c.cpp \
- entity_name.cpp \
- machine_name.cpp \
- handler.cpp \
- util.cpp \
- ipmi.cpp \
- host_power_off.cpp
-libsyscmds_common_la_CXXFLAGS = \
- $(SDBUSPLUS_CFLAGS) \
- $(PHOSPHOR_LOGGING_CFLAGS) \
- $(CODE_COVERAGE_CXXFLAGS)
-libsyscmds_common_la_LDFLAGS = \
- $(SDBUSPLUS_LIBS) \
- $(PHOSPHOR_LOGGING_LIBS) \
- $(CODE_COVERAGE_LIBS) \
- -lstdc++fs
-
-libsyscmdsdir = ${libdir}/ipmid-providers
-libsyscmds_LTLIBRARIES = libsyscmds.la
-libsyscmds_la_SOURCES = main.cpp
-libsyscmds_la_LIBADD = libsyscmds_common.la
-libsyscmds_la_LDFLAGS = \
- $(LIBIPMID_LIBS) \
- -version-info 0:0:0 -shared
-
-libsyscmds_la_CXXFLAGS = \
- $(LIBIPMID_CFLAGS) \
- $(CODE_COVERAGE_CXXFLAGS) \
- -flto
-
-SUBDIRS = . test
diff --git a/bootstrap.sh b/bootstrap.sh
deleted file mode 100755
index 50b75b7..0000000
--- a/bootstrap.sh
+++ /dev/null
@@ -1,18 +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" | xargs -r rm -rf
- done
- exit 0
- ;;
-esac
-
-autoreconf -i
-echo 'Run "./configure ${CONFIGURE_FLAGS} && make"'
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 3ff4bf4..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,154 +0,0 @@
-# Initialization
-AC_PREREQ([2.69])
-AC_INIT([sys-ipmi], [0.1], [https://www.github.com/google-ipmi-sys/issues])
-AC_LANG([C++])
-AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror -Wno-portability 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 typedefs, structures, and compiler characteristics.
-AX_CXX_COMPILE_STDCXX_17([noext])
-AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
-
-# Checks for libraries.
-PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
-PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
-PKG_CHECK_MODULES(
- [LIBIPMID],
- [libipmid],
- [],
- [AC_MSG_ERROR([Could not find libipmid...openbmc/phosphor-host-ipmid package required])]
-)
-AC_CHECK_HEADER(
- nlohmann/json.hpp,
- [],
- [AC_MSG_ERROR([Could not find nlohmann/json.hpp])]
-)
-
-# Checks for library functions.
-LT_INIT # Required for systemd linking
-
-# 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])
-])
-
-# 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([])
-
-PKG_PROG_PKG_CONFIG
-AC_ARG_WITH([systemdsystemunitdir],
- [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
- [with_systemdsystemunitdir=auto])
-AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
- def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
-
- AS_IF([test "x$def_systemdsystemunitdir" = "x"],
- [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
- [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
- with_systemdsystemunitdir=no],
- [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
-AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
- [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
-AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
-
-# Create configured output
-AC_CONFIG_FILES([Makefile test/Makefile])
-AC_OUTPUT
diff --git a/test/Makefile.am b/test/Makefile.am
deleted file mode 100644
index a502e77..0000000
--- a/test/Makefile.am
+++ /dev/null
@@ -1,58 +0,0 @@
-@VALGRIND_CHECK_RULES@
-
-AM_CPPFLAGS = \
- -I$(top_srcdir)/ \
- $(GTEST_CFLAGS) \
- $(GMOCK_CFLAGS) \
- $(CODE_COVERAGE_CPPFLAGS)
-AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
-AM_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
-AM_LDFLAGS = \
- $(GTEST_LIBS) \
- $(GMOCK_LIBS) \
- -lgmock_main \
- $(OESDK_TESTCASE_FLAGS) \
- $(CODE_COVERAGE_LIBS)
-
-check_PROGRAMS =
-TESTS = $(check_PROGRAMS)
-
-check_PROGRAMS += handler_unittest
-handler_unittest_SOURCES = handler_unittest.cpp
-handler_unittest_LDADD = $(top_builddir)/libsyscmds_common.la
-
-check_PROGRAMS += eth_unittest
-eth_unittest_SOURCES = eth_unittest.cpp
-eth_unittest_LDADD = $(top_builddir)/libsyscmds_common.la
-
-check_PROGRAMS += cable_unittest
-cable_unittest_SOURCES = cable_unittest.cpp
-cable_unittest_LDADD = $(top_builddir)/libsyscmds_common.la
-
-check_PROGRAMS += cpld_unittest
-cpld_unittest_SOURCES = cpld_unittest.cpp
-cpld_unittest_LDADD = $(top_builddir)/libsyscmds_common.la
-
-check_PROGRAMS += psu_unittest
-psu_unittest_SOURCES = psu_unittest.cpp
-psu_unittest_LDADD = $(top_builddir)/libsyscmds_common.la
-
-check_PROGRAMS += entity_unittest
-entity_unittest_SOURCES = entity_unittest.cpp
-entity_unittest_LDADD = $(top_builddir)/libsyscmds_common.la
-
-check_PROGRAMS += machine_unittest
-machine_unittest_SOURCES = machine_unittest.cpp
-machine_unittest_LDADD = $(top_builddir)/libsyscmds_common.la
-
-check_PROGRAMS += pcie_unittest
-pcie_unittest_SOURCES = pcie_unittest.cpp
-pcie_unittest_LDADD = $(top_builddir)/libsyscmds_common.la
-
-check_PROGRAMS += flash_unittest
-flash_unittest_SOURCES = flash_unittest.cpp
-flash_unittest_LDADD = $(top_builddir)/libsyscmds_common.la
-
-check_PROGRAMS += poweroff_unittest
-poweroff_unittest_SOURCES = poweroff_unittest.cpp
-poweroff_unittest_LDADD = $(top_builddir)/libsyscmds_common.la