Implement the Client create interface
This commit also implement the D-Bus service which would be
used for snmp client configuration and would add the
snmp manager/trap receiver D-Bus objects under
namespace /xyz/openbmc_project/network/snmp/manager/
It implements the delete interface for SNMP client D-Bus Object.
Resolves openbmc/openbmc#3057
Change-Id: I0df7b1475f81325b9ac497c1fb350c3f62329686
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/configure.ac b/configure.ac
index a32dbdc..a0cdbe2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,13 +12,43 @@
AM_PROG_AR
AC_PROG_INSTALL
AC_PROG_MAKE_SET
+AC_PROG_MKDIR_P
LT_PREREQ([2.4.6])
LT_INIT([dlopen disable-static shared])
+# Checks for libraries.
+AX_PKG_CHECK_MODULES([SYSTEMD], [], [libsystemd >= 221], [],\
+[AC_MSG_ERROR(["Systemd version should be greater then 221."])])
+
+AX_PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], [], [],\
+[AC_MSG_ERROR(["Requires sdbusplus package."])])
+
+
+AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
+
+AX_PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [], [phosphor-logging], [],\
+[AC_MSG_ERROR(["Requires phosphor-logging package."])])
+
+# 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])])
+
+AX_PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [], [phosphor-dbus-interfaces],\
+[], [AC_MSG_ERROR(["phosphor-dbus-interfaces required and not found."])])
+
AC_CHECK_HEADERS([net-snmp/net-snmp-config.h],,\
AC_MSG_ERROR(["Requires net-snmp headers"]))
+AC_ARG_VAR(BUSNAME_NETWORK_SNMP, [The Dbus busname to own])
+AS_IF([test "x$BUSNAME_NETWORK_SNMP" == "x"], [BUSNAME_NETWORK_SNMP="xyz.openbmc_project.Network.SNMP"])
+AC_DEFINE_UNQUOTED([BUSNAME_NETWORK_SNMP], ["$BUSNAME_NETWORK_SNMP"], [The DBus busname to own])
+
+AC_ARG_VAR(OBJ_NETWORK_SNMP, [The network snmp root DBus object path])
+AS_IF([test "x$OBJ_NETWORK_SNMP" == "x"], [OBJ_NETWORK_SNMP="/xyz/openbmc_project/network/snmp/manager"])
+AC_DEFINE_UNQUOTED([OBJ_NETWORK_SNMP], ["$OBJ_NETWORK_SNMP"], [The network snmp root DBus object path])
+
+
# Checks for library functions
LT_INIT # Required for systemd linking
@@ -47,9 +77,8 @@
AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
)
-
+# Create configured output
+AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([phosphor-snmp.pc])
AC_OUTPUT
-
-