]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-ondemand.m4
Save work on generalizing startup of cupsd…
[thirdparty/cups.git] / config-scripts / cups-ondemand.m4
1 dnl
2 dnl "$Id$"
3 dnl
4 dnl Launch-on-demand stuff for CUPS.
5 dnl
6 dnl Copyright 2007-2014 by Apple Inc.
7 dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
8 dnl
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/".
14 dnl
15
16 ONDEMANDFLAGS=""
17 ONDEMANDLIBS=""
18 AC_SUBST(ONDEMANDFLAGS)
19 AC_SUBST(ONDEMANDLIBS)
20
21 dnl Launchd is used on OS X/Darwin...
22 AC_ARG_ENABLE(launchd, [ --disable-launchd disable launchd support])
23 LAUNCHD_DIR=""
24 AC_SUBST(LAUNCHD_DIR)
25
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)])
32 fi
33 AC_CHECK_HEADER(launch.h, AC_DEFINE(HAVE_LAUNCH_H))
34
35 case "$uname" in
36 Darwin*)
37 # Darwin, MacOS X
38 LAUNCHD_DIR="/System/Library/LaunchDaemons/org.cups.cupsd.plist"
39 # liblaunch is already part of libSystem
40 ;;
41 *)
42 # All others; this test will need to be updated
43 ;;
44 esac
45 fi
46
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="")
51 AC_SUBST(SYSTEMD_DIR)
52
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.)
57 fi
58 else
59 AC_MSG_CHECKING(for libsystemd-daemon)
60 if $PKGCONFIG --exists libsystemd-daemon; then
61 AC_MSG_RESULT(yes)
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`"
67 fi
68 else
69 AC_MSG_RESULT(no)
70 fi
71 fi
72 fi
73
74 dnl
75 dnl End of "$Id$".
76 dnl