]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Modernize cups-startup.m4.
authorMichael R Sweet <msweet@msweet.org>
Sun, 7 Mar 2021 00:40:18 +0000 (19:40 -0500)
committerMichael R Sweet <msweet@msweet.org>
Sun, 7 Mar 2021 00:40:18 +0000 (19:40 -0500)
config-scripts/cups-startup.m4
configure

index 099d46b036f9a3548f9f1fe0291d5161b7869310..c20830a395fa201b3b9a3c12d2143e8af1d9f9e3 100644 (file)
 dnl
 dnl Launch-on-demand/startup stuff for CUPS.
 dnl
-dnl Copyright 2007-2017 by Apple Inc.
-dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
+dnl Copyright © 2021 by OpenPrinting.
+dnl Copyright © 2007-2017 by Apple Inc.
+dnl Copyright © 1997-2005 by Easy Software Products, all rights reserved.
 dnl
-dnl Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+dnl Licensed under Apache License v2.0.  See the file "LICENSE" for more
+dnl information.
 dnl
 
 ONDEMANDFLAGS=""
 ONDEMANDLIBS=""
-AC_SUBST(ONDEMANDFLAGS)
-AC_SUBST(ONDEMANDLIBS)
+AC_SUBST([ONDEMANDFLAGS])
+AC_SUBST([ONDEMANDLIBS])
+
+AC_ARG_WITH([ondemand], AS_HELP_STRING([--with-ondemand=...], [Specify the on-demand launch interface (launchd, systemd, upstart)]))
+
+AS_IF([test "x$with_ondemand" = x], [
+    AS_IF([test $host_os_name = darwin], [
+        with_ondemand="launchd"
+    ], [
+       with_ondemand="yes"
+    ])
+], [test "x$with_ondemand" = xyes -a $host_os_name = darwin], [
+    with_ondemand="launchd"
+], [test "x$with_ondemand" != xno -a "x$with_ondemand" != xsystemd -a "x$with_ondemand" != xupstart -a "x$with_ondemand" != xyes], [
+    AC_MSG_ERROR([Unknown --with-ondemand value "$with_ondemand" specified.])
+])
 
 dnl Launchd is used on macOS/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_activate_socket, [
-               AC_DEFINE(HAVE_LAUNCHD)
-               AC_DEFINE(HAVE_ONDEMAND)])
-       AC_CHECK_HEADER(launch.h, AC_DEFINE(HAVE_LAUNCH_H))
-
-       if test "$host_os_name" = darwin; then
-               LAUNCHD_DIR="/System/Library/LaunchDaemons"
-               # liblaunch is already part of libSystem
-       fi
-fi
+AC_SUBST([LAUNCHD_DIR])
+
+AS_IF([test $with_ondemand = launchd], [
+    AC_CHECK_FUNC([launch_activate_socket], [
+       AC_DEFINE([HAVE_LAUNCHD], [1], [Have launchd support?])
+       AC_DEFINE([HAVE_ONDEMAND], [1], [Have on-demand launch support?])
+        with_ondemand="launchd"
+    ], [
+        AS_IF([test $with_ondemand = launchd], [
+            AC_MSG_ERROR([Need launch_activate_socket/liblaunch for launchd support.])
+        ])
+    ])
+    AC_CHECK_HEADER([launch.h], [
+        AC_DEFINE([HAVE_LAUNCH_H], [1], [Have <launch.h> header?])
+    ])
+
+    AS_IF([test $host_os_name = darwin], [
+       LAUNCHD_DIR="/System/Library/LaunchDaemons"
+       # liblaunch is already part of libSystem
+    ])
+])
 
 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
-               have_systemd=no
-               AC_MSG_CHECKING(for libsystemd)
-                if $PKGCONFIG --exists libsystemd; then
-                        AC_MSG_RESULT(yes)
-                        have_systemd=yes
-                        ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd`
-                        ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd`
-               elif $PKGCONFIG --exists libsystemd-daemon; then
-                       AC_MSG_RESULT(yes - legacy)
-                        have_systemd=yes
-                       ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
-                       ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
-
-                       if $PKGCONFIG --exists libsystemd-journal; then
-                               ONDEMANDFLAGS="$ONDEMANDFLAGS `$PKGCONFIG --cflags libsystemd-journal`"
-                               ONDEMANDLIBS="$ONDEMANDLIBS `$PKGCONFIG --libs libsystemd-journal`"
-                       fi
-                else
-                        AC_MSG_RESULT(no)
-                fi
-
-               if test $have_systemd = yes; then
-                        AC_DEFINE(HAVE_SYSTEMD)
-                        AC_DEFINE(HAVE_ONDEMAND)
-                       AC_CHECK_HEADER(systemd/sd-journal.h,AC_DEFINE(HAVE_SYSTEMD_SD_JOURNAL_H))
-                       if test "x$SYSTEMD_DIR" = x; then
-                               SYSTEMD_DIR="`$PKGCONFIG --variable=systemdsystemunitdir systemd`"
-                        fi
-                fi
-        fi
-fi
-
-dnl Upstart is also used on Linux (e.g., Chrome OS)
-AC_ARG_ENABLE(upstart, [  --enable-upstart        enable upstart support])
-if test "x$enable_upstart" = "xyes"; then
-       if test "x$have_systemd" = "xyes"; then
-               AC_MSG_ERROR(Cannot support both systemd and upstart.)
-       fi
-       AC_DEFINE(HAVE_UPSTART)
-       AC_DEFINE(HAVE_ONDEMAND)
-fi
+AC_ARG_WITH([systemd], AS_HELP_STRING([--with-systemd], [set directory for systemd service files]), [
+    SYSTEMD_DIR="$withval"
+], [
+    SYSTEMD_DIR=""
+])
+AC_SUBST([SYSTEMD_DIR])
+
+AS_IF([test $with_ondemand = systemd -o $with_ondemand = yes], [
+    AS_IF([test "x$PKGCONFIG" = x], [
+       AS_IF([test $with_ondemand = systemd], [
+           AC_MSG_ERROR([Need pkg-config to enable systemd support.])
+       ])
+    ], [
+       AC_MSG_CHECKING([for libsystemd])
+       have_systemd="no"
+       AS_IF([$PKGCONFIG --exists libsystemd], [
+           AC_MSG_RESULT([yes])
+           have_systemd="yes"
+           with_ondemand="systemd"
+           ONDEMANDFLAGS="$($PKGCONFIG --cflags libsystemd)"
+           ONDEMANDLIBS="$($PKGCONFIG --libs libsystemd)"
+       ], [$PKGCONFIG --exists libsystemd-daemon], [
+           AC_MSG_RESULT([yes - legacy])
+           have_systemd="yes"
+           with_ondemand="systemd"
+           ONDEMANDFLAGS="$($PKGCONFIG --cflags libsystemd-daemon)"
+           ONDEMANDLIBS="$($PKGCONFIG --libs libsystemd-daemon)"
+
+           AS_IF([$PKGCONFIG --exists libsystemd-journal], [
+               ONDEMANDFLAGS="$ONDEMANDFLAGS $($PKGCONFIG --cflags libsystemd-journal)"
+               ONDEMANDLIBS="$ONDEMANDLIBS $($PKGCONFIG --libs libsystemd-journal)"
+           ])
+       ], [
+           AC_MSG_RESULT([no])
+       ])
+
+       AS_IF([test $have_system = yes], [
+           AC_DEFINE([HAVE_SYSTEMD], [1], [Have systemd support?])
+           AC_DEFINE([HAVE_ONDEMAND], [1], [Have on-demand launch support?])
+           AC_CHECK_HEADER([systemd/sd-journal.h], [
+               AC_DEFINE([HAVE_SYSTEMD_SD_JOURNAL_H], [1], [Have <systemd/sd-journal.h> header?])
+           ])
+           AS_IF([test "x$SYSTEMD_DIR" = x], [
+               SYSTEMD_DIR="$($PKGCONFIG --variable=systemdsystemunitdir systemd)"
+           ])
+       ])
+    ])
+])
+
+dnl Upstart is also used on Linux (e.g., ChromeOS)
+AS_IF([test $with_ondemand = upstart], [
+    AC_DEFINE([HAVE_UPSTART]. [1], [Have upstart support?])
+    AC_DEFINE([HAVE_ONDEMAND], [1], [Have on-demand launch support?])
+])
 
 dnl Solaris uses smf
-SMFMANIFESTDIR=""
-AC_SUBST(SMFMANIFESTDIR)
-AC_ARG_WITH(smfmanifestdir, [  --with-smfmanifestdir   set path for Solaris SMF manifest],SMFMANIFESTDIR="$withval")
+AC_ARG_WITH([smfmanifestdir], AS_HELP_STRING([--with-smfmanifestdir], [set path for Solaris SMF manifest]), [
+    SMFMANIFESTDIR="$withval"
+], [
+    SMFMANIFESTDIR=""
+])
+AC_SUBST([SMFMANIFESTDIR])
 
 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 "$host_os_name" in
-               linux* | gnu*)
-                       # Linux
-                        rcstart="81"
-                       ;;
-
-               sunos*)
-                       # Solaris
-                        rcstart="81"
-                       ;;
-
-                *)
-                        # Others
-                        rcstart="99"
-                        ;;
-       esac
-fi
-
-if test "x$rcstop" = x; then
-       case "$host_os_name" in
-               linux* | gnu*)
-                       # Linux
-                        rcstop="36"
-                       ;;
-
-                *)
-                        # Others
-                        rcstop="00"
-                        ;;
-       esac
-fi
+AC_ARG_WITH([rcdir], AS_HELP_STRING([--with-rcdir], [set path for rc scripts]), [
+    rcdir="$withval"
+], [
+    rcdir=""
+])
+AC_ARG_WITH([rclevels], AS_HELP_STRING([--with-rclevels], [set run levels for rc scripts]), [
+    rclevels="$withval"
+], [
+    rclevels="2 3 5"
+])
+AC_ARG_WITH([rcstart], AS_HELP_STRING([--with-rcstart], [set start number for rc scripts]), [
+    rcstart="$withval"
+], [
+    rcstart=""
+])
+AC_ARG_WITH([rcstop], AS_HELP_STRING([--with-rcstop], [set stop number for rc scripts]), [
+    rcstop="$withval"
+], [
+    rcstop=""
+])
+
+AS_IF([test "x$rcdir" = x], [
+    AS_IF([test "x$LAUNCHD_DIR" = x -a "x$SYSTEMD_DIR" = x -a "x$SMFMANIFESTDIR" = x], [
+       # Fall back on "init", the original service startup interface...
+       AS_IF([test -d /sbin/init.d], [
+           # SuSE
+           rcdir="/sbin/init.d"
+       ], [test -d /etc/init.d], [
+           # Others
+           rcdir="/etc"
+       ], [
+           # RedHat, NetBSD
+           rcdir="/etc/rc.d"
+       ])
+    ], [
+       rcdir="no"
+    ])
+])
+
+AS_IF([test "x$rcstart" = x], [
+    AS_CASE(["$host_os_name"], [linux* | gnu*], [
+       # Linux
+       rcstart="81"
+    ], [sunos*], [
+       # Solaris
+       rcstart="81"
+    ], [*], [
+       # Others
+       rcstart="99"
+    ])
+])
+
+AS_IF([test "x$rcstop" = x], [
+    AS_CASE(["$host_os_name"], [linux* | gnu*], [
+       # Linux
+       rcstop="36"
+    ], [*], [
+       # Others
+       rcstop="00"
+    ])
+])
 
 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
+AC_SUBST([INITDIR])
+AC_SUBST([INITDDIR])
+AC_SUBST([RCLEVELS])
+AC_SUBST([RCSTART])
+AC_SUBST([RCSTOP])
+
+AS_IF([test "x$rcdir" != xno], [
+    AS_IF([test "x$rclevels" = x], [
+       INITDDIR="$rcdir"
+    ], [
+       INITDIR="$rcdir"
+    ])
+])
 
 dnl Xinetd support...
-AC_ARG_WITH(xinetd, [  --with-xinetd           set path for xinetd config files],xinetd="$withval",xinetd="")
+AC_ARG_WITH([xinetd], AS_HELP_STRING([--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$xinetd" != xno; then
-       XINETD="$xinetd"
-fi
+AC_SUBST([XINETD])
+
+AS_IF([test "x$xinetd" = x], [
+    AS_IF([test ! -x /sbin/launchd], [
+       for dir in /etc/xinetd.d /usr/local/etc/xinetd.d; do
+           AS_IF([test -d $dir], [
+               XINETD="$dir"
+               break
+           ])
+       done
+    ])
+], [test "x$xinetd" != xno], [
+    XINETD="$xinetd"
+])
index 23af8ca47a7e4047fd33d7b6b91bca8346c8a4ca..67807d18ff58f688fa7ff1ae73a961500dd708da 100755 (executable)
--- a/configure
+++ b/configure
@@ -902,10 +902,8 @@ enable_snapped_cupsd
 enable_snapped_clients
 with_snapctl
 with_cups_control_slot
-enable_launchd
-enable_systemd
+with_ondemand
 with_systemd
-enable_upstart
 with_smfmanifestdir
 with_rcdir
 with_rclevels
@@ -1599,9 +1597,6 @@ Optional Features:
   --enable-snapped-clients
                           enable support for CUPS controlling admin access
                           from snapped clients
-  --disable-launchd       disable launchd support
-  --disable-systemd       disable systemd support
-  --enable-upstart        enable upstart support
   --enable-page-logging   enable page_log by default
   --enable-sync-on-close  enable SyncOnClose (off by default)
   --disable-browsing      disable Browsing by default
@@ -1645,6 +1640,8 @@ Optional Packages:
                           Name for cups-control slot as defined in
                           snapcraft.yaml, only needed with
                           --enable-snapped-cupsd, default=admin
+  --with-ondemand=...     Specify the on-demand launch interface (launchd,
+                          systemd, upstart)
   --with-systemd          set directory for systemd service files
   --with-smfmanifestdir   set path for Solaris SMF manifest
   --with-rcdir            set path for rc scripts
@@ -11040,219 +11037,346 @@ ONDEMANDLIBS=""
 
 
 
-# Check whether --enable-launchd was given.
-if test ${enable_launchd+y}
+
+# Check whether --with-ondemand was given.
+if test ${with_ondemand+y}
 then :
-  enableval=$enable_launchd;
+  withval=$with_ondemand;
+fi
+
+
+if test "x$with_ondemand" = x
+then :
+
+    if test $host_os_name = darwin
+then :
+
+        with_ondemand="launchd"
+
+else $as_nop
+
+       with_ondemand="yes"
+
+fi
+
+elif test "x$with_ondemand" = xyes -a $host_os_name = darwin
+then :
+
+    with_ondemand="launchd"
+
+elif test "x$with_ondemand" != xno -a "x$with_ondemand" != xsystemd -a "x$with_ondemand" != xupstart -a "x$with_ondemand" != xyes
+then :
+
+    as_fn_error $? "Unknown --with-ondemand value \"$with_ondemand\" specified." "$LINENO" 5
+
 fi
 
 LAUNCHD_DIR=""
 
 
-if test x$enable_launchd != xno; then
-       ac_fn_c_check_func "$LINENO" "launch_activate_socket" "ac_cv_func_launch_activate_socket"
+if test $with_ondemand = launchd
+then :
+
+    ac_fn_c_check_func "$LINENO" "launch_activate_socket" "ac_cv_func_launch_activate_socket"
 if test "x$ac_cv_func_launch_activate_socket" = xyes
 then :
 
-               printf "%s\n" "#define HAVE_LAUNCHD 1" >>confdefs.h
 
-               printf "%s\n" "#define HAVE_ONDEMAND 1" >>confdefs.h
+printf "%s\n" "#define HAVE_LAUNCHD 1" >>confdefs.h
+
+
+printf "%s\n" "#define HAVE_ONDEMAND 1" >>confdefs.h
+
+        with_ondemand="launchd"
+
+else $as_nop
+
+        if test $with_ondemand = launchd
+then :
+
+            as_fn_error $? "Need launch_activate_socket/liblaunch for launchd support." "$LINENO" 5
 
 fi
 
-       ac_fn_c_check_header_compile "$LINENO" "launch.h" "ac_cv_header_launch_h" "$ac_includes_default"
+fi
+
+    ac_fn_c_check_header_compile "$LINENO" "launch.h" "ac_cv_header_launch_h" "$ac_includes_default"
 if test "x$ac_cv_header_launch_h" = xyes
 then :
-  printf "%s\n" "#define HAVE_LAUNCH_H 1" >>confdefs.h
 
-fi
+
+printf "%s\n" "#define HAVE_LAUNCH_H 1" >>confdefs.h
 
 
-       if test "$host_os_name" = darwin; then
-               LAUNCHD_DIR="/System/Library/LaunchDaemons"
-               # liblaunch is already part of libSystem
-       fi
 fi
 
-# Check whether --enable-systemd was given.
-if test ${enable_systemd+y}
+
+    if test $host_os_name = darwin
 then :
-  enableval=$enable_systemd;
+
+       LAUNCHD_DIR="/System/Library/LaunchDaemons"
+       # liblaunch is already part of libSystem
+
+fi
+
 fi
 
 
 # Check whether --with-systemd was given.
 if test ${with_systemd+y}
 then :
-  withval=$with_systemd; SYSTEMD_DIR="$withval"
+  withval=$with_systemd;
+    SYSTEMD_DIR="$withval"
+
 else $as_nop
-  SYSTEMD_DIR=""
+
+    SYSTEMD_DIR=""
+
 fi
 
 
 
-if test x$enable_systemd != xno; then
-       if test "x$PKGCONFIG" = x; then
-               if test x$enable_systemd = xyes; then
-                       as_fn_error $? "Need pkg-config to enable systemd support." "$LINENO" 5
-                fi
-        else
-               have_systemd=no
-               { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsystemd" >&5
+if test $with_ondemand = systemd -o $with_ondemand = yes
+then :
+
+    if test "x$PKGCONFIG" = x
+then :
+
+       if test $with_ondemand = systemd
+then :
+
+           as_fn_error $? "Need pkg-config to enable systemd support." "$LINENO" 5
+
+fi
+
+else $as_nop
+
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsystemd" >&5
 printf %s "checking for libsystemd... " >&6; }
-                if $PKGCONFIG --exists libsystemd; then
-                        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+       have_systemd="no"
+       if $PKGCONFIG --exists libsystemd
+then :
+
+           { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 printf "%s\n" "yes" >&6; }
-                        have_systemd=yes
-                        ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd`
-                        ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd`
-               elif $PKGCONFIG --exists libsystemd-daemon; then
-                       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - legacy" >&5
+           have_systemd="yes"
+           with_ondemand="systemd"
+           ONDEMANDFLAGS="$($PKGCONFIG --cflags libsystemd)"
+           ONDEMANDLIBS="$($PKGCONFIG --libs libsystemd)"
+
+elif $PKGCONFIG --exists libsystemd-daemon
+then :
+
+           { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - legacy" >&5
 printf "%s\n" "yes - legacy" >&6; }
-                        have_systemd=yes
-                       ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
-                       ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
-
-                       if $PKGCONFIG --exists libsystemd-journal; then
-                               ONDEMANDFLAGS="$ONDEMANDFLAGS `$PKGCONFIG --cflags libsystemd-journal`"
-                               ONDEMANDLIBS="$ONDEMANDLIBS `$PKGCONFIG --libs libsystemd-journal`"
-                       fi
-                else
-                        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+           have_systemd="yes"
+           with_ondemand="systemd"
+           ONDEMANDFLAGS="$($PKGCONFIG --cflags libsystemd-daemon)"
+           ONDEMANDLIBS="$($PKGCONFIG --libs libsystemd-daemon)"
+
+           if $PKGCONFIG --exists libsystemd-journal
+then :
+
+               ONDEMANDFLAGS="$ONDEMANDFLAGS $($PKGCONFIG --cflags libsystemd-journal)"
+               ONDEMANDLIBS="$ONDEMANDLIBS $($PKGCONFIG --libs libsystemd-journal)"
+
+fi
+
+else $as_nop
+
+           { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
 printf "%s\n" "no" >&6; }
-                fi
 
-               if test $have_systemd = yes; then
-                        printf "%s\n" "#define HAVE_SYSTEMD 1" >>confdefs.h
+fi
 
-                        printf "%s\n" "#define HAVE_ONDEMAND 1" >>confdefs.h
+       if test $have_system = yes
+then :
+
+
+printf "%s\n" "#define HAVE_SYSTEMD 1" >>confdefs.h
 
-                       ac_fn_c_check_header_compile "$LINENO" "systemd/sd-journal.h" "ac_cv_header_systemd_sd_journal_h" "$ac_includes_default"
+
+printf "%s\n" "#define HAVE_ONDEMAND 1" >>confdefs.h
+
+           ac_fn_c_check_header_compile "$LINENO" "systemd/sd-journal.h" "ac_cv_header_systemd_sd_journal_h" "$ac_includes_default"
 if test "x$ac_cv_header_systemd_sd_journal_h" = xyes
 then :
-  printf "%s\n" "#define HAVE_SYSTEMD_SD_JOURNAL_H 1" >>confdefs.h
 
-fi
 
-                       if test "x$SYSTEMD_DIR" = x; then
-                               SYSTEMD_DIR="`$PKGCONFIG --variable=systemdsystemunitdir systemd`"
-                        fi
-                fi
-        fi
+printf "%s\n" "#define HAVE_SYSTEMD_SD_JOURNAL_H 1" >>confdefs.h
+
+
 fi
 
-# Check whether --enable-upstart was given.
-if test ${enable_upstart+y}
+           if test "x$SYSTEMD_DIR" = x
 then :
-  enableval=$enable_upstart;
+
+               SYSTEMD_DIR="$($PKGCONFIG --variable=systemdsystemunitdir systemd)"
+
 fi
 
-if test "x$enable_upstart" = "xyes"; then
-       if test "x$have_systemd" = "xyes"; then
-               as_fn_error $? "Cannot support both systemd and upstart." "$LINENO" 5
-       fi
-       printf "%s\n" "#define HAVE_UPSTART 1" >>confdefs.h
+fi
 
-       printf "%s\n" "#define HAVE_ONDEMAND 1" >>confdefs.h
+fi
 
 fi
 
-SMFMANIFESTDIR=""
+if test $with_ondemand = upstart
+then :
+
+    printf "%s\n" "#define HAVE_UPSTART. 1 Have upstart support?" >>confdefs.h
+
+
+printf "%s\n" "#define HAVE_ONDEMAND 1" >>confdefs.h
+
+
+fi
 
 
 # Check whether --with-smfmanifestdir was given.
 if test ${with_smfmanifestdir+y}
 then :
-  withval=$with_smfmanifestdir; SMFMANIFESTDIR="$withval"
+  withval=$with_smfmanifestdir;
+    SMFMANIFESTDIR="$withval"
+
+else $as_nop
+
+    SMFMANIFESTDIR=""
+
 fi
 
 
 
+
 # Check whether --with-rcdir was given.
 if test ${with_rcdir+y}
 then :
-  withval=$with_rcdir; rcdir="$withval"
+  withval=$with_rcdir;
+    rcdir="$withval"
+
 else $as_nop
-  rcdir=""
+
+    rcdir=""
+
 fi
 
 
 # Check whether --with-rclevels was given.
 if test ${with_rclevels+y}
 then :
-  withval=$with_rclevels; rclevels="$withval"
+  withval=$with_rclevels;
+    rclevels="$withval"
+
 else $as_nop
-  rclevels="2 3 5"
+
+    rclevels="2 3 5"
+
 fi
 
 
 # Check whether --with-rcstart was given.
 if test ${with_rcstart+y}
 then :
-  withval=$with_rcstart; rcstart="$withval"
+  withval=$with_rcstart;
+    rcstart="$withval"
+
 else $as_nop
-  rcstart=""
+
+    rcstart=""
+
 fi
 
 
 # Check whether --with-rcstop was given.
 if test ${with_rcstop+y}
 then :
-  withval=$with_rcstop; rcstop="$withval"
+  withval=$with_rcstop;
+    rcstop="$withval"
+
 else $as_nop
-  rcstop=""
+
+    rcstop=""
+
 fi
 
 
-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
+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 $as_nop
+
+           # RedHat, NetBSD
+           rcdir="/etc/rc.d"
+
 fi
 
-if test "x$rcstart" = x; then
-       case "$host_os_name" in
-               linux* | gnu*)
-                       # Linux
-                        rcstart="81"
-                       ;;
+else $as_nop
 
-               sunos*)
-                       # Solaris
-                        rcstart="81"
-                       ;;
+       rcdir="no"
 
-                *)
-                        # Others
-                        rcstart="99"
-                        ;;
-       esac
 fi
 
-if test "x$rcstop" = x; then
-       case "$host_os_name" in
-               linux* | gnu*)
-                       # Linux
-                        rcstop="36"
-                       ;;
+fi
+
+if test "x$rcstart" = x
+then :
+
+    case "$host_os_name" in #(
+  linux* | gnu*) :
+
+       # Linux
+       rcstart="81"
+     ;; #(
+  sunos*) :
+
+       # Solaris
+       rcstart="81"
+     ;; #(
+  *) :
+
+       # Others
+       rcstart="99"
+     ;; #(
+  *) :
+     ;;
+esac
+
+fi
+
+if test "x$rcstop" = x
+then :
+
+    case "$host_os_name" in #(
+  linux* | gnu*) :
+
+       # Linux
+       rcstop="36"
+     ;; #(
+  *) :
+
+       # Others
+       rcstop="00"
+     ;; #(
+  *) :
+     ;;
+esac
 
-                *)
-                        # Others
-                        rcstop="00"
-                        ;;
-       esac
 fi
 
 INITDIR=""
@@ -11266,37 +11390,61 @@ RCSTOP="$rcstop"
 
 
 
-if test "x$rcdir" != xno; then
-       if test "x$rclevels" = x; then
-               INITDDIR="$rcdir"
-       else
-               INITDIR="$rcdir"
-       fi
+if test "x$rcdir" != xno
+then :
+
+    if test "x$rclevels" = x
+then :
+
+       INITDDIR="$rcdir"
+
+else $as_nop
+
+       INITDIR="$rcdir"
+
+fi
+
 fi
 
 
 # Check whether --with-xinetd was given.
 if test ${with_xinetd+y}
 then :
-  withval=$with_xinetd; xinetd="$withval"
+  withval=$with_xinetd;
+    xinetd="$withval"
+
 else $as_nop
-  xinetd=""
+
+    xinetd=""
+
 fi
 
 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$xinetd" != xno; then
-       XINETD="$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$xinetd" != xno
+then :
+
+    XINETD="$xinetd"
+
 fi