build: Remove autotools

Change-Id: I3be682670d5c631183fa9e91fc2a3c3e08e21a34
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/.gitignore b/.gitignore
index a0d5bae..327ea97 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,65 +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
-
-# 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/
-
-/ltmain.sh
-/libtool
-
-# http://www.gnu.org/software/texinfo
-
-/texinfo.tex
-
-# Repo specific items
-*.o
-/config.h
-/config.h.in~
-/config.log
-/config.status
-/ncsi-netlink
-/phosphor-network-manager
-Makefile
-.deps
-/*-libtool
-/xyz/
-test/*.log
-test/*.trs
-test/test_dns_updater
-test/test
-/xyz.openbmc_project.Network.conf
-/xyz.openbmc_project.Network.service
-
-# https://www.gitignore.io/api/python
-# Byte-compiled / optimized / DLL files
-__pycache__/
-*.py[cod]
-*$py.class
-
 /build*/
 /subprojects/*/
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index bbf1d41..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,135 +0,0 @@
-# Build these headers, don't install them
-nobase_nodist_include_HEADERS = \
-	xyz/openbmc_project/Network/VLAN/Create/server.hpp \
-	xyz/openbmc_project/Network/IP/Create/server.hpp \
-	xyz/openbmc_project/Network/Neighbor/CreateStatic/server.hpp
-
-if HAVE_SYSTEMD
-systemdsystemunit_DATA = \
-		xyz.openbmc_project.Network.service
-
-dbuspolicy_DATA = \
-		xyz.openbmc_project.Network.conf
-endif
-
-bin_PROGRAMS = phosphor-network-manager ncsi-netlink
-
-noinst_HEADERS = \
-		ethernet_interface.hpp \
-		neighbor.hpp \
-		netlink.hpp \
-		network_config.hpp \
-		network_manager.hpp \
-		ipaddress.hpp \
-		types.hpp \
-		util.hpp \
-		routing_table.hpp \
-		config_parser.hpp \
-		system_configuration.hpp \
-		dhcp_configuration.hpp \
-		vlan_interface.hpp \
-		rtnetlink_server.hpp \
-		dns_updater.hpp \
-		watch.hpp \
-		argument.hpp
-
-ncsi_netlink_SOURCES = \
-		argument.cpp \
-		ncsi_netlink_main.cpp \
-		ncsi_util.cpp
-
-ncsi_netlink_LDFLAGS = \
-        $(PHOSPHOR_LOGGING_LIBS) \
-		$(LIBNL_LIBS)
-
-ncsi_netlink_CPPFLAGS = $(LIBNL_CFLAGS)
-ncsi_netlink_CXXFLAGS = -flto
-
-
-phosphor_network_manager_SOURCES = \
-		ethernet_interface.cpp \
-		neighbor.cpp \
-		ipaddress.cpp \
-		netlink.cpp \
-		network_config.cpp \
-		network_manager.cpp \
-		network_manager_main.cpp \
-		system_configuration.cpp \
-		xyz/openbmc_project/Network/VLAN/Create/server.cpp \
-		xyz/openbmc_project/Network/IP/Create/server.cpp \
-		xyz/openbmc_project/Network/Neighbor/CreateStatic/server.cpp \
-		util.cpp \
-		routing_table.cpp \
-		config_parser.cpp \
-		dhcp_configuration.cpp \
-		vlan_interface.cpp \
-		rtnetlink_server.cpp \
-		dns_updater.cpp \
-		watch.cpp
-
-CLEANFILES = \
-		xyz/openbmc_project/Network/VLAN/Create/server.cpp \
-		xyz/openbmc_project/Network/VLAN/Create/server.hpp \
-		xyz/openbmc_project/Network/IP/Create/server.cpp \
-		xyz/openbmc_project/Network/IP/Create/server.hpp \
-		xyz/openbmc_project/Network/Neighbor/CreateStatic/server.cpp \
-		xyz/openbmc_project/Network/Neighbor/CreateStatic/server.hpp
-
-BUILT_SOURCES = \
-		xyz/openbmc_project/Network/VLAN/Create/server.cpp \
-		xyz/openbmc_project/Network/VLAN/Create/server.hpp \
-		xyz/openbmc_project/Network/IP/Create/server.cpp \
-		xyz/openbmc_project/Network/IP/Create/server.hpp \
-		xyz/openbmc_project/Network/Neighbor/CreateStatic/server.cpp \
-		xyz/openbmc_project/Network/Neighbor/CreateStatic/server.hpp
-
-phosphor_network_manager_LDFLAGS = \
-		$(SYSTEMD_LIBS) \
-		$(SDBUSPLUS_LIBS) \
-		$(SDEVENTPLUS_LIBS) \
-		$(STDPLUS_LIBS) \
-		$(PHOSPHOR_DBUS_INTERFACES_LIBS) \
-		$(PHOSPHOR_LOGGING_LIBS)
-
-phosphor_network_manager_CXXFLAGS = \
-		$(SYSTEMD_CFLAGS) \
-		$(SDBUSPLUS_CFLAGS) \
-		$(SDEVENTPLUS_CFLAGS) \
-		$(STDPLUS_CFLAGS) \
-		$(PHOSPHOR_DBUS_INTERFACES_CFLAGS) \
-		$(PHOSPHOR_LOGGING_CFLAGS) \
-		-flto
-
-if FEATURE_NIC_ETHTOOL
-phosphor_network_manager_CXXFLAGS += -DNIC_SUPPORTS_ETHTOOL
-endif
-
-if FEATURE_SYNC_MAC_FROM_INVENTORY
-phosphor_network_manager_CXXFLAGS += -DSYNC_MAC_FROM_INVENTORY
-endif
-
-xyz/openbmc_project/Network/VLAN/Create/server.cpp: xyz/openbmc_project/Network/VLAN/Create.interface.yaml xyz/openbmc_project/Network/VLAN/Create/server.hpp
-	@mkdir -p `dirname $@`
-	$(SDBUSPLUSPLUS) -r $(srcdir) interface server-cpp xyz.openbmc_project.Network.VLAN.Create > $@
-
-xyz/openbmc_project/Network/VLAN/Create/server.hpp: xyz/openbmc_project/Network/VLAN/Create.interface.yaml
-	@mkdir -p `dirname $@`
-	$(SDBUSPLUSPLUS) -r $(srcdir) interface server-header xyz.openbmc_project.Network.VLAN.Create > $@
-
-xyz/openbmc_project/Network/IP/Create/server.cpp: xyz/openbmc_project/Network/IP/Create.interface.yaml xyz/openbmc_project/Network/IP/Create/server.hpp
-	@mkdir -p `dirname $@`
-	$(SDBUSPLUSPLUS) -r $(srcdir) interface server-cpp xyz.openbmc_project.Network.IP.Create > $@
-
-xyz/openbmc_project/Network/IP/Create/server.hpp: xyz/openbmc_project/Network/IP/Create.interface.yaml
-	@mkdir -p `dirname $@`
-	$(SDBUSPLUSPLUS) -r $(srcdir) interface server-header xyz.openbmc_project.Network.IP.Create > $@
-
-xyz/openbmc_project/Network/Neighbor/CreateStatic/server.cpp: xyz/openbmc_project/Network/Neighbor/CreateStatic.interface.yaml xyz/openbmc_project/Network/Neighbor/CreateStatic/server.hpp
-	@mkdir -p `dirname $@`
-	$(SDBUSPLUSPLUS) -r $(srcdir) interface server-cpp xyz.openbmc_project.Network.Neighbor.CreateStatic > $@
-
-xyz/openbmc_project/Network/Neighbor/CreateStatic/server.hpp: xyz/openbmc_project/Network/Neighbor/CreateStatic.interface.yaml
-	@mkdir -p `dirname $@`
-	$(SDBUSPLUSPLUS) -r $(srcdir) interface server-header xyz.openbmc_project.Network.Neighbor.CreateStatic > $@
-
-SUBDIRS = test
diff --git a/README.md b/README.md
index 44e811c..db06feb 100644
--- a/README.md
+++ b/README.md
@@ -2,9 +2,6 @@
 ```
 To build this package, do the following steps:
 
-    1. ./bootstrap.sh
-    2. ./configure ${CONFIGURE_FLAGS}
-    3. make
-
-To clean the repository run `./bootstrap.sh clean`.
+    1. meson build
+    2. ninja -C build
 ```
diff --git a/bootstrap.sh b/bootstrap.sh
deleted file mode 100755
index ef3ea85..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" | 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 a8ef082..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,171 +0,0 @@
-# Initializaion
-AC_PREREQ([2.69])
-AC_INIT([phosphor-networkd], [1.0], [https://github.com/openbmc/phosphor-networkd/issues])
-AC_LANG([C++])
-AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
-AM_SILENT_RULES([yes])
-
-
-# Checks for typedefs, structures, and compiler characteristics.
-AX_CXX_COMPILE_STDCXX_17([noext])
-AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CXXFLAGS])
-
-# Checks for programs.
-AC_PROG_CXX
-AC_PROG_CC
-AM_PROG_AR
-AC_PROG_INSTALL
-AC_PROG_MAKE_SET
-
-# Download ncsi.h from github if necessary.
-AC_CHECK_HEADER(linux/ncsi.h,[HAVE_LINUX_NCSI_H=""],[HAVE_LINUX_NCSI_H="-I linux/ncsi.h"])
-AS_IF([test "$HAVE_LINUX_NCSI_H" != ""],
-    AC_MSG_WARN([Could not find linux/ncsi.h: Attempting to download locally for building from https://raw.githubusercontent.com/openbmc/linux/dev-4.13/include/uapi/linux/ncsi.h])
-    AC_SUBST([BT_BMC_DL],[`mkdir -p linux;wget https://raw.githubusercontent.com/openbmc/linux/dev-4.13/include/uapi/linux/ncsi.h -O linux/ncsi.h`])
-)
-
-# Suppress the --with-libtool-sysroot error
-LT_INIT
-
-# Checks for libraries.
-PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
-PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
-PKG_CHECK_MODULES([SDEVENTPLUS], [sdeventplus])
-PKG_CHECK_MODULES([STDPLUS], [stdplus])
-AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
-PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
-PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces])
-PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0])
-
-# Checks for header files.
-AC_CHECK_HEADER(systemd/sd-bus.h, ,\
-[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AX_APPEND_COMPILE_FLAGS([-Wall -Werror -Wno-unused-result], [CFLAGS])
-
-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"])
-
-AC_ARG_WITH([dbuspolicydir],
-    AS_HELP_STRING([--with-dbuspolicydir=DIR], [Directory for D-Bus system policy files])
-)
-AS_IF([test "x$with_dbuspolicydir" = "x"],
-      [with_dbuspolicydir='${sysconfdir}/dbus-1/system.d']
-)
-AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
-
-AC_ARG_WITH([uboot-env],
-              AS_HELP_STRING([--without-uboot-env], [Disable features that require a u-boot environment]))
-AS_IF([test "x$with_uboot_env" != "xno"], [
-     AC_DEFINE([HAVE_UBOOT_ENV], [1], [u-boot environment is available])
-])
-
-# Check/set gtest specific functions.
-AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-GTEST_HAS_PTHREAD=0"])
-AC_SUBST(GTEST_CPPFLAGS)
-
-AC_ARG_ENABLE([oe-sdk],
-    AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
-)
-AC_ARG_VAR(OECORE_TARGET_SYSROOT,
-    [Path to the OE SDK SYSROOT])
-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])
-)
-
-# If set, auto-configure a link-local address on the NIC.
-AC_ARG_ENABLE(
-    [link-local-autoconfiguration],
-    AS_HELP_STRING([--disable-link-local-autoconfiguration], [Disable link-local IP address autoconfiguration]),
-    [],
-    [enable_link_local_autoconfiguration="yes"]
-)
-if test "x$enable_link_local_autoconfiguration" = "xyes"; then
-    AC_DEFINE([LINK_LOCAL_AUTOCONFIGURATION], [1], [Enable link-local IP address autoconfiguration])
-fi
-
-# If set, enable the BMC to accept IPv6 Router Advertisement for IPv6 address
-# configuration.
-AC_ARG_ENABLE([ipv6_accept_ra],
-    [  --enable-ipv6-accept-ra  Enable/disable the use of ETHTOOL features in the NIC driver],
-    [case "${enableval}" in
-      yes) enable_ipv6_accept_ra=true ;;
-      no) enable_ipv6_accept_ra=false ;;
-      *) AC_MSG_ERROR([bad value ${ipv6_accept_ra} for --enable-ipv6-accept-ra]) ;;
-      esac],[enable_ipv6_accept_ra=false]
-      )
-if test "x$enable_ipv6_accept_ra" = "xtrue"; then
-    AC_DEFINE([ENABLE_IPV6_ACCEPT_RA], [1], [Enable IPv6 Router Advertisement])
-fi
-
-DEFAULT_BUSNAME='xyz.openbmc_project.Network'
-AC_DEFINE_UNQUOTED([DEFAULT_BUSNAME], ["$DEFAULT_BUSNAME"], [The DBus busname to own])
-AC_SUBST(DEFAULT_BUSNAME, ["$DEFAULT_BUSNAME"])
-
-AC_ARG_VAR(SYSTEMD_TARGET, "Target for starting this service")
-AS_IF([test "x$SYSTEMD_TARGET" == "x"], [SYSTEMD_TARGET="multi-user.target"])
-
-AC_ARG_ENABLE([nic_ethtool],
-    [  --enable-nic-ethtool  Enable/disable the use of ETHTOOL features in the NIC driver],
-    [case "${enableval}" in
-      yes) nic_ethtool=true ;;
-      no) nic_ethtool=false ;;
-      *) AC_MSG_ERROR([bad value ${nic_ethtool} for --enable-nic-ethtool]) ;;
-      esac],[nic_ethtool=false]
-      )
-AM_CONDITIONAL([FEATURE_NIC_ETHTOOL], [test x$nic_ethtool = xtrue])
-
-# Configure option to enable sync operation between the MAC address in the Inventory 
-# on to the respective ethernet interface
-AC_ARG_ENABLE([sync_mac],
-    [  --enable-sync-mac  Enable/disable sync mac mapping for ethernet interface],
-    [case "${enableval}" in
-      yes) sync_mac=true ;;
-      no) sync_mac=false ;;
-      *) AC_MSG_ERROR([bad value ${sync_mac} for --enable-sync-mac]) ;;
-      esac],[sync_mac=false]
-      )
-AM_CONDITIONAL([FEATURE_SYNC_MAC_FROM_INVENTORY], [test x$sync_mac = xtrue])
-
-#check for nlohmann-json header files.
-AS_IF([test "x$sync_mac" == "xtrue"],[
-AC_CHECK_HEADER(
-    nlohmann/json.hpp,
-    [],
-    [AC_MSG_ERROR([Could not find nlohmann/json.hpp])]]
-))
-
-# Create configured output.
-AC_CONFIG_FILES([Makefile test/Makefile])
-AC_CONFIG_FILES([xyz.openbmc_project.Network.service])
-AC_CONFIG_FILES([xyz.openbmc_project.Network.conf])
-AC_OUTPUT
diff --git a/test/Makefile.am b/test/Makefile.am
deleted file mode 100644
index 26a6aa3..0000000
--- a/test/Makefile.am
+++ /dev/null
@@ -1,57 +0,0 @@
-AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir}
-
-TESTS = $(check_PROGRAMS)
-
-check_PROGRAMS = test
-
-test_SOURCES = \
-	test_util.cpp \
-	mock_syscall.cpp \
-	global_network_objects.cpp \
-	test_neighbor.cpp \
-	test_netlink.cpp \
-	test_network_manager.cpp \
-	test_ethernet_interface.cpp \
-	test_rtnetlink.cpp \
-	test_config_parser.cpp \
-	test_vlan_interface.cpp
-
-generic_cpp_flags = -Igtest $(GTEST_CPPFLAGS) $(AM_CPPFLAGS)
-
-generic_cxx_flags = $(PTHREAD_CFLAGS) \
-					$(SYSTEMD_CFLAGS) \
-					$(SDBUSPLUS_CFLAGS) \
-					$(SDEVENTPLUS_CFLAGS) \
-					$(STDPLUS_CFLAGS) \
-					$(PHOSPHOR_LOGGING_CFLAGS) \
-					$(PHOSPHOR_DBUS_INTERFACES_CFLAGS)
-
-generic_ld_flags =  -lgtest_main -lgtest -lgmock \
-					$(OESDK_TESTCASE_FLAGS) \
-					$(SYSTEMD_LIBS) \
-					$(SDBUSPLUS_LIBS) \
-					$(SDEVENTPLUS_LIBS) \
-					$(STDPLUS_LIBS) \
-					$(PHOSPHOR_LOGGING_LIBS) \
-					$(PHOSPHOR_DBUS_INTERFACES_LIBS)
-
-test_CPPFLAGS = ${generic_cpp_flags}
-test_CXXFLAGS = ${generic_cxx_flags}
-test_LDFLAGS  = ${generic_ld_flags} -ldl
-
-test_LDADD = $(top_builddir)/ethernet_interface.o \
-			$(top_builddir)/network_manager.o \
-			$(top_builddir)/network_config.o \
-			$(top_builddir)/ipaddress.o \
-			$(top_builddir)/neighbor.o \
-			$(top_builddir)/netlink.o \
-			$(top_builddir)/routing_table.o \
-			$(top_builddir)/util.o \
-			$(top_builddir)/rtnetlink_server.o \
-			$(top_builddir)/system_configuration.o \
-			$(top_builddir)/dhcp_configuration.o \
-			$(top_builddir)/config_parser.o \
-			$(top_builddir)/vlan_interface.o \
-			$(top_builddir)/xyz/openbmc_project/Network/VLAN/Create/phosphor_network_manager-server.o \
-			$(top_builddir)/xyz/openbmc_project/Network/IP/Create/phosphor_network_manager-server.o \
-			$(top_builddir)/xyz/openbmc_project/Network/Neighbor/CreateStatic/phosphor_network_manager-server.o