]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
b19ccc9e | 2 | dnl "$Id: cups-directories.m4 7799 2008-07-25 20:06:08Z mike $" |
ef416fc2 | 3 | dnl |
4 | dnl Directory stuff for the Common UNIX Printing System (CUPS). | |
5 | dnl | |
bc44d920 | 6 | dnl Copyright 2007 by Apple Inc. |
f7deaa1a | 7 | dnl Copyright 1997-2007 by Easy Software Products, all rights reserved. |
ef416fc2 | 8 | dnl |
9 | dnl These coded instructions, statements, and computer programs are the | |
bc44d920 | 10 | dnl property of Apple Inc. and are protected by Federal copyright |
11 | dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
12 | dnl which should have been included with this file. If this file is | |
13 | dnl file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 14 | dnl |
15 | ||
16 | AC_PREFIX_DEFAULT(/) | |
17 | ||
18 | dnl Fix "prefix" variable if it hasn't been specified... | |
19 | if test "$prefix" = "NONE"; then | |
20 | prefix="/" | |
21 | fi | |
22 | ||
23 | dnl Fix "exec_prefix" variable if it hasn't been specified... | |
24 | if test "$exec_prefix" = "NONE"; then | |
25 | if test "$prefix" = "/"; then | |
26 | exec_prefix="/usr" | |
27 | else | |
28 | exec_prefix="$prefix" | |
29 | fi | |
30 | fi | |
31 | ||
32 | dnl Fix "bindir" variable... | |
33 | if test "$bindir" = "\${exec_prefix}/bin"; then | |
34 | bindir="$exec_prefix/bin" | |
35 | fi | |
36 | ||
fa73b229 | 37 | AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir") |
38 | ||
ef416fc2 | 39 | dnl Fix "sbindir" variable... |
40 | if test "$sbindir" = "\${exec_prefix}/sbin"; then | |
41 | sbindir="$exec_prefix/sbin" | |
42 | fi | |
43 | ||
fa73b229 | 44 | AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir") |
45 | ||
ef416fc2 | 46 | dnl Fix "sharedstatedir" variable if it hasn't been specified... |
47 | if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then | |
48 | sharedstatedir="/usr/com" | |
49 | fi | |
50 | ||
d09495fa | 51 | dnl Fix "datarootdir" variable if it hasn't been specified... |
52 | if test "$datarootdir" = "\${prefix}/share"; then | |
53 | if test "$prefix" = "/"; then | |
54 | datarootdir="/usr/share" | |
55 | else | |
56 | datarootdir="$prefix/share" | |
57 | fi | |
58 | fi | |
59 | ||
ef416fc2 | 60 | dnl Fix "datadir" variable if it hasn't been specified... |
61 | if test "$datadir" = "\${prefix}/share"; then | |
62 | if test "$prefix" = "/"; then | |
63 | datadir="/usr/share" | |
64 | else | |
65 | datadir="$prefix/share" | |
66 | fi | |
d09495fa | 67 | elif test "$datadir" = "\${datarootdir}"; then |
68 | datadir="$datarootdir" | |
ef416fc2 | 69 | fi |
70 | ||
71 | dnl Fix "includedir" variable if it hasn't been specified... | |
72 | if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then | |
73 | includedir="/usr/include" | |
74 | fi | |
75 | ||
76 | dnl Fix "localstatedir" variable if it hasn't been specified... | |
77 | if test "$localstatedir" = "\${prefix}/var"; then | |
78 | if test "$prefix" = "/"; then | |
79 | if test "$uname" = Darwin; then | |
80 | localstatedir="/private/var" | |
81 | else | |
82 | localstatedir="/var" | |
83 | fi | |
84 | else | |
85 | localstatedir="$prefix/var" | |
86 | fi | |
87 | fi | |
88 | ||
89 | dnl Fix "sysconfdir" variable if it hasn't been specified... | |
90 | if test "$sysconfdir" = "\${prefix}/etc"; then | |
91 | if test "$prefix" = "/"; then | |
92 | if test "$uname" = Darwin; then | |
93 | sysconfdir="/private/etc" | |
94 | else | |
95 | sysconfdir="/etc" | |
96 | fi | |
97 | else | |
98 | sysconfdir="$prefix/etc" | |
99 | fi | |
100 | fi | |
101 | ||
c277e2f8 | 102 | dnl Fix "libdir" variable... |
ef416fc2 | 103 | if test "$libdir" = "\${exec_prefix}/lib"; then |
c277e2f8 MS |
104 | case "$uname" in |
105 | IRIX*) | |
106 | libdir="$exec_prefix/lib32" | |
107 | ;; | |
108 | Linux*) | |
109 | if test -d /usr/lib64; then | |
110 | libdir="$exec_prefix/lib64" | |
111 | fi | |
112 | ;; | |
113 | HP-UX*) | |
114 | if test -d /usr/lib/hpux32; then | |
115 | libdir="$exec_prefix/lib/hpux32" | |
116 | fi | |
117 | ;; | |
118 | esac | |
ef416fc2 | 119 | fi |
120 | ||
121 | dnl Setup init.d locations... | |
122 | AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="") | |
f7deaa1a | 123 | AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5") |
124 | AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="99") | |
125 | AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="00") | |
749b1e90 | 126 | AC_ARG_WITH(smfmanifestdir, [ --with-smfmanifestdir set path for Solaris SMF manifest],smfmanifestdir="$withval",smfmanifestdir="") |
f7deaa1a | 127 | |
128 | INITDIR="" | |
129 | INITDDIR="" | |
130 | RCLEVELS="$rclevels" | |
131 | RCSTART="$rcstart" | |
132 | RCSTOP="$rcstop" | |
749b1e90 | 133 | SMFMANIFESTDIR="" |
ef416fc2 | 134 | |
135 | if test x$rcdir = x; then | |
136 | case "$uname" in | |
f7deaa1a | 137 | AIX*) |
138 | INITDIR="/etc/rc.d" | |
ef416fc2 | 139 | ;; |
140 | ||
141 | Darwin*) | |
142 | # Darwin and MacOS X... | |
f301802f | 143 | if test -x /sbin/launchd; then |
144 | INITDDIR="/System/Library/LaunchDaemons" | |
145 | else | |
146 | INITDDIR="/System/Library/StartupItems/PrintingServices" | |
147 | fi | |
ef416fc2 | 148 | ;; |
149 | ||
7594b224 | 150 | FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*) |
f7deaa1a | 151 | # FreeBSD and OpenBSD |
152 | ;; | |
153 | ||
154 | HP-UX*) | |
155 | INITDIR="/sbin" | |
156 | RCLEVELS="2" | |
c277e2f8 MS |
157 | RCSTART="380" |
158 | RCSTOP="620" | |
f7deaa1a | 159 | ;; |
160 | ||
161 | IRIX*) | |
162 | # IRIX | |
163 | INITDIR="/etc" | |
164 | RCSTART="60" | |
165 | RCSTOP="25" | |
166 | ;; | |
167 | ||
2e4ff8af | 168 | Linux | GNU | GNU/k*BSD*) |
ef416fc2 | 169 | # Linux/HURD seems to choose an init.d directory at random... |
170 | if test -d /sbin/init.d; then | |
171 | # SuSE | |
172 | INITDIR="/sbin/init.d" | |
ef416fc2 | 173 | else |
174 | if test -d /etc/init.d; then | |
175 | # Others | |
176 | INITDIR="/etc" | |
ef416fc2 | 177 | else |
178 | # RedHat | |
179 | INITDIR="/etc/rc.d" | |
ef416fc2 | 180 | fi |
181 | fi | |
f7deaa1a | 182 | RCSTART="81" |
183 | RCSTOP="36" | |
ef416fc2 | 184 | ;; |
185 | ||
f7deaa1a | 186 | NetBSD*) |
187 | # NetBSD | |
188 | INITDDIR="/etc/rc.d" | |
189 | ;; | |
190 | ||
191 | OSF1*) | |
ef416fc2 | 192 | INITDIR="/sbin" |
ef416fc2 | 193 | ;; |
194 | ||
f7deaa1a | 195 | SunOS*) |
196 | # Solaris | |
749b1e90 MS |
197 | if test "x$smfmanifestdir" != x; then |
198 | SMFMANIFESTDIR=$smfmanifestdir | |
199 | else | |
200 | INITDIR="/etc" | |
201 | RCSTART="81" | |
202 | fi | |
ef416fc2 | 203 | ;; |
204 | ||
205 | *) | |
206 | INITDIR="/etc" | |
ef416fc2 | 207 | ;; |
208 | ||
209 | esac | |
210 | else | |
f7deaa1a | 211 | if test "x$rclevels" = x; then |
212 | INITDDIR="$rcdir" | |
213 | else | |
214 | INITDIR="$rcdir" | |
215 | fi | |
ef416fc2 | 216 | fi |
217 | ||
218 | AC_SUBST(INITDIR) | |
219 | AC_SUBST(INITDDIR) | |
f7deaa1a | 220 | AC_SUBST(RCLEVELS) |
221 | AC_SUBST(RCSTART) | |
222 | AC_SUBST(RCSTOP) | |
749b1e90 | 223 | AC_SUBST(SMFMANIFESTDIR) |
ef416fc2 | 224 | |
e1d6a774 | 225 | dnl Xinetd support... |
f7deaa1a | 226 | AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],XINETD="$withval",XINETD="") |
d09495fa | 227 | |
f7deaa1a | 228 | if test "x$XINETD" = x -a ! -x /sbin/launchd; then |
d09495fa | 229 | for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do |
230 | if test -d $dir; then | |
231 | XINETD="$dir" | |
232 | break | |
233 | fi | |
234 | done | |
235 | fi | |
e1d6a774 | 236 | |
237 | AC_SUBST(XINETD) | |
238 | ||
2e4ff8af MS |
239 | dnl LPD sharing support... |
240 | AC_ARG_WITH(lpdconfig, [ --with-lpdconfig set URI for LPD config file], | |
241 | LPDCONFIG="$withval", LPDCONFIG="") | |
242 | ||
243 | if test "x$LPDCONFIG" = x; then | |
244 | if test -f /System/Library/LaunchDaemons/org.cups.cups-lpd.plist; then | |
245 | LPDCONFIG="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist" | |
246 | elif test "x$XINETD" != x; then | |
247 | LPDCONFIG="xinetd://$XINETD/cups-lpd" | |
248 | fi | |
249 | fi | |
250 | ||
251 | if test "x$LPDCONFIG" = xoff; then | |
252 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "") | |
253 | else | |
254 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "$LPDCONFIG") | |
255 | fi | |
256 | ||
257 | dnl SMB sharing support... | |
258 | AC_ARG_WITH(smbconfig, [ --with-smbconfig set URI for Samba config file], | |
259 | SMBCONFIG="$withval", SMBCONFIG="") | |
260 | ||
261 | if test "x$SMBCONFIG" = x; then | |
262 | if test -f /System/Library/LaunchDaemons/smbd.plist; then | |
263 | SMBCONFIG="launchd:///System/Library/LaunchDaemons/smbd.plist" | |
264 | else | |
265 | for dir in /etc /etc/samba /usr/local/etc; do | |
266 | if test -f $dir/smb.conf; then | |
267 | SMBCONFIG="samba://$dir/smb.conf" | |
268 | break | |
269 | fi | |
270 | done | |
271 | fi | |
272 | fi | |
273 | ||
274 | if test "x$SMBCONFIG" = xoff; then | |
275 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "") | |
276 | else | |
277 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "$SMBCONFIG") | |
278 | fi | |
279 | ||
ef416fc2 | 280 | dnl Setup default locations... |
281 | # Cache data... | |
282 | AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="") | |
283 | ||
284 | if test x$cachedir = x; then | |
a4d04587 | 285 | if test "x$uname" = xDarwin; then |
d09495fa | 286 | CUPS_CACHEDIR="$localstatedir/spool/cups/cache" |
a4d04587 | 287 | else |
288 | CUPS_CACHEDIR="$localstatedir/cache/cups" | |
289 | fi | |
ef416fc2 | 290 | else |
291 | CUPS_CACHEDIR="$cachedir" | |
292 | fi | |
293 | AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR") | |
294 | AC_SUBST(CUPS_CACHEDIR) | |
295 | ||
296 | # Data files | |
297 | CUPS_DATADIR="$datadir/cups" | |
298 | AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups") | |
299 | AC_SUBST(CUPS_DATADIR) | |
300 | ||
f7deaa1a | 301 | # Icon directory |
302 | AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="") | |
303 | ||
304 | if test "x$icondir" = x -a -d /usr/share/icons; then | |
305 | ICONDIR="/usr/share/icons" | |
306 | else | |
307 | ICONDIR="$icondir" | |
308 | fi | |
309 | ||
310 | AC_SUBST(ICONDIR) | |
311 | ||
312 | # Menu directory | |
313 | AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="") | |
314 | ||
315 | if test "x$menudir" = x -a -d /usr/share/applications; then | |
316 | MENUDIR="/usr/share/applications" | |
317 | else | |
318 | MENUDIR="$menudir" | |
319 | fi | |
320 | ||
321 | AC_SUBST(MENUDIR) | |
322 | ||
ef416fc2 | 323 | # Documentation files |
324 | AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="") | |
325 | ||
326 | if test x$docdir = x; then | |
327 | CUPS_DOCROOT="$datadir/doc/cups" | |
328 | docdir="$datadir/doc/cups" | |
329 | else | |
330 | CUPS_DOCROOT="$docdir" | |
331 | fi | |
332 | ||
333 | AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir") | |
334 | AC_SUBST(CUPS_DOCROOT) | |
335 | ||
336 | # Fonts | |
337 | AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="") | |
338 | ||
339 | if test "x$fontpath" = "x"; then | |
340 | CUPS_FONTPATH="$datadir/cups/fonts" | |
341 | else | |
342 | CUPS_FONTPATH="$fontpath" | |
343 | fi | |
344 | ||
345 | AC_SUBST(CUPS_FONTPATH) | |
346 | AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH") | |
347 | ||
2e4ff8af MS |
348 | # Locale data |
349 | if test "$localedir" = "\${datarootdir}/locale"; then | |
db1f069b MS |
350 | case "$uname" in |
351 | Linux | GNU | *BSD* | Darwin*) | |
2e4ff8af | 352 | CUPS_LOCALEDIR="$datarootdir/locale" |
db1f069b | 353 | ;; |
ef416fc2 | 354 | |
db1f069b MS |
355 | OSF1* | AIX*) |
356 | CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg" | |
357 | ;; | |
ef416fc2 | 358 | |
db1f069b MS |
359 | *) |
360 | # This is the standard System V location... | |
361 | CUPS_LOCALEDIR="$exec_prefix/lib/locale" | |
362 | ;; | |
363 | esac | |
364 | else | |
365 | CUPS_LOCALEDIR="$localedir" | |
366 | fi | |
ef416fc2 | 367 | |
368 | AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR") | |
369 | AC_SUBST(CUPS_LOCALEDIR) | |
370 | ||
371 | # Log files... | |
372 | AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="") | |
373 | ||
374 | if test x$logdir = x; then | |
375 | CUPS_LOGDIR="$localstatedir/log/cups" | |
376 | AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups") | |
377 | else | |
378 | CUPS_LOGDIR="$logdir" | |
379 | fi | |
380 | AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR") | |
381 | AC_SUBST(CUPS_LOGDIR) | |
382 | ||
383 | # Longer-term spool data | |
384 | CUPS_REQUESTS="$localstatedir/spool/cups" | |
385 | AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups") | |
386 | AC_SUBST(CUPS_REQUESTS) | |
387 | ||
388 | # Server executables... | |
389 | case "$uname" in | |
390 | *BSD* | Darwin*) | |
391 | # *BSD and Darwin (MacOS X) | |
392 | INSTALL_SYSV="" | |
393 | CUPS_SERVERBIN="$exec_prefix/libexec/cups" | |
394 | ;; | |
395 | *) | |
396 | # All others | |
397 | INSTALL_SYSV="install-sysv" | |
e1d6a774 | 398 | CUPS_SERVERBIN="$exec_prefix/lib/cups" |
ef416fc2 | 399 | ;; |
400 | esac | |
401 | ||
402 | AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN") | |
403 | AC_SUBST(CUPS_SERVERBIN) | |
404 | AC_SUBST(INSTALL_SYSV) | |
405 | ||
406 | # Configuration files | |
407 | CUPS_SERVERROOT="$sysconfdir/cups" | |
408 | AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups") | |
409 | AC_SUBST(CUPS_SERVERROOT) | |
410 | ||
411 | # Transient run-time state | |
412 | CUPS_STATEDIR="$localstatedir/run/cups" | |
413 | AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups") | |
414 | AC_SUBST(CUPS_STATEDIR) | |
415 | ||
416 | dnl | |
b19ccc9e | 417 | dnl End of "$Id: cups-directories.m4 7799 2008-07-25 20:06:08Z mike $". |
ef416fc2 | 418 | dnl |