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