build: Add ./configure --enable-install-daemon
authorRichard W.M. Jones <rjones@redhat.com>
Thu, 14 Jul 2011 14:52:29 +0000 (15:52 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 14 Jul 2011 14:52:29 +0000 (15:52 +0100)
If enabled, then the daemon will be installed in $sbindir
(eg. /usr/sbin/guestfsd).  The default is off, as now.

This option should be used by packagers when building the libguestfs
live service.

daemon/Makefile.am
daemon/configure.ac

index 67589b4..3fe8c88 100644 (file)
@@ -86,7 +86,12 @@ errnostring.h: $(libsrcdir)/errnostring.h
        rm -f $@
        ln $< $@
 
        rm -f $@
        ln $< $@
 
+if INSTALL_DAEMON
+sbin_PROGRAMS = guestfsd
+else
 noinst_PROGRAMS = guestfsd
 noinst_PROGRAMS = guestfsd
+endif
+
 guestfsd_SOURCES = \
        9p.c \
        actions.h \
 guestfsd_SOURCES = \
        9p.c \
        actions.h \
index e5eb89b..7a6c04a 100644 (file)
@@ -39,6 +39,16 @@ AC_ARG_ENABLE([packet-dump],
         [AC_DEFINE([ENABLE_PACKET_DUMP],[1],[Enable packet dumps in verbose mode.])],
         [])
 
         [AC_DEFINE([ENABLE_PACKET_DUMP],[1],[Enable packet dumps in verbose mode.])],
         [])
 
+dnl Install the daemon (for libguestfs live service)
+AC_MSG_CHECKING([if we should install the daemon])
+AC_ARG_ENABLE([install-daemon],
+        [AS_HELP_STRING([--enable-install-daemon],
+          [enable installing the daemon under $sbindir @<:@default=no@:>@])],
+        [],
+        [enable_install_daemon=no])
+AM_CONDITIONAL([INSTALL_DAEMON],[test "x$enable_install_daemon" = "xyes"])
+AC_MSG_RESULT([$enable_install_daemon])
+
 dnl For strchrnul(3), asprintf(3), futimens(2) and getline(3).
 AC_GNU_SOURCE
 
 dnl For strchrnul(3), asprintf(3), futimens(2) and getline(3).
 AC_GNU_SOURCE