2 dnl "$Id: cups-directories.m4 177 2006-06-21 00:20:03Z jlovell $"
4 dnl Directory stuff for the Common UNIX Printing System (CUPS).
6 dnl Copyright 1997-2006 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"; then
103 libdir="$exec_prefix/lib32"
105 if test "$uname" = Linux -a -d /usr/lib64; then
106 libdir="$exec_prefix/lib64"
108 libdir="$exec_prefix/lib"
113 dnl Setup init.d locations...
114 AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
116 if test x$rcdir = x; then
119 # FreeBSD and OpenBSD
131 # Darwin and MacOS X...
133 if test -x /sbin/launchd; then
134 INITDDIR="/System/Library/LaunchDaemons"
136 INITDDIR="/System/Library/StartupItems/PrintingServices"
141 # Linux/HURD seems to choose an init.d directory at random...
142 if test -d /sbin/init.d; then
144 INITDIR="/sbin/init.d"
147 if test -d /etc/init.d; then
183 dnl Xinetd support...
185 for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
186 if test -d $dir; then
194 dnl Setup default locations...
196 AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
198 if test x$cachedir = x; then
199 if test "x$uname" = xDarwin; then
200 CUPS_CACHEDIR="$localstatedir/tmp/cups"
202 CUPS_CACHEDIR="$localstatedir/cache/cups"
205 CUPS_CACHEDIR="$cachedir"
207 AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
208 AC_SUBST(CUPS_CACHEDIR)
211 CUPS_DATADIR="$datadir/cups"
212 AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
213 AC_SUBST(CUPS_DATADIR)
215 # Documentation files
216 AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
218 if test x$docdir = x; then
219 CUPS_DOCROOT="$datadir/doc/cups"
220 docdir="$datadir/doc/cups"
222 CUPS_DOCROOT="$docdir"
225 AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
226 AC_SUBST(CUPS_DOCROOT)
229 AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
231 if test "x$fontpath" = "x"; then
232 CUPS_FONTPATH="$datadir/cups/fonts"
234 CUPS_FONTPATH="$fontpath"
237 AC_SUBST(CUPS_FONTPATH)
238 AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
242 Linux | GNU | *BSD* | Darwin*)
243 CUPS_LOCALEDIR="$datadir/locale"
247 CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
251 # This is the standard System V location...
252 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
256 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
257 AC_SUBST(CUPS_LOCALEDIR)
260 AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
262 if test x$logdir = x; then
263 CUPS_LOGDIR="$localstatedir/log/cups"
264 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
266 CUPS_LOGDIR="$logdir"
268 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
269 AC_SUBST(CUPS_LOGDIR)
271 # Longer-term spool data
272 CUPS_REQUESTS="$localstatedir/spool/cups"
273 AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
274 AC_SUBST(CUPS_REQUESTS)
276 # Server executables...
279 # *BSD and Darwin (MacOS X)
281 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
285 INSTALL_SYSV="install-sysv"
286 CUPS_SERVERBIN="$exec_prefix/lib/cups"
290 AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
291 AC_SUBST(CUPS_SERVERBIN)
292 AC_SUBST(INSTALL_SYSV)
294 # Configuration files
295 CUPS_SERVERROOT="$sysconfdir/cups"
296 AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
297 AC_SUBST(CUPS_SERVERROOT)
299 # Transient run-time state
300 CUPS_STATEDIR="$localstatedir/run/cups"
301 AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
302 AC_SUBST(CUPS_STATEDIR)
305 dnl End of "$Id: cups-directories.m4 177 2006-06-21 00:20:03Z jlovell $".