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`"
71 AC_MSG_CHECKING(for libsystemd-journal)
72 if $PKGCONFIG --exists libsystemd-journal; then
74 ONDEMANDFLAGS="$ONDEMANDFLAGS `$PKGCONFIG --cflags libsystemd-journal`"
75 ONDEMANDLIBS="$ONDEMANDLIBS `$PKGCONFIG --libs libsystemd-journal`"
76 AC_CHECK_HEADER(systemd/sd-journal.h,AC_DEFINE(HAVE_SYSTEMD_SD_JOURNAL_H))
85 AC_SUBST(SMFMANIFESTDIR)
86 AC_ARG_WITH(smfmanifestdir, [ --with-smfmanifestdir set path for Solaris SMF manifest],SMFMANIFESTDIR="$withval")
88 dnl Use init on other platforms...
89 AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
90 AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
91 AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="")
92 AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="")
94 if test x$rcdir = x; then
95 if test x$LAUNCHD_DIR = x -a x$SYSTEMD_DIR = x -a x$SMFMANIFESTDIR = x; then
96 # Fall back on "init", the original service startup interface...
97 if test -d /sbin/init.d; then
100 elif test -d /etc/init.d; then
112 if test "x$rcstart" = x; then
114 Linux | GNU | GNU/k*BSD*)
131 if test "x$rcstop" = x; then
133 Linux | GNU | GNU/k*BSD*)
156 if test "x$rcdir" != xno; then
157 if test "x$rclevels" = x; then
164 dnl Xinetd support...
165 AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],xinetd="$withval",xinetd="")
169 if test "x$xinetd" = x; then
170 if test ! -x /sbin/launchd; then
171 for dir in /etc/xinetd.d /usr/local/etc/xinetd.d; do
172 if test -d $dir; then
178 elif test "x$xinetd" != xno; then