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