]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - config-scripts/cups-defaults.m4
Merge changes from CUPS 1.4svn-r7932.
[thirdparty/cups.git] / config-scripts / cups-defaults.m4
index ea23bd5c36775de27f8c2ccadb02d005fcd35ee0..b3ce770478cf1b57a0062c236ce2440b5259b35e 100644 (file)
@@ -1,42 +1,34 @@
 dnl
-dnl "$Id: cups-defaults.m4 5643 2006-06-07 20:58:29Z mike $"
+dnl "$Id: cups-defaults.m4 7649 2008-06-16 17:46:57Z mike $"
 dnl
 dnl   Default cupsd configuration settings for the Common UNIX Printing System
 dnl   (CUPS).
 dnl
-dnl   Copyright 2006 by Easy Software Products, all rights reserved.
+dnl   Copyright 2007-2008 by Apple Inc.
+dnl   Copyright 2006-2007 by Easy Software Products, all rights reserved.
 dnl
 dnl   These coded instructions, statements, and computer programs are the
-dnl   property of Easy Software Products and are protected by Federal
-dnl   copyright law.  Distribution and use rights are outlined in the file
-dnl   "LICENSE.txt" which should have been included with this file.  If this
-dnl   file is missing or damaged please contact Easy Software Products
-dnl   at:
-dnl
-dnl       Attn: CUPS Licensing Information
-dnl       Easy Software Products
-dnl       44141 Airport View Drive, Suite 204
-dnl       Hollywood, Maryland 20636 USA
-dnl
-dnl       Voice: (301) 373-9600
-dnl       EMail: cups-info@cups.org
-dnl         WWW: http://www.cups.org
+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
 
-dnl Default langugages...
-AC_ARG_WITH(languages, [  --with-languages        set installed languages, default="es ja" ],
-       LANGUAGES="$withval",
-       LANGUAGES="es ja pl sv")
+dnl Default languages...
+LANGUAGES="`ls -1 locale/cups_*.po | sed -e '1,$s/locale\/cups_//' -e '1,$s/\.po//' | tr '\n' ' '`"
+
+AC_ARG_WITH(languages, [  --with-languages        set installed languages, default=all ],[
+       case "$withval" in
+               none | no) LANGUAGES="" ;;
+               all) ;;
+               *) LANGUAGES="$withval" ;;
+       esac])
 AC_SUBST(LANGUAGES)
 
 dnl Default ConfigFilePerm
 AC_ARG_WITH(config_file_perm, [  --with-config-file-perm set default ConfigFilePerm value, default=0640],
        CUPS_CONFIG_FILE_PERM="$withval",
-       if test "x$uname" = xDarwin; then
-               CUPS_CONFIG_FILE_PERM="644"
-       else
-               CUPS_CONFIG_FILE_PERM="640"
-       fi)
+       CUPS_CONFIG_FILE_PERM="640")
 AC_SUBST(CUPS_CONFIG_FILE_PERM)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_CONFIG_FILE_PERM, 0$CUPS_CONFIG_FILE_PERM)
 
@@ -47,6 +39,28 @@ AC_ARG_WITH(log_file_perm, [  --with-log-file-perm    set default LogFilePerm va
 AC_SUBST(CUPS_LOG_FILE_PERM)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_FILE_PERM, 0$CUPS_LOG_FILE_PERM)
 
+dnl Default FatalErrors
+AC_ARG_WITH(fatal_errors, [  --with-fatal-errors set default FatalErrors value, default=config],
+       CUPS_FATAL_ERRORS="$withval",
+       CUPS_FATAL_ERRORS="config")
+AC_SUBST(CUPS_FATAL_ERRORS)
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_FATAL_ERRORS, "$CUPS_FATAL_ERRORS")
+
+
+dnl Default LogLevel
+AC_ARG_WITH(log_level, [  --with-log-level        set default LogLevel value, default=warn],
+       CUPS_LOG_LEVEL="$withval",
+       CUPS_LOG_LEVEL="warn")
+AC_SUBST(CUPS_LOG_LEVEL)
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_LEVEL, "$CUPS_LOG_LEVEL")
+
+dnl Default AccessLogLevel
+AC_ARG_WITH(access_log_level, [  --with-access-log-level set default AccessLogLevel value, default=actions],
+       CUPS_ACCESS_LOG_LEVEL="$withval",
+       CUPS_ACCESS_LOG_LEVEL="actions")
+AC_SUBST(CUPS_ACCESS_LOG_LEVEL)
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_ACCESS_LOG_LEVEL, "$CUPS_ACCESS_LOG_LEVEL")
+
 dnl Default Browsing
 AC_ARG_ENABLE(browsing, [  --enable-browsing       enable Browsing by default, default=yes])
 if test "x$enable_browsing" = xno; then
@@ -60,16 +74,46 @@ AC_SUBST(CUPS_BROWSING)
 
 dnl Default BrowseLocalProtocols
 AC_ARG_WITH(local_protocols, [  --with-local-protocols  set default BrowseLocalProtocols, default="CUPS"],
-       CUPS_BROWSE_LOCAL_PROTOCOLS="$withval",
-       CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS")
+       default_local_protocols="$withval",
+       default_local_protocols="default")
+
+if test x$with_local_protocols != xno; then
+       if test "x$default_local_protocols" = "xdefault"; then
+               if test "x$DNSSDLIBS" != "x"; then
+               CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS dnssd"
+       else
+               CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS"
+               fi
+       else
+               CUPS_BROWSE_LOCAL_PROTOCOLS="$default_local_protocols"
+       fi
+else
+       CUPS_BROWSE_LOCAL_PROTOCOLS=""
+fi
+
 AC_SUBST(CUPS_BROWSE_LOCAL_PROTOCOLS)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS,
        "$CUPS_BROWSE_LOCAL_PROTOCOLS")
 
 dnl Default BrowseRemoteProtocols
 AC_ARG_WITH(remote_protocols, [  --with-remote-protocols set default BrowseRemoteProtocols, default="CUPS"],
-       CUPS_BROWSE_REMOTE_PROTOCOLS="$withval",
-       CUPS_BROWSE_REMOTE_PROTOCOLS="CUPS")
+       default_remote_protocols="$withval",
+       default_remote_protocols="default")
+
+if test x$with_remote_protocols != xno; then
+       if test "x$default_remote_protocols" = "xdefault"; then
+               if test "$uname" = "Darwin" -a $uversion -ge 90; then
+                       CUPS_BROWSE_REMOTE_PROTOCOLS=""
+               else
+                       CUPS_BROWSE_REMOTE_PROTOCOLS="CUPS"
+               fi
+       else
+               CUPS_BROWSE_REMOTE_PROTOCOLS="$default_remote_protocols"
+       fi
+else
+       CUPS_BROWSE_REMOTE_PROTOCOLS=""
+fi
+
 AC_SUBST(CUPS_BROWSE_REMOTE_PROTOCOLS)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_REMOTE_PROTOCOLS,
        "$CUPS_BROWSE_REMOTE_PROTOCOLS")
@@ -110,11 +154,11 @@ fi
 AC_SUBST(CUPS_IMPLICIT_CLASSES)
 
 dnl Default UseNetworkDefault
-AC_ARG_ENABLE(network_default, [  --enable-use-network-default
+AC_ARG_ENABLE(use_network_default, [  --enable-use-network-default
                           enable UseNetworkDefault by default, default=auto])
-if test "x$enable_network_default" != xno; then
+if test "x$enable_use_network_default" != xno; then
        AC_MSG_CHECKING(whether to use network default printers)
-       if test "x$enable_network_default" = xyes -o $uname != Darwin; then
+       if test "x$enable_use_network_default" = xyes -o $uname != Darwin; then
                CUPS_USE_NETWORK_DEFAULT="Yes"
                AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USE_NETWORK_DEFAULT, 1)
                AC_MSG_RESULT(yes)
@@ -133,7 +177,14 @@ dnl Determine the correct username and group for this OS...
 AC_ARG_WITH(cups_user, [  --with-cups-user        set default user for CUPS],
        CUPS_USER="$withval",
        AC_MSG_CHECKING(for default print user)
-       if test -f /etc/passwd; then
+       if test x$uname = xDarwin; then
+               if test x`id -u _lp 2>/dev/null` = x; then
+                       CUPS_USER="lp";
+               else
+                       CUPS_USER="_lp";
+               fi
+               AC_MSG_RESULT($CUPS_USER)
+       elif test -f /etc/passwd; then
                CUPS_USER=""
                for user in lp lpd guest daemon nobody; do
                        if test "`grep \^${user}: /etc/passwd`" != ""; then
@@ -155,8 +206,15 @@ AC_ARG_WITH(cups_user, [  --with-cups-user        set default user for CUPS],
 AC_ARG_WITH(cups_group, [  --with-cups-group       set default group for CUPS],
        CUPS_GROUP="$withval",
        AC_MSG_CHECKING(for default print group)
-       if test -f /etc/group; then
-               GROUP_LIST="lp nobody"
+       if test x$uname = xDarwin; then
+               if test x`id -g _lp 2>/dev/null` = x; then
+                       CUPS_GROUP="lp";
+               else
+                       CUPS_GROUP="_lp";
+               fi
+               AC_MSG_RESULT($CUPS_GROUP)
+       elif test -f /etc/group; then
+               GROUP_LIST="_lp lp nobody"
                CUPS_GROUP=""
                for group in $GROUP_LIST; do
                        if test "`grep \^${group}: /etc/group`" != ""; then
@@ -178,35 +236,35 @@ AC_ARG_WITH(cups_group, [  --with-cups-group       set default group for CUPS],
 AC_ARG_WITH(system_groups, [  --with-system-groups    set default system groups for CUPS],
        CUPS_SYSTEM_GROUPS="$withval",
        if test x$uname = xDarwin; then
-               GROUP_LIST="admin"
+               CUPS_SYSTEM_GROUPS="admin"
        else
-               GROUP_LIST="lpadmin sys system root"
-       fi
-
-       AC_MSG_CHECKING(for default system groups)
-       if test -f /etc/group; then
-               CUPS_SYSTEM_GROUPS=""
-               for group in $GROUP_LIST; do
-                       if test "`grep \^${group}: /etc/group`" != ""; then
-                               if test "x$CUPS_SYSTEM_GROUPS" = x; then
-                                       CUPS_SYSTEM_GROUPS="$group"
-                               else
-                                       CUPS_SYSTEM_GROUPS="$CUPS_SYSTEM_GROUPS $group"
+               AC_MSG_CHECKING(for default system groups)
+               if test -f /etc/group; then
+                       CUPS_SYSTEM_GROUPS=""
+                       GROUP_LIST="lpadmin sys system root"
+                       for group in $GROUP_LIST; do
+                               if test "`grep \^${group}: /etc/group`" != ""; then
+                                       if test "x$CUPS_SYSTEM_GROUPS" = x; then
+                                               CUPS_SYSTEM_GROUPS="$group"
+                                       else
+                                               CUPS_SYSTEM_GROUPS="$CUPS_SYSTEM_GROUPS $group"
+                                       fi
                                fi
-                       fi
-               done
+                       done
 
-               if test "x$CUPS_SYSTEM_GROUPS" = x; then
-                       CUPS_SYSTEM_GROUPS="$GROUP_LIST"
-                       AC_MSG_RESULT(no groups found, using "$CUPS_SYSTEM_GROUPS")
+                       if test "x$CUPS_SYSTEM_GROUPS" = x; then
+                               CUPS_SYSTEM_GROUPS="$GROUP_LIST"
+                               AC_MSG_RESULT(no groups found, using "$CUPS_SYSTEM_GROUPS")
+                       else
+                               AC_MSG_RESULT("$CUPS_SYSTEM_GROUPS")
+                       fi
                else
-                       AC_MSG_RESULT("$CUPS_SYSTEM_GROUPS")
+                       CUPS_SYSTEM_GROUPS="$GROUP_LIST"
+                       AC_MSG_RESULT(no group file, using "$CUPS_SYSTEM_GROUPS")
                fi
-       else
-               CUPS_SYSTEM_GROUPS="$GROUP_LIST"
-               AC_MSG_RESULT(no group file, using "$CUPS_SYSTEM_GROUPS")
        fi)
 
+
 CUPS_PRIMARY_SYSTEM_GROUP="`echo $CUPS_SYSTEM_GROUPS | awk '{print $1}'`"
 
 AC_SUBST(CUPS_USER)
@@ -223,7 +281,7 @@ AC_ARG_WITH(printcap, [  --with-printcap         set default printcap file],
        default_printcap="$withval",
        default_printcap="default")
 
-if test x$enable_printcap != xno -a x$default_printcap != xno; then
+if test x$default_printcap != xno; then
        if test "x$default_printcap" = "xdefault"; then
                case $uname in
                        Darwin*)
@@ -240,6 +298,8 @@ if test x$enable_printcap != xno -a x$default_printcap != xno; then
                                CUPS_DEFAULT_PRINTCAP="/etc/printcap"
                                ;;
                esac
+       else
+               CUPS_DEFAULT_PRINTCAP="$default_printcap"
        fi
 else
        CUPS_DEFAULT_PRINTCAP=""
@@ -247,6 +307,111 @@ fi
 
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
 
+dnl Default LPD config file...
+AC_ARG_WITH(lpdconfigfile, [  --with-lpdconfigfile    set default LPDConfigFile URI],
+       default_lpdconfigfile="$withval",
+       default_lpdconfigfile="default")
+
+if test x$default_lpdconfigfile != xno; then
+       if test "x$default_lpdconfigfile" = "xdefault"; then
+               case $uname in
+                       Darwin*)
+                               CUPS_DEFAULT_LPD_CONFIG_FILE="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
+                               ;;
+                       *)
+                               if test -d /etc/xinetd.d; then
+                                       CUPS_DEFAULT_LPD_CONFIG_FILE="xinetd:///etc/xinetd.d/cups-lpd"
+                               else
+                                       CUPS_DEFAULT_LPD_CONFIG_FILE=""
+                               fi
+                               ;;
+               esac
+       else
+               CUPS_DEFAULT_LPD_CONFIG_FILE="$default_lpdconfigfile"
+       fi
+else
+       CUPS_DEFAULT_LPD_CONFIG_FILE=""
+fi
+
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG_FILE, "$CUPS_DEFAULT_LPD_CONFIG_FILE")
+
+dnl Default SMB config file...
+AC_ARG_WITH(smbconfigfile, [  --with-smbconfigfile    set default SMBConfigFile URI],
+       default_smbconfigfile="$withval",
+       default_smbconfigfile="default")
+
+if test x$default_smbconfigfile != xno; then
+       if test "x$default_smbconfigfile" = "xdefault"; then
+               if test -f /etc/smb.conf; then
+                       CUPS_DEFAULT_SMB_CONFIG_FILE="samba:///etc/smb.conf"
+               else
+                       CUPS_DEFAULT_SMB_CONFIG_FILE=""
+               fi
+       else
+               CUPS_DEFAULT_SMB_CONFIG_FILE="$default_smbconfigfile"
+       fi
+else
+       CUPS_DEFAULT_SMB_CONFIG_FILE=""
+fi
+
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG_FILE, "$CUPS_DEFAULT_SMB_CONFIG_FILE")
+
+dnl Default MaxCopies value...
+AC_ARG_WITH(max-copies, [  --with-max-copies       set default max copies value, default=auto ],
+       CUPS_MAX_COPIES="$withval",
+       if test "x$uname" = xDarwin; then
+               CUPS_MAX_COPIES="9999"
+       else
+               CUPS_MAX_COPIES="100"
+       fi)
+
+AC_SUBST(CUPS_MAX_COPIES)
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_MAX_COPIES, $CUPS_MAX_COPIES)
+
+dnl Default raw printing state
+AC_ARG_ENABLE(raw_printing, [  --enable-raw-printing   enable raw printing by default, default=auto])
+if test "x$enable_raw_printing" != xno; then
+       AC_MSG_CHECKING(whether to enable raw printing)
+       if test "x$enable_raw_printing" = xyes -o $uname = Darwin; then
+               DEFAULT_RAW_PRINTING=""
+               AC_MSG_RESULT(yes)
+       else
+               DEFAULT_RAW_PRINTING="#"
+               AC_MSG_RESULT(no)
+       fi
+else
+       DEFAULT_RAW_PRINTING="#"
+fi
+AC_SUBST(DEFAULT_RAW_PRINTING)
+
+dnl Default SNMP options...
+AC_ARG_WITH(snmp-address, [  --with-snmp-address     set SNMP query address, default=auto ],
+       if test "x$withval" = x; then
+               CUPS_SNMP_ADDRESS=""
+       else
+               CUPS_SNMP_ADDRESS="Address $withval"
+       fi,
+       if test "x$uname" = xDarwin; then
+               CUPS_SNMP_ADDRESS=""
+       else
+               CUPS_SNMP_ADDRESS="Address @LOCAL"
+       fi)
+
+AC_ARG_WITH(snmp-community, [  --with-snmp-community   set SNMP community, default=public ],
+       CUPS_SNMP_COMMUNITY="Community $withval",
+       CUPS_SNMP_COMMUNITY="Community public")
+
+AC_SUBST(CUPS_SNMP_ADDRESS)
+AC_SUBST(CUPS_SNMP_COMMUNITY)
+
+dnl New default port definition for IPP...
+AC_ARG_WITH(ipp-port, [  --with-ipp-port         set default port number for IPP ],
+       DEFAULT_IPP_PORT="$withval",
+       DEFAULT_IPP_PORT="631")
+
+AC_SUBST(DEFAULT_IPP_PORT)
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
+
 dnl
-dnl End of "$Id: cups-defaults.m4 5643 2006-06-07 20:58:29Z mike $".
+dnl End of "$Id: cups-defaults.m4 7649 2008-06-16 17:46:57Z mike $".
 dnl