From e6ec853edb2ee03cdeef20ebc113d0cedcf2bb89 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 8 Jul 2013 10:35:56 -0700 Subject: [PATCH] Ticket #366: Restore --with-init-dir option for configure. --- configure.ac | 18 +++++++++++++++--- src/guacd/Makefile.am | 8 ++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index cf69ecdb..f0c28111 100644 --- a/configure.ac +++ b/configure.ac @@ -82,6 +82,14 @@ AC_TYPE_SSIZE_T AC_SUBST([LIBGUAC_LTLIB], '$(top_builddir)/src/libguac/libguac.la') AC_SUBST([LIBGUAC_INCLUDE], '-I$(top_srcdir)/src/libguac') +# Options +AC_ARG_WITH(init_dir, + [AS_HELP_STRING([--with-init-dir=], + [install init scripts to the given directory]) + ],init_dir=$withval) +AM_CONDITIONAL([ENABLE_INIT], [test "x${init_dir}" != "x"]) +AC_SUBST(init_dir) + # # Ogg Vorbis # @@ -163,9 +171,11 @@ AC_CONFIG_FILES([Makefile src/protocols/vnc/Makefile]) AC_OUTPUT -AM_COND_IF([ENABLE_RDP], [build_rdp=yes], [build_rdp=no]) -AM_COND_IF([ENABLE_SSH], [build_ssh=yes], [build_ssh=no]) -AM_COND_IF([ENABLE_VNC], [build_vnc=yes], [build_vnc=no]) +AM_COND_IF([ENABLE_RDP], [build_rdp=yes], [build_rdp=no]) +AM_COND_IF([ENABLE_SSH], [build_ssh=yes], [build_ssh=no]) +AM_COND_IF([ENABLE_VNC], [build_vnc=yes], [build_vnc=no]) + +AM_COND_IF([ENABLE_INIT], [build_init="${init_dir}"], [build_init=no]) echo " ------------------------------------------------ @@ -186,6 +196,8 @@ $PACKAGE_NAME version $PACKAGE_VERSION SSH ....... ${build_ssh} VNC ....... ${build_vnc} + Init scripts: ${build_init} + Type \"make\" to compile $PACKAGE_NAME. " diff --git a/src/guacd/Makefile.am b/src/guacd/Makefile.am index ed4017a8..04a8f758 100644 --- a/src/guacd/Makefile.am +++ b/src/guacd/Makefile.am @@ -35,12 +35,10 @@ # ***** END LICENSE BLOCK ***** AUTOMAKE_OPTIONS = foreign -initdir = @init_dir@ AM_CFLAGS = -Werror -Wall -pedantic @LIBGUAC_INCLUDE@ sbin_PROGRAMS = guacd -init_SCRIPTS = init.d/guacd man_MANS = man/guacd.8 noinst_HEADERS = client.h log.h @@ -51,7 +49,13 @@ guacd_LDFLAGS = @PTHREAD_LIBS@ EXTRA_DIST = init.d/guacd.in man/guacd.8 CLEANFILES = $(init_SCRIPTS) +# Init script +if ENABLE_INIT +initdir = @init_dir@ +init_SCRIPTS = init.d/guacd + init.d/guacd: init.d/guacd.in sed -e 's,[@]sbindir[@],$(sbindir),g' < init.d/guacd.in > init.d/guacd chmod +x init.d/guacd +endif