• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1dnl
2dnl Default cupsd configuration settings for CUPS.
3dnl
4dnl Copyright © 2007-2018 by Apple Inc.
5dnl Copyright © 2006-2007 by Easy Software Products, all rights reserved.
6dnl
7dnl Licensed under Apache License v2.0.  See the file "LICENSE" for more
8dnl information.
9dnl
10
11dnl Default languages...
12LANGUAGES="`ls -1 locale/cups_*.po 2>/dev/null | sed -e '1,$s/locale\/cups_//' -e '1,$s/\.po//' | tr '\n' ' '`"
13
14AC_ARG_WITH(languages, [  --with-languages        set installed languages, default=all ],[
15	case "$withval" in
16		none | no) LANGUAGES="" ;;
17		all) ;;
18		*) LANGUAGES="$withval" ;;
19	esac])
20AC_SUBST(LANGUAGES)
21
22dnl macOS bundle-based localization support
23AC_ARG_WITH(bundledir, [  --with-bundledir        set localization bundle directory ],
24	CUPS_BUNDLEDIR="$withval",[
25	if test "x$host_os_name" = xdarwin -a $host_os_version -ge 100; then
26		CUPS_BUNDLEDIR="/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A"
27		LANGUAGES=""
28	else
29		CUPS_BUNDLEDIR=""
30	fi])
31
32AC_SUBST(CUPS_BUNDLEDIR)
33if test "x$CUPS_BUNDLEDIR" != x; then
34	AC_DEFINE_UNQUOTED(CUPS_BUNDLEDIR, "$CUPS_BUNDLEDIR")
35fi
36
37AC_ARG_WITH(bundlelang, [  --with-bundlelang       set localization bundle base language (English or en) ],
38	cups_bundlelang="$withval",[
39	if test $host_os_version -ge 190; then
40		cups_bundlelang="en"
41	else
42		cups_bundlelang="English"
43	fi])
44
45if test "x$cups_bundlelang" != x -a "x$CUPS_BUNDLEDIR" != x; then
46	CUPS_RESOURCEDIR="$CUPS_BUNDLEDIR/Resources/$cups_bundlelang.lproj"
47else
48	CUPS_RESOURCEDIR=""
49fi
50AC_SUBST(CUPS_RESOURCEDIR)
51
52dnl Default executable file permissions
53AC_ARG_WITH(exe_file_perm, [  --with-exe-file-perm    set default executable permissions value, default=0555],
54	CUPS_EXE_FILE_PERM="$withval",
55	[case "$host_os_name" in
56		linux* | gnu*)
57			CUPS_EXE_FILE_PERM="755"
58			;;
59		*)
60			CUPS_EXE_FILE_PERM="555"
61			;;
62	esac])
63AC_SUBST(CUPS_EXE_FILE_PERM)
64
65dnl Default ConfigFilePerm
66AC_ARG_WITH(config_file_perm, [  --with-config-file-perm set default ConfigFilePerm value, default=0640],
67	CUPS_CONFIG_FILE_PERM="$withval",
68	[if test "x$host_os_name" = xdarwin; then
69		CUPS_CONFIG_FILE_PERM="644"
70	else
71		CUPS_CONFIG_FILE_PERM="640"
72	fi])
73AC_SUBST(CUPS_CONFIG_FILE_PERM)
74AC_DEFINE_UNQUOTED(CUPS_DEFAULT_CONFIG_FILE_PERM, 0$CUPS_CONFIG_FILE_PERM)
75
76dnl Default permissions for cupsd
77AC_ARG_WITH(cupsd_file_perm, [  --with-cupsd-file-perm  set default cupsd permissions, default=0500],
78	CUPS_CUPSD_FILE_PERM="$withval",
79	[case "$host_os_name" in
80		linux* | gnu*)
81			CUPS_CUPSD_FILE_PERM="700"
82			;;
83		*)
84			CUPS_CUPSD_FILE_PERM="500"
85			;;
86	esac])
87AC_SUBST(CUPS_CUPSD_FILE_PERM)
88
89dnl Default LogFilePerm
90AC_ARG_WITH(log_file_perm, [  --with-log-file-perm    set default LogFilePerm value, default=0644],
91	CUPS_LOG_FILE_PERM="$withval",
92	CUPS_LOG_FILE_PERM="644")
93AC_SUBST(CUPS_LOG_FILE_PERM)
94AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_FILE_PERM, 0$CUPS_LOG_FILE_PERM)
95
96dnl Default FatalErrors
97AC_ARG_WITH(fatal_errors, [  --with-fatal-errors     set default FatalErrors value, default=config],
98	CUPS_FATAL_ERRORS="$withval",
99	CUPS_FATAL_ERRORS="config")
100AC_SUBST(CUPS_FATAL_ERRORS)
101AC_DEFINE_UNQUOTED(CUPS_DEFAULT_FATAL_ERRORS, "$CUPS_FATAL_ERRORS")
102
103dnl Default LogLevel
104AC_ARG_WITH(log_level, [  --with-log-level        set default LogLevel value, default=warn],
105	CUPS_LOG_LEVEL="$withval",
106	CUPS_LOG_LEVEL="warn")
107AC_SUBST(CUPS_LOG_LEVEL)
108AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_LEVEL, "$CUPS_LOG_LEVEL")
109
110dnl Default AccessLogLevel
111AC_ARG_WITH(access_log_level, [  --with-access-log-level set default AccessLogLevel value, default=none],
112	CUPS_ACCESS_LOG_LEVEL="$withval",
113	CUPS_ACCESS_LOG_LEVEL="none")
114AC_SUBST(CUPS_ACCESS_LOG_LEVEL)
115AC_DEFINE_UNQUOTED(CUPS_DEFAULT_ACCESS_LOG_LEVEL, "$CUPS_ACCESS_LOG_LEVEL")
116
117dnl Default PageLogFormat
118AC_ARG_ENABLE(page_logging, [  --enable-page-logging   enable page_log by default])
119if test "x$enable_page_logging" = xyes; then
120	CUPS_PAGE_LOG_FORMAT=""
121else
122	CUPS_PAGE_LOG_FORMAT="PageLogFormat"
123fi
124AC_SUBST(CUPS_PAGE_LOG_FORMAT)
125
126dnl Default Browsing
127AC_ARG_ENABLE(browsing, [  --disable-browsing      disable Browsing by default])
128if test "x$enable_browsing" = xno; then
129	CUPS_BROWSING="No"
130	AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSING, 0)
131else
132	CUPS_BROWSING="Yes"
133	AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSING, 1)
134fi
135AC_SUBST(CUPS_BROWSING)
136
137dnl Default BrowseLocalProtocols
138AC_ARG_WITH(local_protocols, [  --with-local-protocols  set default BrowseLocalProtocols, default=""],
139	default_local_protocols="$withval",
140	default_local_protocols="default")
141
142if test x$with_local_protocols != xno; then
143	if test "x$default_local_protocols" = "xdefault"; then
144		if test "x$DNSSD_BACKEND" != "x"; then
145			CUPS_BROWSE_LOCAL_PROTOCOLS="dnssd"
146		else
147			CUPS_BROWSE_LOCAL_PROTOCOLS=""
148		fi
149	else
150		CUPS_BROWSE_LOCAL_PROTOCOLS="$default_local_protocols"
151	fi
152else
153	CUPS_BROWSE_LOCAL_PROTOCOLS=""
154fi
155
156AC_SUBST(CUPS_BROWSE_LOCAL_PROTOCOLS)
157AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS,
158	"$CUPS_BROWSE_LOCAL_PROTOCOLS")
159
160dnl Default DefaultShared
161AC_ARG_ENABLE(default_shared, [  --disable-default-shared
162			  disable DefaultShared by default])
163if test "x$enable_default_shared" = xno; then
164	CUPS_DEFAULT_SHARED="No"
165	AC_DEFINE_UNQUOTED(CUPS_DEFAULT_DEFAULT_SHARED, 0)
166else
167	CUPS_DEFAULT_SHARED="Yes"
168	AC_DEFINE_UNQUOTED(CUPS_DEFAULT_DEFAULT_SHARED, 1)
169fi
170AC_SUBST(CUPS_DEFAULT_SHARED)
171
172dnl Determine the correct username and group for this OS...
173AC_ARG_WITH(cups_user, [  --with-cups-user        set default user for CUPS],
174	CUPS_USER="$withval",
175	AC_MSG_CHECKING(for default print user)
176	if test x$host_os_name = xdarwin; then
177		if test x`id -u _lp 2>/dev/null` = x; then
178			CUPS_USER="lp";
179		else
180			CUPS_USER="_lp";
181		fi
182		AC_MSG_RESULT($CUPS_USER)
183	elif test -f /etc/passwd; then
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
202if test "x$CUPS_USER" = "xroot" -o "x$CUPS_USER" = "x0"; then
203	AC_MSG_ERROR([The default user for CUPS cannot be root!])
204fi
205
206AC_ARG_WITH(cups_group, [  --with-cups-group       set default group for CUPS],
207	CUPS_GROUP="$withval",
208	AC_MSG_CHECKING(for default print group)
209	if test x$host_os_name = xdarwin; then
210		if test x`id -g _lp 2>/dev/null` = x; then
211			CUPS_GROUP="lp";
212		else
213			CUPS_GROUP="_lp";
214		fi
215		AC_MSG_RESULT($CUPS_GROUP)
216	elif test -f /etc/group; then
217		GROUP_LIST="_lp lp nobody"
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
236if test "x$CUPS_GROUP" = "xroot" -o "x$CUPS_GROUP" = "xwheel" -o "x$CUPS_GROUP" = "x0"; then
237	AC_MSG_ERROR([The default group for CUPS cannot be root!])
238fi
239
240AC_ARG_WITH(system_groups, [  --with-system-groups    set default system groups for CUPS],
241	CUPS_SYSTEM_GROUPS="$withval",
242	if test x$host_os_name = xdarwin; then
243		CUPS_SYSTEM_GROUPS="admin"
244	else
245		AC_MSG_CHECKING(for default system groups)
246		if test -f /etc/group; then
247			CUPS_SYSTEM_GROUPS=""
248			GROUP_LIST="lpadmin sys system root wheel"
249			for group in $GROUP_LIST; do
250				if test "`grep \^${group}: /etc/group`" != ""; then
251					if test "x$CUPS_SYSTEM_GROUPS" = x; then
252						CUPS_SYSTEM_GROUPS="$group"
253					else
254						CUPS_SYSTEM_GROUPS="$CUPS_SYSTEM_GROUPS $group"
255					fi
256				fi
257			done
258
259			if test "x$CUPS_SYSTEM_GROUPS" = x; then
260				CUPS_SYSTEM_GROUPS="$GROUP_LIST"
261				AC_MSG_RESULT(no groups found, using "$CUPS_SYSTEM_GROUPS")
262			else
263				AC_MSG_RESULT("$CUPS_SYSTEM_GROUPS")
264			fi
265		else
266			CUPS_SYSTEM_GROUPS="$GROUP_LIST"
267			AC_MSG_RESULT(no group file, using "$CUPS_SYSTEM_GROUPS")
268		fi
269	fi)
270
271CUPS_PRIMARY_SYSTEM_GROUP="`echo $CUPS_SYSTEM_GROUPS | awk '{print $1}'`"
272
273for group in $CUPS_SYSTEM_GROUPS; do
274	if test "x$CUPS_GROUP" = "x$group"; then
275		AC_MSG_ERROR([The default system groups cannot contain the default CUPS group!])
276	fi
277done
278
279AC_SUBST(CUPS_USER)
280AC_SUBST(CUPS_GROUP)
281AC_SUBST(CUPS_SYSTEM_GROUPS)
282AC_SUBST(CUPS_PRIMARY_SYSTEM_GROUP)
283
284AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER")
285AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP")
286AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SYSTEM_GROUPS, "$CUPS_SYSTEM_GROUPS")
287
288dnl Default printcap file...
289AC_ARG_WITH(printcap, [  --with-printcap         set default printcap file],
290	default_printcap="$withval",
291	default_printcap="default")
292
293if test x$default_printcap != xno; then
294	if test "x$default_printcap" = "xdefault"; then
295		case $host_os_name in
296			darwin*)
297				if test $host_os_version -ge 90; then
298					CUPS_DEFAULT_PRINTCAP="/Library/Preferences/org.cups.printers.plist"
299				else
300					CUPS_DEFAULT_PRINTCAP="/etc/printcap"
301				fi
302				;;
303			sunos*)
304				CUPS_DEFAULT_PRINTCAP="/etc/printers.conf"
305				;;
306			*)
307				CUPS_DEFAULT_PRINTCAP="/etc/printcap"
308				;;
309		esac
310	else
311		CUPS_DEFAULT_PRINTCAP="$default_printcap"
312	fi
313else
314	CUPS_DEFAULT_PRINTCAP=""
315fi
316
317AC_SUBST(CUPS_DEFAULT_PRINTCAP)
318AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
319
320dnl Default LPD config file...
321AC_ARG_WITH(lpdconfigfile, [  --with-lpdconfigfile    set default LPDConfigFile URI],
322	default_lpdconfigfile="$withval",
323	default_lpdconfigfile="default")
324
325if test x$default_lpdconfigfile != xno; then
326	if test "x$default_lpdconfigfile" = "xdefault"; then
327		case $host_os_name in
328			darwin*)
329				CUPS_DEFAULT_LPD_CONFIG_FILE="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
330				;;
331			*)
332				if test "x$XINETD" != x; then
333					CUPS_DEFAULT_LPD_CONFIG_FILE="xinetd://$XINETD/cups-lpd"
334				else
335					CUPS_DEFAULT_LPD_CONFIG_FILE=""
336				fi
337				;;
338		esac
339	else
340		CUPS_DEFAULT_LPD_CONFIG_FILE="$default_lpdconfigfile"
341	fi
342else
343	CUPS_DEFAULT_LPD_CONFIG_FILE=""
344fi
345
346AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG_FILE, "$CUPS_DEFAULT_LPD_CONFIG_FILE")
347AC_SUBST(CUPS_DEFAULT_LPD_CONFIG_FILE)
348
349dnl Default SMB config file...
350AC_ARG_WITH(smbconfigfile, [  --with-smbconfigfile    set default SMBConfigFile URI],
351	default_smbconfigfile="$withval",
352	default_smbconfigfile="default")
353
354if test x$default_smbconfigfile != xno; then
355	if test "x$default_smbconfigfile" = "xdefault"; then
356		if test -f /etc/smb.conf; then
357			CUPS_DEFAULT_SMB_CONFIG_FILE="samba:///etc/smb.conf"
358		else
359			CUPS_DEFAULT_SMB_CONFIG_FILE=""
360		fi
361	else
362		CUPS_DEFAULT_SMB_CONFIG_FILE="$default_smbconfigfile"
363	fi
364else
365	CUPS_DEFAULT_SMB_CONFIG_FILE=""
366fi
367
368AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG_FILE, "$CUPS_DEFAULT_SMB_CONFIG_FILE")
369AC_SUBST(CUPS_DEFAULT_SMB_CONFIG_FILE)
370
371dnl Default MaxCopies value...
372AC_ARG_WITH(max-copies, [  --with-max-copies       set default max copies value, default=9999 ],
373	CUPS_MAX_COPIES="$withval",
374	CUPS_MAX_COPIES="9999")
375
376AC_SUBST(CUPS_MAX_COPIES)
377AC_DEFINE_UNQUOTED(CUPS_DEFAULT_MAX_COPIES, $CUPS_MAX_COPIES)
378
379dnl Default raw printing state
380AC_ARG_ENABLE(raw_printing, [  --disable-raw-printing  do not allow raw printing by default])
381if test "x$enable_raw_printing" != xno; then
382	DEFAULT_RAW_PRINTING=""
383else
384	DEFAULT_RAW_PRINTING="#"
385fi
386AC_SUBST(DEFAULT_RAW_PRINTING)
387
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$host_os_name" = 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
408dnl New default port definition for IPP...
409AC_ARG_WITH(ipp-port, [  --with-ipp-port         set port number for IPP, default=631 ],
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
416dnl Web interface...
417AC_ARG_ENABLE(webif, [  --enable-webif          enable the web interface by default, default=no for macOS])
418case "x$enable_webif" in
419	xno)
420		CUPS_WEBIF=No
421		CUPS_DEFAULT_WEBIF=0
422		;;
423	xyes)
424		CUPS_WEBIF=Yes
425		CUPS_DEFAULT_WEBIF=1
426		;;
427	*)
428		if test $host_os_name = darwin; then
429			CUPS_WEBIF=No
430			CUPS_DEFAULT_WEBIF=0
431		else
432			CUPS_WEBIF=Yes
433			CUPS_DEFAULT_WEBIF=1
434		fi
435		;;
436esac
437
438AC_SUBST(CUPS_WEBIF)
439AC_DEFINE_UNQUOTED(CUPS_DEFAULT_WEBIF, $CUPS_DEFAULT_WEBIF)
440