2 dnl "$Id: cups-directories.m4 5023 2006-01-29 14:39:44Z mike $"
4 dnl Directory stuff for the Common UNIX Printing System (CUPS).
6 dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
8 dnl These coded instructions, statements, and computer programs are the
9 dnl property of Easy Software Products and are protected by Federal
10 dnl copyright law. Distribution and use rights are outlined in the file
11 dnl "LICENSE.txt" which should have been included with this file. If this
12 dnl file is missing or damaged please contact Easy Software Products
15 dnl Attn: CUPS Licensing Information
16 dnl Easy Software Products
17 dnl 44141 Airport View Drive, Suite 204
18 dnl Hollywood, Maryland 20636 USA
20 dnl Voice: (301) 373-9600
21 dnl EMail: cups-info@cups.org
22 dnl WWW: http://www.cups.org
27 dnl Fix "prefix" variable if it hasn't been specified...
28 if test "$prefix" = "NONE"; then
32 dnl Fix "exec_prefix" variable if it hasn't been specified...
33 if test "$exec_prefix" = "NONE"; then
34 if test "$prefix" = "/"; then
41 dnl Fix "bindir" variable...
42 if test "$bindir" = "\${exec_prefix}/bin"; then
43 bindir="$exec_prefix/bin"
46 AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir")
48 dnl Fix "sbindir" variable...
49 if test "$sbindir" = "\${exec_prefix}/sbin"; then
50 sbindir="$exec_prefix/sbin"
53 AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir")
55 dnl Fix "sharedstatedir" variable if it hasn't been specified...
56 if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
57 sharedstatedir="/usr/com"
60 dnl Fix "datadir" variable if it hasn't been specified...
61 if test "$datadir" = "\${prefix}/share"; then
62 if test "$prefix" = "/"; then
65 datadir="$prefix/share"
69 dnl Fix "includedir" variable if it hasn't been specified...
70 if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then
71 includedir="/usr/include"
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"
83 localstatedir="$prefix/var"
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"
96 sysconfdir="$prefix/etc"
100 dnl Fix "libdir" variable for IRIX 6.x...
101 if test "$libdir" = "\${exec_prefix}/lib"; then
102 if test "$uname" = "IRIX" -a $uversion -ge 62; then
103 libdir="$exec_prefix/lib32"
105 libdir="$exec_prefix/lib"
109 dnl Setup init.d locations...
110 AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
112 if test x$rcdir = x; then
115 # FreeBSD and OpenBSD
127 # Darwin and MacOS X...
129 AC_CHECK_PROG(INITDDIR, launchd,
130 "/System/Library/LaunchDaemons",
131 "/System/Library/StartupItems/PrintingServices")
135 # Linux/HURD seems to choose an init.d directory at random...
136 if test -d /sbin/init.d; then
138 INITDIR="/sbin/init.d"
141 if test -d /etc/init.d; then
177 dnl Setup default locations...
179 AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
181 if test x$cachedir = x; then
182 if test "x$uname" = xDarwin; then
183 CUPS_CACHEDIR="$localstatedir/tmp/cups"
185 CUPS_CACHEDIR="$localstatedir/cache/cups"
188 CUPS_CACHEDIR="$cachedir"
190 AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
191 AC_SUBST(CUPS_CACHEDIR)
194 CUPS_DATADIR="$datadir/cups"
195 AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
196 AC_SUBST(CUPS_DATADIR)
198 # Documentation files
199 AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
201 if test x$docdir = x; then
202 CUPS_DOCROOT="$datadir/doc/cups"
203 docdir="$datadir/doc/cups"
205 CUPS_DOCROOT="$docdir"
208 AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
209 AC_SUBST(CUPS_DOCROOT)
212 AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
214 if test "x$fontpath" = "x"; then
215 CUPS_FONTPATH="$datadir/cups/fonts"
217 CUPS_FONTPATH="$fontpath"
220 AC_SUBST(CUPS_FONTPATH)
221 AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
225 Linux | GNU | *BSD* | Darwin*)
226 CUPS_LOCALEDIR="$datadir/locale"
230 CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
234 # This is the standard System V location...
235 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
239 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
240 AC_SUBST(CUPS_LOCALEDIR)
243 AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
245 if test x$logdir = x; then
246 CUPS_LOGDIR="$localstatedir/log/cups"
247 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
249 CUPS_LOGDIR="$logdir"
251 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
252 AC_SUBST(CUPS_LOGDIR)
254 # Longer-term spool data
255 CUPS_REQUESTS="$localstatedir/spool/cups"
256 AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
257 AC_SUBST(CUPS_REQUESTS)
259 # Server executables...
262 # *BSD and Darwin (MacOS X)
264 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
268 INSTALL_SYSV="install-sysv"
269 CUPS_SERVERBIN="$libdir/cups"
273 AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
274 AC_SUBST(CUPS_SERVERBIN)
275 AC_SUBST(INSTALL_SYSV)
277 # Configuration files
278 CUPS_SERVERROOT="$sysconfdir/cups"
279 AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
280 AC_SUBST(CUPS_SERVERROOT)
282 # Transient run-time state
283 CUPS_STATEDIR="$localstatedir/run/cups"
284 AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
285 AC_SUBST(CUPS_STATEDIR)
288 dnl End of "$Id: cups-directories.m4 5023 2006-01-29 14:39:44Z mike $".