Adding service file
Service file for swampd has been added
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
Change-Id: If449c0e943f1a82e9d18599391f0dc68c28009ec
diff --git a/configure.ac b/configure.ac
index b216837..bfc6917 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,6 +81,27 @@
AC_ARG_ENABLE([tests], AC_HELP_STRING([--disable-tests],
[Build test cases]))
+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"])
+
# Check/set gtest specific functions.
AS_IF([test "x$enable_tests" != "xno"], [
PKG_CHECK_MODULES([GTEST], [gtest], [], [true])
@@ -188,6 +209,10 @@
[AC_DEFINE(CONFIGURE_DBUS, [0], [Do not read configuration from D-Bus.])]
)
+AC_ARG_VAR(SYSTEMD_TARGET, "Target for starting this service")
+AS_IF([test "x$SYSTEMD_TARGET" == "x"], [SYSTEMD_TARGET="multi-user.target"])
+
# Create configured output
AC_CONFIG_FILES([Makefile test/Makefile])
+AC_CONFIG_FILES([phosphor-pid-control.service])
AC_OUTPUT