4 dnl Launch-on-demand/startup stuff for CUPS.
6 dnl Copyright 2007-2014 by Apple Inc.
7 dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
9 dnl These coded instructions, statements, and computer programs are the
10 dnl property of Apple Inc. and are protected by Federal copyright
11 dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 dnl which should have been included with this file. If this file is
13 dnl file is missing or damaged, see the license at "http://www.cups.org/".
18 AC_SUBST(ONDEMANDFLAGS)
19 AC_SUBST(ONDEMANDLIBS)
21 dnl Launchd is used on OS X/Darwin...
22 AC_ARG_ENABLE(launchd, [ --disable-launchd disable launchd support])
26 if test x$enable_launchd != xno; then
27 AC_CHECK_FUNC(launch_msg, AC_DEFINE(HAVE_LAUNCHD))
28 if test $uversion -ge 140; then
29 AC_CHECK_FUNC(launch_activate_socket, [
30 AC_DEFINE(HAVE_LAUNCHD)
31 AC_DEFINE(HAVE_LAUNCH_ACTIVATE_SOCKET)])
33 AC_CHECK_HEADER(launch.h, AC_DEFINE(HAVE_LAUNCH_H))
38 LAUNCHD_DIR="/System/Library/LaunchDaemons"
39 # liblaunch is already part of libSystem
42 # All others; this test will need to be updated
47 dnl Systemd is used on Linux...
48 AC_ARG_ENABLE(systemd, [ --disable-systemd disable systemd support])
49 AC_ARG_WITH(systemd, [ --with-systemd set directory for systemd service files],
50 SYSTEMD_DIR="$withval", SYSTEMD_DIR="")
53 if test x$enable_systemd != xno; then
54 if test "x$PKGCONFIG" = x; then
55 if test x$enable_systemd = xyes; then
56 AC_MSG_ERROR(Need pkg-config to enable systemd support.)
59 AC_MSG_CHECKING(for libsystemd-daemon)
60 if $PKGCONFIG --exists libsystemd-daemon; then
62 ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
63 ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
64 AC_DEFINE(HAVE_SYSTEMD)
65 if test "x$SYSTEMD_DIR" = x; then
66 SYSTEMD_DIR="`$PKGCONFIG --variable=systemdsystemunitdir systemd`"
76 AC_SUBST(SMFMANIFESTDIR)
77 AC_ARG_WITH(smfmanifestdir, [ --with-smfmanifestdir set path for Solaris SMF manifest],SMFMANIFESTDIR="$withval")
79 dnl Use init on other platforms...
80 AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
81 AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
82 AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="")
83 AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="")
85 if test x$rcdir = x; then
86 if test x$LAUNCHD_DIR = x -a x$SYSTEMD_DIR = x -a x$SMFMANIFESTDIR = x; then
87 # Fall back on "init", the original service startup interface...
88 if test -d /sbin/init.d; then
91 elif test -d /etc/init.d; then
103 if test "x$rcstart" = x; then
105 Linux | GNU | GNU/k*BSD*)
122 if test "x$rcstop" = x; then
124 Linux | GNU | GNU/k*BSD*)
147 if test "x$rcdir" != xno; then
148 if test "x$rclevels" = x; then
155 dnl Xinetd support...
156 AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],xinetd="$withval",xinetd="")
160 if test "x$xinetd" = x; then
161 if test ! -x /sbin/launchd; then
162 for dir in /etc/xinetd.d /usr/local/etc/xinetd.d; do
163 if test -d $dir; then
169 elif test "x$xinet" != xno; then