]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-defaults.m4
Merge changes from CUPS 1.4svn-r8305.
[thirdparty/cups.git] / config-scripts / cups-defaults.m4
CommitLineData
09ec0018 1dnl
b19ccc9e 2dnl "$Id: cups-defaults.m4 7959 2008-09-17 19:30:58Z 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 42dnl Default FatalErrors
b19ccc9e 43AC_ARG_WITH(fatal_errors, [ --with-fatal-errors set default FatalErrors value, default=config],
49d87452
MS
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
0af14961 289 CUPS_DEFAULT_PRINTCAP="/Library/Preferences/org.cups.printers.plist"
ed486911 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
0af14961 308AC_SUBST(CUPS_DEFAULT_PRINTCAP)
e53920b9 309AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
09ec0018 310
568fa3fa
MS
311dnl Default LPD config file...
312AC_ARG_WITH(lpdconfigfile, [ --with-lpdconfigfile set default LPDConfigFile URI],
313 default_lpdconfigfile="$withval",
314 default_lpdconfigfile="default")
315
316if test x$default_lpdconfigfile != xno; then
317 if test "x$default_lpdconfigfile" = "xdefault"; then
318 case $uname in
319 Darwin*)
320 CUPS_DEFAULT_LPD_CONFIG_FILE="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
321 ;;
322 *)
323 if test -d /etc/xinetd.d; then
324 CUPS_DEFAULT_LPD_CONFIG_FILE="xinetd:///etc/xinetd.d/cups-lpd"
325 else
326 CUPS_DEFAULT_LPD_CONFIG_FILE=""
327 fi
328 ;;
329 esac
330 else
331 CUPS_DEFAULT_LPD_CONFIG_FILE="$default_lpdconfigfile"
332 fi
333else
334 CUPS_DEFAULT_LPD_CONFIG_FILE=""
335fi
336
337AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG_FILE, "$CUPS_DEFAULT_LPD_CONFIG_FILE")
338
339dnl Default SMB config file...
340AC_ARG_WITH(smbconfigfile, [ --with-smbconfigfile set default SMBConfigFile URI],
341 default_smbconfigfile="$withval",
342 default_smbconfigfile="default")
343
344if test x$default_smbconfigfile != xno; then
345 if test "x$default_smbconfigfile" = "xdefault"; then
346 if test -f /etc/smb.conf; then
347 CUPS_DEFAULT_SMB_CONFIG_FILE="samba:///etc/smb.conf"
348 else
349 CUPS_DEFAULT_SMB_CONFIG_FILE=""
350 fi
351 else
352 CUPS_DEFAULT_SMB_CONFIG_FILE="$default_smbconfigfile"
353 fi
354else
355 CUPS_DEFAULT_SMB_CONFIG_FILE=""
356fi
357
358AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG_FILE, "$CUPS_DEFAULT_SMB_CONFIG_FILE")
359
f7deaa1a 360dnl Default MaxCopies value...
ae71f5de 361AC_ARG_WITH(max-copies, [ --with-max-copies set default max copies value, default=auto ],
f7deaa1a 362 CUPS_MAX_COPIES="$withval",
363 if test "x$uname" = xDarwin; then
ae71f5de 364 CUPS_MAX_COPIES="9999"
f7deaa1a 365 else
366 CUPS_MAX_COPIES="100"
367 fi)
368
369AC_SUBST(CUPS_MAX_COPIES)
370AC_DEFINE_UNQUOTED(CUPS_DEFAULT_MAX_COPIES, $CUPS_MAX_COPIES)
371
09a101d6 372dnl Default raw printing state
373AC_ARG_ENABLE(raw_printing, [ --enable-raw-printing enable raw printing by default, default=auto])
374if test "x$enable_raw_printing" != xno; then
375 AC_MSG_CHECKING(whether to enable raw printing)
376 if test "x$enable_raw_printing" = xyes -o $uname = Darwin; then
377 DEFAULT_RAW_PRINTING=""
378 AC_MSG_RESULT(yes)
379 else
380 DEFAULT_RAW_PRINTING="#"
381 AC_MSG_RESULT(no)
382 fi
383else
384 DEFAULT_RAW_PRINTING="#"
385fi
386AC_SUBST(DEFAULT_RAW_PRINTING)
387
bc44d920 388dnl Default SNMP options...
389AC_ARG_WITH(snmp-address, [ --with-snmp-address set SNMP query address, default=auto ],
390 if test "x$withval" = x; then
391 CUPS_SNMP_ADDRESS=""
392 else
393 CUPS_SNMP_ADDRESS="Address $withval"
394 fi,
395 if test "x$uname" = xDarwin; then
396 CUPS_SNMP_ADDRESS=""
397 else
398 CUPS_SNMP_ADDRESS="Address @LOCAL"
399 fi)
400
401AC_ARG_WITH(snmp-community, [ --with-snmp-community set SNMP community, default=public ],
402 CUPS_SNMP_COMMUNITY="Community $withval",
403 CUPS_SNMP_COMMUNITY="Community public")
404
405AC_SUBST(CUPS_SNMP_ADDRESS)
406AC_SUBST(CUPS_SNMP_COMMUNITY)
407
ac884b6a
MS
408dnl New default port definition for IPP...
409AC_ARG_WITH(ipp-port, [ --with-ipp-port set default port number for IPP ],
410 DEFAULT_IPP_PORT="$withval",
411 DEFAULT_IPP_PORT="631")
412
413AC_SUBST(DEFAULT_IPP_PORT)
414AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
415
e6013cfa
MS
416dnl Filters
417AC_ARG_ENABLE(bannertops, [ --enable-bannertops build with default banner filter, default=auto ])
418AC_ARG_ENABLE(texttops, [ --enable-texttops build with default text filter, default=auto ])
419
420if test "x$enable_bannertops" = xno; then
421 BANNERTOPS=""
422elif test "x$enable_bannertops" = xyes; then
423 BANNERTOPS="bannertops"
424elif test $uname = Darwin; then
425 BANNERTOPS=""
426else
427 BANNERTOPS="bannertops"
428fi
429
430if test "x$enable_texttops" = xno; then
431 TEXTTOPS=""
432elif test "x$enable_texttops" = xyes; then
433 TEXTTOPS="texttops"
434elif test $uname = Darwin; then
435 TEXTTOPS=""
436else
437 TEXTTOPS="texttops"
438fi
439
440AC_SUBST(BANNERTOPS)
441AC_SUBST(TEXTTOPS)
442
09ec0018 443dnl
b19ccc9e 444dnl End of "$Id: cups-defaults.m4 7959 2008-09-17 19:30:58Z mike $".
09ec0018 445dnl