]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-directories.m4
Update ipp documentation to reflect the behavior of configuring WiFi on IPP USB printers.
[thirdparty/cups.git] / config-scripts / cups-directories.m4
CommitLineData
ef416fc2 1dnl
5a1d7a17 2dnl Directory stuff for CUPS.
ef416fc2 3dnl
105922ec 4dnl Copyright 2007-2017 by Apple Inc.
5a1d7a17 5dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 6dnl
e3101897 7dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
ef416fc2 8dnl
9
10AC_PREFIX_DEFAULT(/)
11
12dnl Fix "prefix" variable if it hasn't been specified...
13if test "$prefix" = "NONE"; then
14 prefix="/"
15fi
16
17dnl Fix "exec_prefix" variable if it hasn't been specified...
18if test "$exec_prefix" = "NONE"; then
19 if test "$prefix" = "/"; then
20 exec_prefix="/usr"
21 else
22 exec_prefix="$prefix"
23 fi
24fi
25
26dnl Fix "bindir" variable...
27if test "$bindir" = "\${exec_prefix}/bin"; then
28 bindir="$exec_prefix/bin"
29fi
30
fa73b229 31AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir")
32
ef416fc2 33dnl Fix "sbindir" variable...
34if test "$sbindir" = "\${exec_prefix}/sbin"; then
35 sbindir="$exec_prefix/sbin"
36fi
37
fa73b229 38AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir")
39
ef416fc2 40dnl Fix "sharedstatedir" variable if it hasn't been specified...
41if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
42 sharedstatedir="/usr/com"
43fi
44
d09495fa 45dnl Fix "datarootdir" variable if it hasn't been specified...
46if test "$datarootdir" = "\${prefix}/share"; then
47 if test "$prefix" = "/"; then
48 datarootdir="/usr/share"
49 else
50 datarootdir="$prefix/share"
51 fi
52fi
53
ef416fc2 54dnl Fix "datadir" variable if it hasn't been specified...
55if test "$datadir" = "\${prefix}/share"; then
56 if test "$prefix" = "/"; then
57 datadir="/usr/share"
58 else
59 datadir="$prefix/share"
60 fi
d09495fa 61elif test "$datadir" = "\${datarootdir}"; then
62 datadir="$datarootdir"
ef416fc2 63fi
64
65dnl Fix "includedir" variable if it hasn't been specified...
66if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then
67 includedir="/usr/include"
68fi
69
70dnl Fix "localstatedir" variable if it hasn't been specified...
71if test "$localstatedir" = "\${prefix}/var"; then
72 if test "$prefix" = "/"; then
105922ec 73 if test "$host_os_name" = darwin; then
ef416fc2 74 localstatedir="/private/var"
75 else
76 localstatedir="/var"
77 fi
78 else
79 localstatedir="$prefix/var"
80 fi
81fi
82
83dnl Fix "sysconfdir" variable if it hasn't been specified...
84if test "$sysconfdir" = "\${prefix}/etc"; then
85 if test "$prefix" = "/"; then
105922ec 86 if test "$host_os_name" = darwin; then
ef416fc2 87 sysconfdir="/private/etc"
88 else
89 sysconfdir="/etc"
90 fi
91 else
92 sysconfdir="$prefix/etc"
93 fi
94fi
95
c277e2f8 96dnl Fix "libdir" variable...
ef416fc2 97if test "$libdir" = "\${exec_prefix}/lib"; then
105922ec
MS
98 case "$host_os_name" in
99 linux*)
5a9febac 100 if test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot; then
c277e2f8
MS
101 libdir="$exec_prefix/lib64"
102 fi
103 ;;
c277e2f8 104 esac
ef416fc2 105fi
106
71e16022 107dnl Setup private include directory...
5180a04c 108AC_ARG_WITH(privateinclude, [ --with-privateinclude set path for private include files, default=none],privateinclude="$withval",privateinclude="")
71e16022
MS
109if test "x$privateinclude" != x -a "x$privateinclude" != xnone; then
110 PRIVATEINCLUDE="$privateinclude/cups"
111else
112 privateinclude=""
113 PRIVATEINCLUDE=""
114fi
115AC_SUBST(privateinclude)
116AC_SUBST(PRIVATEINCLUDE)
117
2e4ff8af
MS
118dnl LPD sharing support...
119AC_ARG_WITH(lpdconfig, [ --with-lpdconfig set URI for LPD config file],
120 LPDCONFIG="$withval", LPDCONFIG="")
121
122if test "x$LPDCONFIG" = x; then
123 if test -f /System/Library/LaunchDaemons/org.cups.cups-lpd.plist; then
124 LPDCONFIG="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
125 elif test "x$XINETD" != x; then
126 LPDCONFIG="xinetd://$XINETD/cups-lpd"
127 fi
128fi
129
130if test "x$LPDCONFIG" = xoff; then
131 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "")
132else
133 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "$LPDCONFIG")
134fi
135
136dnl SMB sharing support...
137AC_ARG_WITH(smbconfig, [ --with-smbconfig set URI for Samba config file],
138 SMBCONFIG="$withval", SMBCONFIG="")
139
140if test "x$SMBCONFIG" = x; then
141 if test -f /System/Library/LaunchDaemons/smbd.plist; then
142 SMBCONFIG="launchd:///System/Library/LaunchDaemons/smbd.plist"
143 else
144 for dir in /etc /etc/samba /usr/local/etc; do
145 if test -f $dir/smb.conf; then
146 SMBCONFIG="samba://$dir/smb.conf"
147 break
148 fi
149 done
150 fi
151fi
152
153if test "x$SMBCONFIG" = xoff; then
154 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "")
155else
156 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "$SMBCONFIG")
157fi
158
ef416fc2 159dnl Setup default locations...
160# Cache data...
161AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
162
163if test x$cachedir = x; then
105922ec 164 if test "x$host_os_name" = xdarwin; then
d09495fa 165 CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
a4d04587 166 else
167 CUPS_CACHEDIR="$localstatedir/cache/cups"
168 fi
ef416fc2 169else
170 CUPS_CACHEDIR="$cachedir"
171fi
172AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
173AC_SUBST(CUPS_CACHEDIR)
174
175# Data files
176CUPS_DATADIR="$datadir/cups"
177AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
178AC_SUBST(CUPS_DATADIR)
179
f7deaa1a 180# Icon directory
181AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="")
182
183if test "x$icondir" = x -a -d /usr/share/icons; then
184 ICONDIR="/usr/share/icons"
185else
186 ICONDIR="$icondir"
187fi
188
189AC_SUBST(ICONDIR)
190
191# Menu directory
192AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="")
193
194if test "x$menudir" = x -a -d /usr/share/applications; then
195 MENUDIR="/usr/share/applications"
196else
197 MENUDIR="$menudir"
198fi
199
200AC_SUBST(MENUDIR)
201
ef416fc2 202# Documentation files
203AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
204
205if test x$docdir = x; then
206 CUPS_DOCROOT="$datadir/doc/cups"
207 docdir="$datadir/doc/cups"
208else
209 CUPS_DOCROOT="$docdir"
210fi
211
212AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
213AC_SUBST(CUPS_DOCROOT)
214
215# Fonts
216AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
217
218if test "x$fontpath" = "x"; then
219 CUPS_FONTPATH="$datadir/cups/fonts"
220else
221 CUPS_FONTPATH="$fontpath"
222fi
223
224AC_SUBST(CUPS_FONTPATH)
225AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
226
2e4ff8af
MS
227# Locale data
228if test "$localedir" = "\${datarootdir}/locale"; then
105922ec 229 case "$host_os_name" in
827bf9ce 230 linux* | gnu* | *bsd* | darwin*)
2e4ff8af 231 CUPS_LOCALEDIR="$datarootdir/locale"
db1f069b 232 ;;
ef416fc2 233
db1f069b
MS
234 *)
235 # This is the standard System V location...
236 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
237 ;;
238 esac
239else
240 CUPS_LOCALEDIR="$localedir"
241fi
ef416fc2 242
243AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
244AC_SUBST(CUPS_LOCALEDIR)
245
246# Log files...
247AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
248
249if test x$logdir = x; then
250 CUPS_LOGDIR="$localstatedir/log/cups"
251 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
252else
253 CUPS_LOGDIR="$logdir"
254fi
255AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
256AC_SUBST(CUPS_LOGDIR)
257
258# Longer-term spool data
259CUPS_REQUESTS="$localstatedir/spool/cups"
260AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
261AC_SUBST(CUPS_REQUESTS)
262
263# Server executables...
105922ec
MS
264case "$host_os_name" in
265 *bsd* | darwin*)
d4874933 266 # *BSD and Darwin (macOS)
ef416fc2 267 INSTALL_SYSV=""
268 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
269 ;;
270 *)
271 # All others
272 INSTALL_SYSV="install-sysv"
e1d6a774 273 CUPS_SERVERBIN="$exec_prefix/lib/cups"
ef416fc2 274 ;;
275esac
276
277AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
278AC_SUBST(CUPS_SERVERBIN)
279AC_SUBST(INSTALL_SYSV)
280
281# Configuration files
282CUPS_SERVERROOT="$sysconfdir/cups"
283AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
284AC_SUBST(CUPS_SERVERROOT)
285
286# Transient run-time state
6961465f 287AC_ARG_WITH(rundir, [ --with-rundir set transient run-time state directory],CUPS_STATEDIR="$withval",[
105922ec
MS
288 case "$host_os_name" in
289 darwin*)
8072030b 290 # Darwin (macOS)
6961465f
MS
291 CUPS_STATEDIR="$CUPS_SERVERROOT"
292 ;;
293 *)
294 # All others
295 CUPS_STATEDIR="$localstatedir/run/cups"
296 ;;
297 esac])
e07d4801 298AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
ef416fc2 299AC_SUBST(CUPS_STATEDIR)