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