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