]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-directories.m4
Merge changes from CUPS 1.5svn-r9062.
[thirdparty/cups.git] / config-scripts / cups-directories.m4
CommitLineData
ef416fc2 1dnl
b19ccc9e 2dnl "$Id: cups-directories.m4 7799 2008-07-25 20:06:08Z mike $"
ef416fc2 3dnl
4dnl Directory stuff for the Common UNIX Printing System (CUPS).
5dnl
bc44d920 6dnl Copyright 2007 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
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 119fi
120
71e16022 121dnl Setup private include directory...
5180a04c 122AC_ARG_WITH(privateinclude, [ --with-privateinclude set path for private include files, default=none],privateinclude="$withval",privateinclude="")
71e16022
MS
123if test "x$privateinclude" != x -a "x$privateinclude" != xnone; then
124 PRIVATEINCLUDE="$privateinclude/cups"
125else
126 privateinclude=""
127 PRIVATEINCLUDE=""
128fi
129AC_SUBST(privateinclude)
130AC_SUBST(PRIVATEINCLUDE)
131
ef416fc2 132dnl Setup init.d locations...
133AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
f7deaa1a 134AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
135AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="99")
136AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="00")
749b1e90 137AC_ARG_WITH(smfmanifestdir, [ --with-smfmanifestdir set path for Solaris SMF manifest],smfmanifestdir="$withval",smfmanifestdir="")
f7deaa1a 138
139INITDIR=""
140INITDDIR=""
141RCLEVELS="$rclevels"
142RCSTART="$rcstart"
143RCSTOP="$rcstop"
749b1e90 144SMFMANIFESTDIR=""
ef416fc2 145
146if test x$rcdir = x; then
147 case "$uname" in
f7deaa1a 148 AIX*)
149 INITDIR="/etc/rc.d"
ef416fc2 150 ;;
151
152 Darwin*)
153 # Darwin and MacOS X...
f301802f 154 if test -x /sbin/launchd; then
155 INITDDIR="/System/Library/LaunchDaemons"
156 else
157 INITDDIR="/System/Library/StartupItems/PrintingServices"
158 fi
ef416fc2 159 ;;
160
7594b224 161 FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*)
f7deaa1a 162 # FreeBSD and OpenBSD
163 ;;
164
165 HP-UX*)
166 INITDIR="/sbin"
167 RCLEVELS="2"
c277e2f8
MS
168 RCSTART="380"
169 RCSTOP="620"
f7deaa1a 170 ;;
171
172 IRIX*)
173 # IRIX
174 INITDIR="/etc"
175 RCSTART="60"
176 RCSTOP="25"
177 ;;
178
2e4ff8af 179 Linux | GNU | GNU/k*BSD*)
ef416fc2 180 # Linux/HURD seems to choose an init.d directory at random...
181 if test -d /sbin/init.d; then
182 # SuSE
183 INITDIR="/sbin/init.d"
ef416fc2 184 else
185 if test -d /etc/init.d; then
186 # Others
187 INITDIR="/etc"
ef416fc2 188 else
189 # RedHat
190 INITDIR="/etc/rc.d"
ef416fc2 191 fi
192 fi
f7deaa1a 193 RCSTART="81"
194 RCSTOP="36"
ef416fc2 195 ;;
196
f7deaa1a 197 NetBSD*)
198 # NetBSD
199 INITDDIR="/etc/rc.d"
200 ;;
201
202 OSF1*)
ef416fc2 203 INITDIR="/sbin"
ef416fc2 204 ;;
205
f7deaa1a 206 SunOS*)
207 # Solaris
749b1e90
MS
208 if test "x$smfmanifestdir" != x; then
209 SMFMANIFESTDIR=$smfmanifestdir
210 else
211 INITDIR="/etc"
212 RCSTART="81"
213 fi
ef416fc2 214 ;;
215
216 *)
217 INITDIR="/etc"
ef416fc2 218 ;;
219
220 esac
e4572d57 221elif test "x$rcdir" != xno; then
f7deaa1a 222 if test "x$rclevels" = x; then
223 INITDDIR="$rcdir"
224 else
225 INITDIR="$rcdir"
226 fi
ef416fc2 227fi
228
229AC_SUBST(INITDIR)
230AC_SUBST(INITDDIR)
f7deaa1a 231AC_SUBST(RCLEVELS)
232AC_SUBST(RCSTART)
233AC_SUBST(RCSTOP)
749b1e90 234AC_SUBST(SMFMANIFESTDIR)
ef416fc2 235
e1d6a774 236dnl Xinetd support...
f7deaa1a 237AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],XINETD="$withval",XINETD="")
d09495fa 238
f7deaa1a 239if test "x$XINETD" = x -a ! -x /sbin/launchd; then
d09495fa 240 for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
241 if test -d $dir; then
242 XINETD="$dir"
243 break
244 fi
245 done
e4572d57
MS
246elif test "x$XINETD" = xno; then
247 XINETD=""
d09495fa 248fi
e1d6a774 249
250AC_SUBST(XINETD)
251
2e4ff8af
MS
252dnl LPD sharing support...
253AC_ARG_WITH(lpdconfig, [ --with-lpdconfig set URI for LPD config file],
254 LPDCONFIG="$withval", LPDCONFIG="")
255
256if test "x$LPDCONFIG" = x; then
257 if test -f /System/Library/LaunchDaemons/org.cups.cups-lpd.plist; then
258 LPDCONFIG="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
259 elif test "x$XINETD" != x; then
260 LPDCONFIG="xinetd://$XINETD/cups-lpd"
261 fi
262fi
263
264if test "x$LPDCONFIG" = xoff; then
265 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "")
266else
267 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "$LPDCONFIG")
268fi
269
270dnl SMB sharing support...
271AC_ARG_WITH(smbconfig, [ --with-smbconfig set URI for Samba config file],
272 SMBCONFIG="$withval", SMBCONFIG="")
273
274if test "x$SMBCONFIG" = x; then
275 if test -f /System/Library/LaunchDaemons/smbd.plist; then
276 SMBCONFIG="launchd:///System/Library/LaunchDaemons/smbd.plist"
277 else
278 for dir in /etc /etc/samba /usr/local/etc; do
279 if test -f $dir/smb.conf; then
280 SMBCONFIG="samba://$dir/smb.conf"
281 break
282 fi
283 done
284 fi
285fi
286
287if test "x$SMBCONFIG" = xoff; then
288 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "")
289else
290 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "$SMBCONFIG")
291fi
292
ef416fc2 293dnl Setup default locations...
294# Cache data...
295AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
296
297if test x$cachedir = x; then
a4d04587 298 if test "x$uname" = xDarwin; then
d09495fa 299 CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
a4d04587 300 else
301 CUPS_CACHEDIR="$localstatedir/cache/cups"
302 fi
ef416fc2 303else
304 CUPS_CACHEDIR="$cachedir"
305fi
306AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
307AC_SUBST(CUPS_CACHEDIR)
308
309# Data files
310CUPS_DATADIR="$datadir/cups"
311AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
312AC_SUBST(CUPS_DATADIR)
313
f7deaa1a 314# Icon directory
315AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="")
316
317if test "x$icondir" = x -a -d /usr/share/icons; then
318 ICONDIR="/usr/share/icons"
319else
320 ICONDIR="$icondir"
321fi
322
323AC_SUBST(ICONDIR)
324
325# Menu directory
326AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="")
327
328if test "x$menudir" = x -a -d /usr/share/applications; then
329 MENUDIR="/usr/share/applications"
330else
331 MENUDIR="$menudir"
332fi
333
334AC_SUBST(MENUDIR)
335
ef416fc2 336# Documentation files
337AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
338
339if test x$docdir = x; then
340 CUPS_DOCROOT="$datadir/doc/cups"
341 docdir="$datadir/doc/cups"
342else
343 CUPS_DOCROOT="$docdir"
344fi
345
346AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
347AC_SUBST(CUPS_DOCROOT)
348
349# Fonts
350AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
351
352if test "x$fontpath" = "x"; then
353 CUPS_FONTPATH="$datadir/cups/fonts"
354else
355 CUPS_FONTPATH="$fontpath"
356fi
357
358AC_SUBST(CUPS_FONTPATH)
359AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
360
2e4ff8af
MS
361# Locale data
362if test "$localedir" = "\${datarootdir}/locale"; then
db1f069b
MS
363 case "$uname" in
364 Linux | GNU | *BSD* | Darwin*)
2e4ff8af 365 CUPS_LOCALEDIR="$datarootdir/locale"
db1f069b 366 ;;
ef416fc2 367
db1f069b
MS
368 OSF1* | AIX*)
369 CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
370 ;;
ef416fc2 371
db1f069b
MS
372 *)
373 # This is the standard System V location...
374 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
375 ;;
376 esac
377else
378 CUPS_LOCALEDIR="$localedir"
379fi
ef416fc2 380
381AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
382AC_SUBST(CUPS_LOCALEDIR)
383
384# Log files...
385AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
386
387if test x$logdir = x; then
388 CUPS_LOGDIR="$localstatedir/log/cups"
389 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
390else
391 CUPS_LOGDIR="$logdir"
392fi
393AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
394AC_SUBST(CUPS_LOGDIR)
395
396# Longer-term spool data
397CUPS_REQUESTS="$localstatedir/spool/cups"
398AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
399AC_SUBST(CUPS_REQUESTS)
400
401# Server executables...
402case "$uname" in
403 *BSD* | Darwin*)
404 # *BSD and Darwin (MacOS X)
405 INSTALL_SYSV=""
406 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
407 ;;
408 *)
409 # All others
410 INSTALL_SYSV="install-sysv"
e1d6a774 411 CUPS_SERVERBIN="$exec_prefix/lib/cups"
ef416fc2 412 ;;
413esac
414
415AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
416AC_SUBST(CUPS_SERVERBIN)
417AC_SUBST(INSTALL_SYSV)
418
419# Configuration files
420CUPS_SERVERROOT="$sysconfdir/cups"
421AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
422AC_SUBST(CUPS_SERVERROOT)
423
424# Transient run-time state
e07d4801
MS
425case "$uname" in
426 Darwin*)
427 # Darwin (Mac OS X)
428 CUPS_STATEDIR="$CUPS_SERVERROOT"
429 ;;
430 *)
431 # All others
432 CUPS_STATEDIR="$localstatedir/run/cups"
433 ;;
434esac
435AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
ef416fc2 436AC_SUBST(CUPS_STATEDIR)
437
438dnl
b19ccc9e 439dnl End of "$Id: cups-directories.m4 7799 2008-07-25 20:06:08Z mike $".
ef416fc2 440dnl