]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-defaults.m4
Merge changes from CUPS 1.4svn-r7932.
[thirdparty/cups.git] / config-scripts / cups-defaults.m4
CommitLineData
09ec0018 1dnl
75bd9771 2dnl "$Id: cups-defaults.m4 7649 2008-06-16 17:46:57Z mike $"
09ec0018 3dnl
4dnl Default cupsd configuration settings for the Common UNIX Printing System
5dnl (CUPS).
6dnl
ac884b6a 7dnl Copyright 2007-2008 by Apple Inc.
b86bc4cf 8dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
09ec0018 9dnl
10dnl These coded instructions, statements, and computer programs are the
bc44d920 11dnl property of Apple Inc. and are protected by Federal copyright
12dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
13dnl which should have been included with this file. If this file is
14dnl file is missing or damaged, see the license at "http://www.cups.org/".
09ec0018 15dnl
16
bc44d920 17dnl Default languages...
dd1abb6b 18LANGUAGES="`ls -1 locale/cups_*.po | sed -e '1,$s/locale\/cups_//' -e '1,$s/\.po//' | tr '\n' ' '`"
bc44d920 19
20AC_ARG_WITH(languages, [ --with-languages set installed languages, default=all ],[
21 case "$withval" in
22 none | no) LANGUAGES="" ;;
23 all) ;;
24 *) LANGUAGES="$withval" ;;
25 esac])
e1d6a774 26AC_SUBST(LANGUAGES)
27
09ec0018 28dnl Default ConfigFilePerm
ed486911 29AC_ARG_WITH(config_file_perm, [ --with-config-file-perm set default ConfigFilePerm value, default=0640],
a4d04587 30 CUPS_CONFIG_FILE_PERM="$withval",
9f5eb9be 31 CUPS_CONFIG_FILE_PERM="640")
09ec0018 32AC_SUBST(CUPS_CONFIG_FILE_PERM)
a4d04587 33AC_DEFINE_UNQUOTED(CUPS_DEFAULT_CONFIG_FILE_PERM, 0$CUPS_CONFIG_FILE_PERM)
09ec0018 34
35dnl Default LogFilePerm
ed486911 36AC_ARG_WITH(log_file_perm, [ --with-log-file-perm set default LogFilePerm value, default=0644],
a4d04587 37 CUPS_LOG_FILE_PERM="$withval",
38 CUPS_LOG_FILE_PERM="644")
09ec0018 39AC_SUBST(CUPS_LOG_FILE_PERM)
a4d04587 40AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_FILE_PERM, 0$CUPS_LOG_FILE_PERM)
09ec0018 41
49d87452
MS
42dnl Default FatalErrors
43AC_ARG_WITH(fatal_errors, [ --with-fatal-errors set default FatalErrors value, default=config],
44 CUPS_FATAL_ERRORS="$withval",
45 CUPS_FATAL_ERRORS="config")
46AC_SUBST(CUPS_FATAL_ERRORS)
47AC_DEFINE_UNQUOTED(CUPS_DEFAULT_FATAL_ERRORS, "$CUPS_FATAL_ERRORS")
48
49
1f0275e3
MS
50dnl Default LogLevel
51AC_ARG_WITH(log_level, [ --with-log-level set default LogLevel value, default=warn],
52 CUPS_LOG_LEVEL="$withval",
53 CUPS_LOG_LEVEL="warn")
54AC_SUBST(CUPS_LOG_LEVEL)
55AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_LEVEL, "$CUPS_LOG_LEVEL")
56
57dnl Default AccessLogLevel
9f5eb9be
MS
58AC_ARG_WITH(access_log_level, [ --with-access-log-level set default AccessLogLevel value, default=actions],
59 CUPS_ACCESS_LOG_LEVEL="$withval",
60 CUPS_ACCESS_LOG_LEVEL="actions")
1f0275e3
MS
61AC_SUBST(CUPS_ACCESS_LOG_LEVEL)
62AC_DEFINE_UNQUOTED(CUPS_DEFAULT_ACCESS_LOG_LEVEL, "$CUPS_ACCESS_LOG_LEVEL")
63
09ec0018 64dnl Default Browsing
65AC_ARG_ENABLE(browsing, [ --enable-browsing enable Browsing by default, default=yes])
66if test "x$enable_browsing" = xno; then
67 CUPS_BROWSING="No"
68 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSING, 0)
69else
70 CUPS_BROWSING="Yes"
71 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSING, 1)
72fi
73AC_SUBST(CUPS_BROWSING)
74
75dnl Default BrowseLocalProtocols
ed486911 76AC_ARG_WITH(local_protocols, [ --with-local-protocols set default BrowseLocalProtocols, default="CUPS"],
f7deaa1a 77 default_local_protocols="$withval",
78 default_local_protocols="default")
79
80if test x$with_local_protocols != xno; then
81 if test "x$default_local_protocols" = "xdefault"; then
82 if test "x$DNSSDLIBS" != "x"; then
83 CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS dnssd"
84 else
85 CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS"
86 fi
87 else
88 CUPS_BROWSE_LOCAL_PROTOCOLS="$default_local_protocols"
89 fi
90else
91 CUPS_BROWSE_LOCAL_PROTOCOLS=""
92fi
93
09ec0018 94AC_SUBST(CUPS_BROWSE_LOCAL_PROTOCOLS)
95AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS,
a4d04587 96 "$CUPS_BROWSE_LOCAL_PROTOCOLS")
09ec0018 97
98dnl Default BrowseRemoteProtocols
ed486911 99AC_ARG_WITH(remote_protocols, [ --with-remote-protocols set default BrowseRemoteProtocols, default="CUPS"],
f7deaa1a 100 default_remote_protocols="$withval",
101 default_remote_protocols="default")
102
103if test x$with_remote_protocols != xno; then
104 if test "x$default_remote_protocols" = "xdefault"; then
105 if test "$uname" = "Darwin" -a $uversion -ge 90; then
106 CUPS_BROWSE_REMOTE_PROTOCOLS=""
107 else
108 CUPS_BROWSE_REMOTE_PROTOCOLS="CUPS"
109 fi
110 else
111 CUPS_BROWSE_REMOTE_PROTOCOLS="$default_remote_protocols"
112 fi
113else
114 CUPS_BROWSE_REMOTE_PROTOCOLS=""
115fi
116
09ec0018 117AC_SUBST(CUPS_BROWSE_REMOTE_PROTOCOLS)
118AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_REMOTE_PROTOCOLS,
a4d04587 119 "$CUPS_BROWSE_REMOTE_PROTOCOLS")
09ec0018 120
121dnl Default BrowseShortNames
122AC_ARG_ENABLE(browse_short, [ --enable-browse-short-names
123 enable BrowseShortNames by default, default=yes])
124if test "x$enable_browse_short" = xno; then
125 CUPS_BROWSE_SHORT_NAMES="No"
126 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_SHORT_NAMES, 0)
127else
128 CUPS_BROWSE_SHORT_NAMES="Yes"
129 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_SHORT_NAMES, 1)
130fi
131AC_SUBST(CUPS_BROWSE_SHORT_NAMES)
132
133dnl Default DefaultShared
134AC_ARG_ENABLE(default_shared, [ --enable-default-shared enable DefaultShared by default, default=yes])
135if test "x$enable_default_shared" = xno; then
136 CUPS_DEFAULT_SHARED="No"
137 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_DEFAULT_SHARED, 0)
138else
139 CUPS_DEFAULT_SHARED="Yes"
140 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_DEFAULT_SHARED, 1)
141fi
142AC_SUBST(CUPS_DEFAULT_SHARED)
143
144dnl Default ImplicitClasses
145AC_ARG_ENABLE(implicit, [ --enable-implicit-classes
146 enable ImplicitClasses by default, default=yes])
147if test "x$enable_implicit" = xno; then
148 CUPS_IMPLICIT_CLASSES="No"
149 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IMPLICIT_CLASSES, 0)
150else
151 CUPS_IMPLICIT_CLASSES="Yes"
152 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IMPLICIT_CLASSES, 1)
153fi
154AC_SUBST(CUPS_IMPLICIT_CLASSES)
155
e00b005a 156dnl Default UseNetworkDefault
09a101d6 157AC_ARG_ENABLE(use_network_default, [ --enable-use-network-default
e53920b9 158 enable UseNetworkDefault by default, default=auto])
09a101d6 159if test "x$enable_use_network_default" != xno; then
e53920b9 160 AC_MSG_CHECKING(whether to use network default printers)
09a101d6 161 if test "x$enable_use_network_default" = xyes -o $uname != Darwin; then
e53920b9 162 CUPS_USE_NETWORK_DEFAULT="Yes"
163 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USE_NETWORK_DEFAULT, 1)
164 AC_MSG_RESULT(yes)
165 else
166 CUPS_USE_NETWORK_DEFAULT="No"
167 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USE_NETWORK_DEFAULT, 0)
168 AC_MSG_RESULT(no)
169 fi
170else
e00b005a 171 CUPS_USE_NETWORK_DEFAULT="No"
172 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USE_NETWORK_DEFAULT, 0)
e00b005a 173fi
174AC_SUBST(CUPS_USE_NETWORK_DEFAULT)
175
bd7854cb 176dnl Determine the correct username and group for this OS...
ed486911 177AC_ARG_WITH(cups_user, [ --with-cups-user set default user for CUPS],
bd7854cb 178 CUPS_USER="$withval",
179 AC_MSG_CHECKING(for default print user)
355e94dc 180 if test x$uname = xDarwin; then
c24d2134 181 if test x`id -u _lp 2>/dev/null` = x; then
355e94dc
MS
182 CUPS_USER="lp";
183 else
184 CUPS_USER="_lp";
185 fi
c24d2134 186 AC_MSG_RESULT($CUPS_USER)
355e94dc 187 elif test -f /etc/passwd; then
bd7854cb 188 CUPS_USER=""
189 for user in lp lpd guest daemon nobody; do
190 if test "`grep \^${user}: /etc/passwd`" != ""; then
191 CUPS_USER="$user"
192 AC_MSG_RESULT($user)
193 break;
194 fi
195 done
196
197 if test x$CUPS_USER = x; then
198 CUPS_USER="nobody"
199 AC_MSG_RESULT(not found, using "$CUPS_USER")
200 fi
201 else
202 CUPS_USER="nobody"
203 AC_MSG_RESULT(no password file, using "$CUPS_USER")
204 fi)
205
ed486911 206AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
bd7854cb 207 CUPS_GROUP="$withval",
208 AC_MSG_CHECKING(for default print group)
355e94dc 209 if test x$uname = xDarwin; then
c24d2134 210 if test x`id -g _lp 2>/dev/null` = x; then
355e94dc
MS
211 CUPS_GROUP="lp";
212 else
213 CUPS_GROUP="_lp";
214 fi
c24d2134 215 AC_MSG_RESULT($CUPS_GROUP)
355e94dc
MS
216 elif test -f /etc/group; then
217 GROUP_LIST="_lp lp nobody"
bd7854cb 218 CUPS_GROUP=""
219 for group in $GROUP_LIST; do
220 if test "`grep \^${group}: /etc/group`" != ""; then
221 CUPS_GROUP="$group"
222 AC_MSG_RESULT($group)
223 break;
224 fi
225 done
226
227 if test x$CUPS_GROUP = x; then
228 CUPS_GROUP="nobody"
229 AC_MSG_RESULT(not found, using "$CUPS_GROUP")
230 fi
231 else
232 CUPS_GROUP="nobody"
233 AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
234 fi)
235
ed486911 236AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups for CUPS],
bd7854cb 237 CUPS_SYSTEM_GROUPS="$withval",
238 if test x$uname = xDarwin; then
355e94dc 239 CUPS_SYSTEM_GROUPS="admin"
bd7854cb 240 else
bc44d920 241 AC_MSG_CHECKING(for default system groups)
242 if test -f /etc/group; then
243 CUPS_SYSTEM_GROUPS=""
244 GROUP_LIST="lpadmin sys system root"
245 for group in $GROUP_LIST; do
246 if test "`grep \^${group}: /etc/group`" != ""; then
247 if test "x$CUPS_SYSTEM_GROUPS" = x; then
248 CUPS_SYSTEM_GROUPS="$group"
249 else
250 CUPS_SYSTEM_GROUPS="$CUPS_SYSTEM_GROUPS $group"
251 fi
bd7854cb 252 fi
bc44d920 253 done
bd7854cb 254
bc44d920 255 if test "x$CUPS_SYSTEM_GROUPS" = x; then
256 CUPS_SYSTEM_GROUPS="$GROUP_LIST"
257 AC_MSG_RESULT(no groups found, using "$CUPS_SYSTEM_GROUPS")
258 else
259 AC_MSG_RESULT("$CUPS_SYSTEM_GROUPS")
260 fi
bd7854cb 261 else
bc44d920 262 CUPS_SYSTEM_GROUPS="$GROUP_LIST"
263 AC_MSG_RESULT(no group file, using "$CUPS_SYSTEM_GROUPS")
bd7854cb 264 fi
bd7854cb 265 fi)
266
bc44d920 267
bd7854cb 268CUPS_PRIMARY_SYSTEM_GROUP="`echo $CUPS_SYSTEM_GROUPS | awk '{print $1}'`"
269
270AC_SUBST(CUPS_USER)
271AC_SUBST(CUPS_GROUP)
272AC_SUBST(CUPS_SYSTEM_GROUPS)
273AC_SUBST(CUPS_PRIMARY_SYSTEM_GROUP)
274
275AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER")
276AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP")
277AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SYSTEM_GROUPS, "$CUPS_SYSTEM_GROUPS")
278
e53920b9 279dnl Default printcap file...
a74454a7 280AC_ARG_WITH(printcap, [ --with-printcap set default printcap file],
e53920b9 281 default_printcap="$withval",
ed486911 282 default_printcap="default")
e53920b9 283
07725fee 284if test x$default_printcap != xno; then
ed486911 285 if test "x$default_printcap" = "xdefault"; then
286 case $uname in
287 Darwin*)
288 if test $uversion -ge 90; then
289 CUPS_DEFAULT_PRINTCAP=""
290 else
291 CUPS_DEFAULT_PRINTCAP="/etc/printcap"
292 fi
293 ;;
294 SunOS*)
295 CUPS_DEFAULT_PRINTCAP="/etc/printers.conf"
296 ;;
297 *)
298 CUPS_DEFAULT_PRINTCAP="/etc/printcap"
299 ;;
300 esac
07725fee 301 else
302 CUPS_DEFAULT_PRINTCAP="$default_printcap"
e53920b9 303 fi
304else
305 CUPS_DEFAULT_PRINTCAP=""
306fi
307
308AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
09ec0018 309
568fa3fa
MS
310dnl Default LPD config file...
311AC_ARG_WITH(lpdconfigfile, [ --with-lpdconfigfile set default LPDConfigFile URI],
312 default_lpdconfigfile="$withval",
313 default_lpdconfigfile="default")
314
315if test x$default_lpdconfigfile != xno; then
316 if test "x$default_lpdconfigfile" = "xdefault"; then
317 case $uname in
318 Darwin*)
319 CUPS_DEFAULT_LPD_CONFIG_FILE="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
320 ;;
321 *)
322 if test -d /etc/xinetd.d; then
323 CUPS_DEFAULT_LPD_CONFIG_FILE="xinetd:///etc/xinetd.d/cups-lpd"
324 else
325 CUPS_DEFAULT_LPD_CONFIG_FILE=""
326 fi
327 ;;
328 esac
329 else
330 CUPS_DEFAULT_LPD_CONFIG_FILE="$default_lpdconfigfile"
331 fi
332else
333 CUPS_DEFAULT_LPD_CONFIG_FILE=""
334fi
335
336AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG_FILE, "$CUPS_DEFAULT_LPD_CONFIG_FILE")
337
338dnl Default SMB config file...
339AC_ARG_WITH(smbconfigfile, [ --with-smbconfigfile set default SMBConfigFile URI],
340 default_smbconfigfile="$withval",
341 default_smbconfigfile="default")
342
343if test x$default_smbconfigfile != xno; then
344 if test "x$default_smbconfigfile" = "xdefault"; then
345 if test -f /etc/smb.conf; then
346 CUPS_DEFAULT_SMB_CONFIG_FILE="samba:///etc/smb.conf"
347 else
348 CUPS_DEFAULT_SMB_CONFIG_FILE=""
349 fi
350 else
351 CUPS_DEFAULT_SMB_CONFIG_FILE="$default_smbconfigfile"
352 fi
353else
354 CUPS_DEFAULT_SMB_CONFIG_FILE=""
355fi
356
357AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG_FILE, "$CUPS_DEFAULT_SMB_CONFIG_FILE")
358
f7deaa1a 359dnl Default MaxCopies value...
ae71f5de 360AC_ARG_WITH(max-copies, [ --with-max-copies set default max copies value, default=auto ],
f7deaa1a 361 CUPS_MAX_COPIES="$withval",
362 if test "x$uname" = xDarwin; then
ae71f5de 363 CUPS_MAX_COPIES="9999"
f7deaa1a 364 else
365 CUPS_MAX_COPIES="100"
366 fi)
367
368AC_SUBST(CUPS_MAX_COPIES)
369AC_DEFINE_UNQUOTED(CUPS_DEFAULT_MAX_COPIES, $CUPS_MAX_COPIES)
370
09a101d6 371dnl Default raw printing state
372AC_ARG_ENABLE(raw_printing, [ --enable-raw-printing enable raw printing by default, default=auto])
373if test "x$enable_raw_printing" != xno; then
374 AC_MSG_CHECKING(whether to enable raw printing)
375 if test "x$enable_raw_printing" = xyes -o $uname = Darwin; then
376 DEFAULT_RAW_PRINTING=""
377 AC_MSG_RESULT(yes)
378 else
379 DEFAULT_RAW_PRINTING="#"
380 AC_MSG_RESULT(no)
381 fi
382else
383 DEFAULT_RAW_PRINTING="#"
384fi
385AC_SUBST(DEFAULT_RAW_PRINTING)
386
bc44d920 387dnl Default SNMP options...
388AC_ARG_WITH(snmp-address, [ --with-snmp-address set SNMP query address, default=auto ],
389 if test "x$withval" = x; then
390 CUPS_SNMP_ADDRESS=""
391 else
392 CUPS_SNMP_ADDRESS="Address $withval"
393 fi,
394 if test "x$uname" = xDarwin; then
395 CUPS_SNMP_ADDRESS=""
396 else
397 CUPS_SNMP_ADDRESS="Address @LOCAL"
398 fi)
399
400AC_ARG_WITH(snmp-community, [ --with-snmp-community set SNMP community, default=public ],
401 CUPS_SNMP_COMMUNITY="Community $withval",
402 CUPS_SNMP_COMMUNITY="Community public")
403
404AC_SUBST(CUPS_SNMP_ADDRESS)
405AC_SUBST(CUPS_SNMP_COMMUNITY)
406
ac884b6a
MS
407dnl New default port definition for IPP...
408AC_ARG_WITH(ipp-port, [ --with-ipp-port set default port number for IPP ],
409 DEFAULT_IPP_PORT="$withval",
410 DEFAULT_IPP_PORT="631")
411
412AC_SUBST(DEFAULT_IPP_PORT)
413AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
414
09ec0018 415dnl
75bd9771 416dnl End of "$Id: cups-defaults.m4 7649 2008-06-16 17:46:57Z mike $".
09ec0018 417dnl