meson: remove automake legacy files
This concludes the move to meson
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I4384a6c74dfbfa220e6b3d87f5f5a6c71e68341a
diff --git a/.gitignore b/.gitignore
index 743960e..378eac2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,52 +1 @@
-# 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
-
-# http://www.gnu.org/software/autoconf
-
-/autom4te.cache
-/autoscan.log
-/autoscan-*.log
-/aclocal.m4
-/compile
-/config.guess
-/config.h.in
-/config.sub
-/configure
-/configure.scan
-/depcomp
-/install-sh
-/missing
-/stamp-h1
-
-# https://www.gnu.org/software/libtool/
-/libtool
-/ltmain.sh
-
-# http://www.gnu.org/software/texinfo
-
-/texinfo.tex
-
-# Repo Specific Items
-/*.o
-/config.h
-/config.h.in~
-/config.log
-/config.status
-/phosphor-host-state-manager
-/phosphor-chassis-state-manager
-/phosphor-bmc-state-manager
-/phosphor-discover-system-state
-/phosphor-host-check
-Makefile
-.deps
-*-libtool
-/*.gc*
+build
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index fc8f1bb..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,114 +0,0 @@
-AM_DEFAULT_SOURCE_EXT = .cpp
-
-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
-
-systemdsystemunit_DATA = \
- ./service_files/phosphor-systemd-target-monitor.service
-
-AM_LIBS = $(CODE_COVERAGE_LIBS)
-AM_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) -UNDEBUG $(GTEST_CPPFLAGS)
-AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
-AM_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS) \
- -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_ERROR_CODE_HEADER_ONLY \
- -DBOOST_ALL_NO_LIB $(SDEVENTPLUS_CFLAGS) \
- $(PHOSPHOR_DBUS_INTERFACES_CFLAGS) $(PHOSPHOR_LOGGING_CFLAGS)
-AM_LDFLAGS = $(GMOCK_LIBS) -lgmock_main \
- $(GTEST_LIBS) $(OESDK_TESTCASE_FLAGS) $(PTHREAD_LIBS) \
- $(SDBUSPLUS_LIBS) $(SDEVENTPLUS_LIBS) \
- $(PHOSPHOR_DBUS_INTERFACES_LIBS) $(PHOSPHOR_LOGGING_LIBS)
-
-bin_PROGRAMS = \
- phosphor-host-state-manager \
- phosphor-chassis-state-manager \
- phosphor-bmc-state-manager \
- phosphor-discover-system-state \
- phosphor-host-check \
- phosphor-systemd-target-monitor
-
-dist_bin_SCRIPTS = \
- obmcutil
-
-phosphor_host_state_manager_SOURCES = \
- host_state_manager.cpp \
- host_state_manager_main.cpp \
- settings.cpp
-
-phosphor_chassis_state_manager_SOURCES = \
- chassis_state_manager.cpp \
- chassis_state_manager_main.cpp
-
-phosphor_bmc_state_manager_SOURCES = \
- bmc_state_manager.cpp \
- bmc_state_manager_main.cpp
-
-phosphor_discover_system_state_SOURCES = \
- discover_system_state.cpp \
- settings.cpp
-
-phosphor_host_check_SOURCES = \
- host_check_main.cpp
-
-phosphor_systemd_target_monitor_SOURCES = \
- systemd_target_monitor.cpp \
- systemd_target_parser.cpp \
- systemd_target_signal.cpp
-
-generic_cxxflags = \
- $(SYSTEMD_CFLAGS) \
- $(PHOSPHOR_DBUS_INTERFACES_CFLAGS) \
- $(SDBUSPLUS_CFLAGS) \
- $(PHOSPHOR_LOGGING_CFLAGS)
-
-generic_ldflags = \
- $(SYSTEMD_LIBS) \
- $(PHOSPHOR_DBUS_INTERFACES_LIBS) \
- $(SDBUSPLUS_LIBS) \
- $(PHOSPHOR_LOGGING_LIBS)
-
-phosphor_host_state_manager_CXXFLAGS = $(generic_cxxflags)
-phosphor_host_state_manager_LDFLAGS = $(generic_ldflags) -lstdc++fs
-
-phosphor_chassis_state_manager_CXXFLAGS = \
- $(generic_cxxflags) \
- $(SDEVENTPLUS_CFLAGS)
-phosphor_chassis_state_manager_LDFLAGS = \
- $(generic_ldflags) \
- $(SDEVENTPLUS_LIBS) \
- -lstdc++fs
-
-phosphor_bmc_state_manager_CXXFLAGS = $(generic_cxxflags)
-phosphor_bmc_state_manager_LDFLAGS = $(generic_ldflags)
-
-phosphor_discover_system_state_CXXFLAGS = $(generic_cxxflags)
-phosphor_discover_system_state_LDFLAGS = $(generic_ldflags)
-
-phosphor_host_check_CXXFLAGS = $(generic_cxxflags)
-phosphor_host_check_LDFLAGS = $(generic_ldflags)
-
-phosphor_systemd_target_monitor_CXXFLAGS = \
- $(generic_cxxflags) \
- $(SDEVENTPLUS_CFLAGS)
-phosphor_systemd_target_monitor_LDFLAGS = \
- $(generic_ldflags) \
- $(SDEVENTPLUS_LIBS) \
- -lstdc++fs
-
-install-data-local:
- mkdir -p ${DESTDIR}/$(sysconfdir)/phosphor-systemd-target-monitor
- cp $(srcdir)/phosphor-target-monitor-default.json ${DESTDIR}/$(sysconfdir)/phosphor-systemd-target-monitor
-
-check_PROGRAMS =
-XFAIL_TESTS =
-
-# Ignore system headers
-CODE_COVERAGE_IGNORE_PATTERN = '/include/*' '/usr/include/*' '$(includedir)/*'
-
-include test/Makefile.am.include
-
-TESTS = $(check_PROGRAMS)
diff --git a/README.md b/README.md
index d230b8d..e9ff81d 100644
--- a/README.md
+++ b/README.md
@@ -119,8 +119,12 @@
## Building the Code
```
-./bootstrap.sh
-./configure ${CONFIGURE_FLAGS} && make
+To build this package, do the following steps:
+
+ 1. meson build
+ 2. ninja -C build
+
+To clean the repository again run `rm -rf build`.
```
[1]: https://github.com/openbmc/docs/blob/master/architecture/openbmc-systemd.md
diff --git a/bootstrap.sh b/bootstrap.sh
deleted file mode 100755
index 9941c73..0000000
--- a/bootstrap.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh -xe
-
-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"'
\ No newline at end of file
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 540f321..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,194 +0,0 @@
-AC_PREREQ([2.69])
-AC_INIT([phosphor-state-manager], [1.0], [https://github.com/openbmc/phosphor-state-manager/issues])
-AC_LANG([C++])
-AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([subdir-objects -Wall -Wno-portability -Werror foreign])
-AM_SILENT_RULES([yes])
-
-# Checks for programs
-AC_PROG_CXX
-AC_PROG_INSTALL #Checks/sets the install variable to be used
-AC_PROG_MAKE_SET
-
-# Check for libraries
-PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
-PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces])
-PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
-PKG_CHECK_MODULES([SDEVENTPLUS], [sdeventplus])
-PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
-
-# We need the header only CLI library
-AC_CHECK_HEADERS(
- [CLI/CLI.hpp],
- [],
- [AC_MSG_ERROR([Could not find CLI11 CLI/CLI.hpp])]
-)
-AC_CHECK_HEADER(nlohmann/json.hpp, ,
- [AC_MSG_ERROR([Could not find nlohmann/json.hpp... nlohmann/json package required])])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AX_CXX_COMPILE_STDCXX_17([noext])
-AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
-
-# Checks for library functions
-LT_INIT # Removes WARNING: unrecognized options: --with-libtool-sysroot
-
-AC_ARG_VAR(HOST_BUSNAME, [The Host Dbus busname to own])
-AS_IF([test "x$HOST_BUSNAME" == "x"], [HOST_BUSNAME="xyz.openbmc_project.State.Host"])
-AC_DEFINE_UNQUOTED([HOST_BUSNAME], ["$HOST_BUSNAME"], [The Host DBus busname to own])
-
-AC_ARG_VAR(HOST_OBJPATH, [The host state manager Dbus root])
-AS_IF([test "x$HOST_OBJPATH" == "x"], [HOST_OBJPATH="/xyz/openbmc_project/state/host"])
-AC_DEFINE_UNQUOTED([HOST_OBJPATH], ["$HOST_OBJPATH"], [The host state manager Dbus root])
-
-AC_ARG_VAR(CHASSIS_BUSNAME, [The Chassis Dbus busname to own])
-AS_IF([test "x$CHASSIS_BUSNAME" == "x"], [CHASSIS_BUSNAME="xyz.openbmc_project.State.Chassis"])
-AC_DEFINE_UNQUOTED([CHASSIS_BUSNAME], ["$CHASSIS_BUSNAME"], [The Chassis DBus busname to own])
-
-AC_ARG_VAR(CHASSIS_OBJPATH, [The chassis state manager Dbus root])
-AS_IF([test "x$CHASSIS_OBJPATH" == "x"], [CHASSIS_OBJPATH="/xyz/openbmc_project/state/chassis"])
-AC_DEFINE_UNQUOTED([CHASSIS_OBJPATH], ["$CHASSIS_OBJPATH"], [The chassis state manager Dbus root])
-
-AC_ARG_VAR(BMC_BUSNAME, [The BMC Dbus busname to own])
-AS_IF([test "x$BMC_BUSNAME" == "x"], [BMC_BUSNAME="xyz.openbmc_project.State.BMC"])
-AC_DEFINE_UNQUOTED([BMC_BUSNAME], ["$BMC_BUSNAME"], [The BMC DBus busname to own])
-
-AC_ARG_VAR(BMC_OBJPATH, [The BMC state manager Dbus root])
-AS_IF([test "x$BMC_OBJPATH" == "x"], [BMC_OBJPATH="/xyz/openbmc_project/state/bmc"])
-AC_DEFINE_UNQUOTED([BMC_OBJPATH], ["$BMC_OBJPATH"], [The BMC state manager Dbus root])
-
-AC_ARG_VAR(HOST_RUNNING_FILE, [File to create if host is running])
-AS_IF([test "x$HOST_RUNNING_FILE" == "x"], [HOST_RUNNING_FILE="/run/openbmc/host@%d-on"])
-AC_DEFINE_UNQUOTED([HOST_RUNNING_FILE], ["$HOST_RUNNING_FILE"], [File to create if host is running])
-
-AC_ARG_VAR(HOST_STATE_PERSIST_PATH, [Path of file for storing requested host state.])
-AS_IF([test "x$HOST_STATE_PERSIST_PATH" == "x"], \
- [HOST_STATE_PERSIST_PATH="/var/lib/phosphor-state-manager/requestedHostTransition"])
-AC_DEFINE_UNQUOTED([HOST_STATE_PERSIST_PATH], ["$HOST_STATE_PERSIST_PATH"], \
- [Path of file for storing requested host state.])
-
-AC_ARG_VAR(POH_COUNTER_PERSIST_PATH, [Path of file for storing POH counter.])
-AS_IF([test "x$POH_COUNTER_PERSIST_PATH" == "x"], \
- [POH_COUNTER_PERSIST_PATH="/var/lib/phosphor-state-manager/POHCounter"])
-AC_DEFINE_UNQUOTED([POH_COUNTER_PERSIST_PATH], ["$POH_COUNTER_PERSIST_PATH"], \
- [Path of file for storing POH counter.])
-
-AC_ARG_VAR(CHASSIS_STATE_CHANGE_PERSIST_PATH, [Path of file for storing the state change time.])
-AS_IF([test "x$CHASSIS_STATE_CHANGE_PERSIST_PATH" == "x"], \
- [CHASSIS_STATE_CHANGE_PERSIST_PATH="/var/lib/phosphor-state-manager/chassisStateChangeTime"])
-AC_DEFINE_UNQUOTED([CHASSIS_STATE_CHANGE_PERSIST_PATH], ["$CHASSIS_STATE_CHANGE_PERSIST_PATH"], \
- [Path of file for storing the state change time.])
-
-AC_ARG_VAR(BOOT_COUNT_MAX_ALLOWED, [The maximum allowed reboot count])
-AS_IF([test "x$BOOT_COUNT_MAX_ALLOWED" == "x"], [BOOT_COUNT_MAX_ALLOWED=3])
-AC_DEFINE_UNQUOTED([BOOT_COUNT_MAX_ALLOWED], [$BOOT_COUNT_MAX_ALLOWED], [The maximum allowed reboot count])
-
-# Check for header files.
-AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
-AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...openbmc/sdbusplus package required])])
-AC_CHECK_HEADER(phosphor-logging/log.hpp, ,[AC_MSG_ERROR([Could not find phosphor-logging/log.hpp...openbmc/phosphor-logging package required])])
-
-AC_ARG_VAR(CLASS_VERSION, [Class version to register with Cereal])
-AS_IF([test "x$CLASS_VERSION" == "x"], [CLASS_VERSION=1])
-AC_DEFINE_UNQUOTED([CLASS_VERSION], [$CLASS_VERSION], [Class version to register with Cereal])
-
-# 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_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])
- ])
- ])
- AX_RESTORE_FLAGS_WITH_PREFIX(OLD, [CPPFLAGS])
-
- AX_SAVE_FLAGS_WITH_PREFIX(OLD, [CPPFLAGS])
- AX_APPEND_COMPILE_FLAGS([$GMOCK_CFLAGS], [CPPFLAGS])
- 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])
- ])
- ])
- 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])])
-
-AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([service_files/phosphor-systemd-target-monitor.service])
-AC_OUTPUT
diff --git a/phosphor-target-monitor-default.json b/phosphor-target-monitor-default.json
deleted file mode 100644
index 22fe2c9..0000000
--- a/phosphor-target-monitor-default.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "targets" : {
- "multi-user.target" : {
- "errorsToMonitor": ["default"],
- "errorToLog": "xyz.openbmc_project.State.BMC.Error.MultiUserTargetFailure"},
- "obmc-chassis-poweron@0.target" : {
- "errorsToMonitor": ["default"],
- "errorToLog": "xyz.openbmc_project.State.Chassis.Error.PowerOnFailure"},
- "obmc-chassis-poweroff@0.target" : {
- "errorsToMonitor": ["default"],
- "errorToLog": "xyz.openbmc_project.State.Chassis.Error.PowerOffFailure"},
- "obmc-host-start@0.target" : {
- "errorsToMonitor": ["default"],
- "errorToLog": "xyz.openbmc_project.State.Host.Error.HostStartFailure"},
- "obmc-host-startmin@0.target" : {
- "errorsToMonitor": ["default"],
- "errorToLog": "xyz.openbmc_project.State.Host.Error.HostStartMinFailure"},
- "obmc-host-shutdown@0.target" : {
- "errorsToMonitor": ["default"],
- "errorToLog": "xyz.openbmc_project.State.Host.Error.HostShutdownFailure"},
- "obmc-host-stop@0.target" : {
- "errorsToMonitor": ["default"],
- "errorToLog": "xyz.openbmc_project.State.Host.Error.HostStopFailure"},
- "obmc-host-reboot@0.target" : {
- "errorsToMonitor": ["default"],
- "errorToLog": "xyz.openbmc_project.State.Host.Error.HostRebootFailure"}
- }
-}
-
diff --git a/service_files/phosphor-systemd-target-monitor.service.in b/service_files/phosphor-systemd-target-monitor.service.in
deleted file mode 100644
index ffd980f..0000000
--- a/service_files/phosphor-systemd-target-monitor.service.in
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=phosphor systemd target monitor
-After=dbus.service
-
-[Service]
-Restart=always
-ExecStart=/usr/bin/phosphor-systemd-target-monitor -f /etc/phosphor-systemd-target-monitor/phosphor-target-monitor-default.json
-
-[Install]
-WantedBy=multi-user.target
diff --git a/test/Makefile.am.include b/test/Makefile.am.include
deleted file mode 100644
index ba8d106..0000000
--- a/test/Makefile.am.include
+++ /dev/null
@@ -1,8 +0,0 @@
-test_systemd_parser_SOURCES = %reldir%/systemd_parser.cpp systemd_target_parser.cpp
-test_systemd_signal_SOURCES = %reldir%/systemd_signal.cpp systemd_target_signal.cpp
-
-check_PROGRAMS += \
- %reldir%/systemd_parser
-
-check_PROGRAMS += \
- %reldir%/systemd_signal