diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2014-03-21 16:42:53 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2014-03-21 16:42:53 +0000 |
commit | 1720786e61396c74c14b561e11b22c9c045898c6 (patch) | |
tree | f65d9faacf8650c3f395e60a141cc0b579d1e5ec /config-scripts | |
parent | f2b8078bd6129eb05e81a9bb07a2d7a295d5422e (diff) |
Add systemd support to cupsd (STR #3282)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11717 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'config-scripts')
-rw-r--r-- | config-scripts/cups-directories.m4 | 96 | ||||
-rw-r--r-- | config-scripts/cups-ondemand.m4 | 76 | ||||
-rw-r--r-- | config-scripts/cups-startup.m4 | 176 |
3 files changed, 176 insertions, 172 deletions
diff --git a/config-scripts/cups-directories.m4 b/config-scripts/cups-directories.m4 index f4227506f..40a17038a 100644 --- a/config-scripts/cups-directories.m4 +++ b/config-scripts/cups-directories.m4 @@ -121,102 +121,6 @@ fi AC_SUBST(privateinclude) AC_SUBST(PRIVATEINCLUDE) -dnl Setup init.d locations... -AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="") -AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5") -AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="99") -AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="00") -AC_ARG_WITH(smfmanifestdir, [ --with-smfmanifestdir set path for Solaris SMF manifest],smfmanifestdir="$withval",smfmanifestdir="") - -INITDIR="" -INITDDIR="" -RCLEVELS="$rclevels" -RCSTART="$rcstart" -RCSTOP="$rcstop" -SMFMANIFESTDIR="" - -if test x$rcdir = x; then - case "$uname" in - Darwin*) - # Darwin and MacOS X... - if test ! -x /sbin/launchd; then - INITDDIR="/System/Library/StartupItems/PrintingServices" - fi - ;; - - FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*) - # FreeBSD and OpenBSD - ;; - - Linux | GNU | GNU/k*BSD*) - # Linux/HURD seems to choose an init.d directory at random... - if test -d /sbin/init.d; then - # SuSE - INITDIR="/sbin/init.d" - else - if test -d /etc/init.d; then - # Others - INITDIR="/etc" - else - # RedHat - INITDIR="/etc/rc.d" - fi - fi - RCSTART="81" - RCSTOP="36" - ;; - - NetBSD*) - # NetBSD - INITDDIR="/etc/rc.d" - ;; - - SunOS*) - # Solaris - if test "x$smfmanifestdir" != x; then - SMFMANIFESTDIR=$smfmanifestdir - else - INITDIR="/etc" - RCSTART="81" - fi - ;; - - *) - INITDIR="/etc" - ;; - - esac -elif test "x$rcdir" != xno; then - if test "x$rclevels" = x; then - INITDDIR="$rcdir" - else - INITDIR="$rcdir" - fi -fi - -AC_SUBST(INITDIR) -AC_SUBST(INITDDIR) -AC_SUBST(RCLEVELS) -AC_SUBST(RCSTART) -AC_SUBST(RCSTOP) -AC_SUBST(SMFMANIFESTDIR) - -dnl Xinetd support... -AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],XINETD="$withval",XINETD="") - -if test "x$XINETD" = x -a ! -x /sbin/launchd; then - for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do - if test -d $dir; then - XINETD="$dir" - break - fi - done -elif test "x$XINETD" = xno; then - XINETD="" -fi - -AC_SUBST(XINETD) - dnl LPD sharing support... AC_ARG_WITH(lpdconfig, [ --with-lpdconfig set URI for LPD config file], LPDCONFIG="$withval", LPDCONFIG="") diff --git a/config-scripts/cups-ondemand.m4 b/config-scripts/cups-ondemand.m4 deleted file mode 100644 index b1ea1a3ff..000000000 --- a/config-scripts/cups-ondemand.m4 +++ /dev/null @@ -1,76 +0,0 @@ -dnl -dnl "$Id$" -dnl -dnl Launch-on-demand stuff for CUPS. -dnl -dnl Copyright 2007-2014 by Apple Inc. -dnl Copyright 1997-2005 by Easy Software Products, all rights reserved. -dnl -dnl These coded instructions, statements, and computer programs are the -dnl property of Apple Inc. and are protected by Federal copyright -dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" -dnl which should have been included with this file. If this file is -dnl file is missing or damaged, see the license at "http://www.cups.org/". -dnl - -ONDEMANDFLAGS="" -ONDEMANDLIBS="" -AC_SUBST(ONDEMANDFLAGS) -AC_SUBST(ONDEMANDLIBS) - -dnl Launchd is used on OS X/Darwin... -AC_ARG_ENABLE(launchd, [ --disable-launchd disable launchd support]) -LAUNCHD_DIR="" -AC_SUBST(LAUNCHD_DIR) - -if test x$enable_launchd != xno; then - AC_CHECK_FUNC(launch_msg, AC_DEFINE(HAVE_LAUNCHD)) - if test $uversion -ge 140; then - AC_CHECK_FUNC(launch_activate_socket, [ - AC_DEFINE(HAVE_LAUNCHD) - AC_DEFINE(HAVE_LAUNCH_ACTIVATE_SOCKET)]) - fi - AC_CHECK_HEADER(launch.h, AC_DEFINE(HAVE_LAUNCH_H)) - - case "$uname" in - Darwin*) - # Darwin, MacOS X - LAUNCHD_DIR="/System/Library/LaunchDaemons/org.cups.cupsd.plist" - # liblaunch is already part of libSystem - ;; - *) - # All others; this test will need to be updated - ;; - esac -fi - -dnl Systemd is used on Linux... -AC_ARG_ENABLE(systemd, [ --disable-systemd disable systemd support]) -AC_ARG_WITH(systemd, [ --with-systemd set directory for systemd service files], - SYSTEMD_DIR="$withval", SYSTEMD_DIR="") -AC_SUBST(SYSTEMD_DIR) - -if test x$enable_systemd != xno; then - if test "x$PKGCONFIG" = x; then - if test x$enable_systemd = xyes; then - AC_MSG_ERROR(Need pkg-config to enable systemd support.) - fi - else - AC_MSG_CHECKING(for libsystemd-daemon) - if $PKGCONFIG --exists libsystemd-daemon; then - AC_MSG_RESULT(yes) - ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon` - ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon` - AC_DEFINE(HAVE_SYSTEMD) - if test "x$SYSTEMD_DIR" = x; then - SYSTEMD_DIR="`$PKGCONFIG --variable=systemdsystemunitdir systemd`" - fi - else - AC_MSG_RESULT(no) - fi - fi -fi - -dnl -dnl End of "$Id$". -dnl diff --git a/config-scripts/cups-startup.m4 b/config-scripts/cups-startup.m4 new file mode 100644 index 000000000..dcb13d2dd --- /dev/null +++ b/config-scripts/cups-startup.m4 @@ -0,0 +1,176 @@ +dnl +dnl "$Id$" +dnl +dnl Launch-on-demand/startup stuff for CUPS. +dnl +dnl Copyright 2007-2014 by Apple Inc. +dnl Copyright 1997-2005 by Easy Software Products, all rights reserved. +dnl +dnl These coded instructions, statements, and computer programs are the +dnl property of Apple Inc. and are protected by Federal copyright +dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" +dnl which should have been included with this file. If this file is +dnl file is missing or damaged, see the license at "http://www.cups.org/". +dnl + +ONDEMANDFLAGS="" +ONDEMANDLIBS="" +AC_SUBST(ONDEMANDFLAGS) +AC_SUBST(ONDEMANDLIBS) + +dnl Launchd is used on OS X/Darwin... +AC_ARG_ENABLE(launchd, [ --disable-launchd disable launchd support]) +LAUNCHD_DIR="" +AC_SUBST(LAUNCHD_DIR) + +if test x$enable_launchd != xno; then + AC_CHECK_FUNC(launch_msg, AC_DEFINE(HAVE_LAUNCHD)) + if test $uversion -ge 140; then + AC_CHECK_FUNC(launch_activate_socket, [ + AC_DEFINE(HAVE_LAUNCHD) + AC_DEFINE(HAVE_LAUNCH_ACTIVATE_SOCKET)]) + fi + AC_CHECK_HEADER(launch.h, AC_DEFINE(HAVE_LAUNCH_H)) + + case "$uname" in + Darwin*) + # Darwin, MacOS X + LAUNCHD_DIR="/System/Library/LaunchDaemons/org.cups.cupsd.plist" + # liblaunch is already part of libSystem + ;; + *) + # All others; this test will need to be updated + ;; + esac +fi + +dnl Systemd is used on Linux... +AC_ARG_ENABLE(systemd, [ --disable-systemd disable systemd support]) +AC_ARG_WITH(systemd, [ --with-systemd set directory for systemd service files], + SYSTEMD_DIR="$withval", SYSTEMD_DIR="") +AC_SUBST(SYSTEMD_DIR) + +if test x$enable_systemd != xno; then + if test "x$PKGCONFIG" = x; then + if test x$enable_systemd = xyes; then + AC_MSG_ERROR(Need pkg-config to enable systemd support.) + fi + else + AC_MSG_CHECKING(for libsystemd-daemon) + if $PKGCONFIG --exists libsystemd-daemon; then + AC_MSG_RESULT(yes) + ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon` + ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon` + AC_DEFINE(HAVE_SYSTEMD) + if test "x$SYSTEMD_DIR" = x; then + SYSTEMD_DIR="`$PKGCONFIG --variable=systemdsystemunitdir systemd`" + fi + else + AC_MSG_RESULT(no) + fi + fi +fi + +dnl Solaris uses smf +SMFMANIFESTDIR="" +AC_SUBST(SMFMANIFESTDIR) +AC_ARG_WITH(smfmanifestdir, [ --with-smfmanifestdir set path for Solaris SMF manifest],SMFMANIFESTDIR="$withval") + +dnl Use init on other platforms... +AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="") +AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5") +AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="") +AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="") + +if test x$rcdir = x; then + if test x$LAUNCHD_DIR = x -a x$SYSTEMD_DIR = x -a x$SMFMANIFESTDIR = x; then + # Fall back on "init", the original service startup interface... + if test -d /sbin/init.d; then + # SuSE + rcdir="/sbin/init.d" + elif test -d /etc/init.d; then + # Others + rcdir="/etc" + else + # RedHat, NetBSD + rcdir="/etc/rc.d" + fi + else + rcdir="no" + fi +fi + +if test "x$rcstart" = x; then + case "$uname" in + Linux | GNU | GNU/k*BSD*) + # Linux + rcstart="81" + ;; + + SunOS*) + # Solaris + rcstart="81" + ;; + + *) + # Others + rcstart="99" + ;; + esac +fi + +if test "x$rcstop" = x; then + case "$uname" in + Linux | GNU | GNU/k*BSD*) + # Linux + rcstop="36" + ;; + + *) + # Others + rcstop="00" + ;; + esac +fi + +INITDIR="" +INITDDIR="" +RCLEVELS="$rclevels" +RCSTART="$rcstart" +RCSTOP="$rcstop" +AC_SUBST(INITDIR) +AC_SUBST(INITDDIR) +AC_SUBST(RCLEVELS) +AC_SUBST(RCSTART) +AC_SUBST(RCSTOP) + +if test "x$rcdir" != xno; then + if test "x$rclevels" = x; then + INITDDIR="$rcdir" + else + INITDIR="$rcdir" + fi +fi + +dnl Xinetd support... +AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],xinetd="$withval",xinetd="") +XINETD="" +AC_SUBST(XINETD) + +if test "x$xinetd" = x; then + if test ! -x /sbin/launchd; then + for dir in /etc/xinetd.d /usr/local/etc/xinetd.d; do + if test -d $dir; then + XINETD="$dir" + break + fi + done + fi +elif test "x$xinet" != xno; then + XINETD="$xinetd" +fi + + +dnl +dnl End of "$Id$". +dnl |