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