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