Ticket #366: Restore --with-init-dir option for configure.

This commit is contained in:
Michael Jumper 2013-07-08 10:35:56 -07:00
parent 2d3cf15243
commit e6ec853edb
2 changed files with 21 additions and 5 deletions

View File

@ -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=<path>],
[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
#
@ -167,6 +175,8 @@ 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 "
------------------------------------------------
$PACKAGE_NAME version $PACKAGE_VERSION
@ -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.
"

View File

@ -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