]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
5a1d7a17 | 2 | dnl Directory stuff for CUPS. |
ef416fc2 | 3 | dnl |
105922ec | 4 | dnl Copyright 2007-2017 by Apple Inc. |
5a1d7a17 | 5 | dnl Copyright 1997-2007 by Easy Software Products, all rights reserved. |
ef416fc2 | 6 | dnl |
e3101897 | 7 | dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information. |
ef416fc2 | 8 | dnl |
9 | ||
10 | AC_PREFIX_DEFAULT(/) | |
11 | ||
12 | dnl Fix "prefix" variable if it hasn't been specified... | |
13 | if test "$prefix" = "NONE"; then | |
14 | prefix="/" | |
15 | fi | |
16 | ||
17 | dnl Fix "exec_prefix" variable if it hasn't been specified... | |
18 | if test "$exec_prefix" = "NONE"; then | |
19 | if test "$prefix" = "/"; then | |
20 | exec_prefix="/usr" | |
21 | else | |
22 | exec_prefix="$prefix" | |
23 | fi | |
24 | fi | |
25 | ||
26 | dnl Fix "bindir" variable... | |
27 | if test "$bindir" = "\${exec_prefix}/bin"; then | |
28 | bindir="$exec_prefix/bin" | |
29 | fi | |
30 | ||
fa73b229 | 31 | AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir") |
32 | ||
ef416fc2 | 33 | dnl Fix "sbindir" variable... |
34 | if test "$sbindir" = "\${exec_prefix}/sbin"; then | |
35 | sbindir="$exec_prefix/sbin" | |
36 | fi | |
37 | ||
fa73b229 | 38 | AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir") |
39 | ||
ef416fc2 | 40 | dnl Fix "sharedstatedir" variable if it hasn't been specified... |
41 | if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then | |
42 | sharedstatedir="/usr/com" | |
43 | fi | |
44 | ||
d09495fa | 45 | dnl Fix "datarootdir" variable if it hasn't been specified... |
46 | if test "$datarootdir" = "\${prefix}/share"; then | |
47 | if test "$prefix" = "/"; then | |
48 | datarootdir="/usr/share" | |
49 | else | |
50 | datarootdir="$prefix/share" | |
51 | fi | |
52 | fi | |
53 | ||
ef416fc2 | 54 | dnl Fix "datadir" variable if it hasn't been specified... |
55 | if test "$datadir" = "\${prefix}/share"; then | |
56 | if test "$prefix" = "/"; then | |
57 | datadir="/usr/share" | |
58 | else | |
59 | datadir="$prefix/share" | |
60 | fi | |
d09495fa | 61 | elif test "$datadir" = "\${datarootdir}"; then |
62 | datadir="$datarootdir" | |
ef416fc2 | 63 | fi |
64 | ||
65 | dnl Fix "includedir" variable if it hasn't been specified... | |
66 | if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then | |
67 | includedir="/usr/include" | |
68 | fi | |
69 | ||
70 | dnl Fix "localstatedir" variable if it hasn't been specified... | |
71 | if 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 | |
81 | fi | |
82 | ||
83 | dnl Fix "sysconfdir" variable if it hasn't been specified... | |
84 | if 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 | |
94 | fi | |
95 | ||
c277e2f8 | 96 | dnl Fix "libdir" variable... |
ef416fc2 | 97 | if 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 | 105 | fi |
106 | ||
71e16022 | 107 | dnl Setup private include directory... |
5180a04c | 108 | AC_ARG_WITH(privateinclude, [ --with-privateinclude set path for private include files, default=none],privateinclude="$withval",privateinclude="") |
71e16022 MS |
109 | if test "x$privateinclude" != x -a "x$privateinclude" != xnone; then |
110 | PRIVATEINCLUDE="$privateinclude/cups" | |
111 | else | |
112 | privateinclude="" | |
113 | PRIVATEINCLUDE="" | |
114 | fi | |
115 | AC_SUBST(privateinclude) | |
116 | AC_SUBST(PRIVATEINCLUDE) | |
117 | ||
2e4ff8af MS |
118 | dnl LPD sharing support... |
119 | AC_ARG_WITH(lpdconfig, [ --with-lpdconfig set URI for LPD config file], | |
120 | LPDCONFIG="$withval", LPDCONFIG="") | |
121 | ||
122 | if 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 | |
128 | fi | |
129 | ||
130 | if test "x$LPDCONFIG" = xoff; then | |
131 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "") | |
132 | else | |
133 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "$LPDCONFIG") | |
134 | fi | |
135 | ||
136 | dnl SMB sharing support... | |
137 | AC_ARG_WITH(smbconfig, [ --with-smbconfig set URI for Samba config file], | |
138 | SMBCONFIG="$withval", SMBCONFIG="") | |
139 | ||
140 | if 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 | |
151 | fi | |
152 | ||
153 | if test "x$SMBCONFIG" = xoff; then | |
154 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "") | |
155 | else | |
156 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "$SMBCONFIG") | |
157 | fi | |
158 | ||
ef416fc2 | 159 | dnl Setup default locations... |
160 | # Cache data... | |
161 | AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="") | |
162 | ||
163 | if 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 | 169 | else |
170 | CUPS_CACHEDIR="$cachedir" | |
171 | fi | |
172 | AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR") | |
173 | AC_SUBST(CUPS_CACHEDIR) | |
174 | ||
175 | # Data files | |
176 | CUPS_DATADIR="$datadir/cups" | |
177 | AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups") | |
178 | AC_SUBST(CUPS_DATADIR) | |
179 | ||
f7deaa1a | 180 | # Icon directory |
181 | AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="") | |
182 | ||
183 | if test "x$icondir" = x -a -d /usr/share/icons; then | |
184 | ICONDIR="/usr/share/icons" | |
185 | else | |
186 | ICONDIR="$icondir" | |
187 | fi | |
188 | ||
189 | AC_SUBST(ICONDIR) | |
190 | ||
191 | # Menu directory | |
192 | AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="") | |
193 | ||
194 | if test "x$menudir" = x -a -d /usr/share/applications; then | |
195 | MENUDIR="/usr/share/applications" | |
196 | else | |
197 | MENUDIR="$menudir" | |
198 | fi | |
199 | ||
200 | AC_SUBST(MENUDIR) | |
201 | ||
ef416fc2 | 202 | # Documentation files |
203 | AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="") | |
204 | ||
205 | if test x$docdir = x; then | |
206 | CUPS_DOCROOT="$datadir/doc/cups" | |
207 | docdir="$datadir/doc/cups" | |
208 | else | |
209 | CUPS_DOCROOT="$docdir" | |
210 | fi | |
211 | ||
212 | AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir") | |
213 | AC_SUBST(CUPS_DOCROOT) | |
214 | ||
215 | # Fonts | |
216 | AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="") | |
217 | ||
218 | if test "x$fontpath" = "x"; then | |
219 | CUPS_FONTPATH="$datadir/cups/fonts" | |
220 | else | |
221 | CUPS_FONTPATH="$fontpath" | |
222 | fi | |
223 | ||
224 | AC_SUBST(CUPS_FONTPATH) | |
225 | AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH") | |
226 | ||
2e4ff8af MS |
227 | # Locale data |
228 | if 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 | |
239 | else | |
240 | CUPS_LOCALEDIR="$localedir" | |
241 | fi | |
ef416fc2 | 242 | |
243 | AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR") | |
244 | AC_SUBST(CUPS_LOCALEDIR) | |
245 | ||
246 | # Log files... | |
247 | AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="") | |
248 | ||
249 | if test x$logdir = x; then | |
250 | CUPS_LOGDIR="$localstatedir/log/cups" | |
251 | AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups") | |
252 | else | |
253 | CUPS_LOGDIR="$logdir" | |
254 | fi | |
255 | AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR") | |
256 | AC_SUBST(CUPS_LOGDIR) | |
257 | ||
258 | # Longer-term spool data | |
259 | CUPS_REQUESTS="$localstatedir/spool/cups" | |
260 | AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups") | |
261 | AC_SUBST(CUPS_REQUESTS) | |
262 | ||
263 | # Server executables... | |
105922ec MS |
264 | case "$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 | ;; |
275 | esac | |
276 | ||
277 | AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN") | |
278 | AC_SUBST(CUPS_SERVERBIN) | |
279 | AC_SUBST(INSTALL_SYSV) | |
280 | ||
281 | # Configuration files | |
282 | CUPS_SERVERROOT="$sysconfdir/cups" | |
283 | AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups") | |
284 | AC_SUBST(CUPS_SERVERROOT) | |
285 | ||
286 | # Transient run-time state | |
6961465f | 287 | AC_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 | 298 | AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR") |
ef416fc2 | 299 | AC_SUBST(CUPS_STATEDIR) |