2 dnl "$Id: cups-directories.m4 6332 2007-03-12 16:08:51Z mike $"
4 dnl Directory stuff for the Common UNIX Printing System (CUPS).
6 dnl Copyright 1997-2007 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 "datarootdir" variable if it hasn't been specified...
61 if test "$datarootdir" = "\${prefix}/share"; then
62 if test "$prefix" = "/"; then
63 datarootdir="/usr/share"
65 datarootdir="$prefix/share"
69 dnl Fix "datadir" variable if it hasn't been specified...
70 if test "$datadir" = "\${prefix}/share"; then
71 if test "$prefix" = "/"; then
74 datadir="$prefix/share"
76 elif test "$datadir" = "\${datarootdir}"; then
77 datadir="$datarootdir"
80 dnl Fix "includedir" variable if it hasn't been specified...
81 if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then
82 includedir="/usr/include"
85 dnl Fix "localstatedir" variable if it hasn't been specified...
86 if test "$localstatedir" = "\${prefix}/var"; then
87 if test "$prefix" = "/"; then
88 if test "$uname" = Darwin; then
89 localstatedir="/private/var"
94 localstatedir="$prefix/var"
98 dnl Fix "sysconfdir" variable if it hasn't been specified...
99 if test "$sysconfdir" = "\${prefix}/etc"; then
100 if test "$prefix" = "/"; then
101 if test "$uname" = Darwin; then
102 sysconfdir="/private/etc"
107 sysconfdir="$prefix/etc"
111 dnl Fix "libdir" variable for IRIX 6.x...
112 if test "$libdir" = "\${exec_prefix}/lib"; then
113 if test "$uname" = "IRIX"; then
114 libdir="$exec_prefix/lib32"
116 if test "$uname" = Linux -a -d /usr/lib64; then
117 libdir="$exec_prefix/lib64"
119 libdir="$exec_prefix/lib"
124 dnl Setup init.d locations...
125 AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
126 AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
127 AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="99")
128 AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="00")
136 if test x$rcdir = x; then
143 # Darwin and MacOS X...
144 if test -x /sbin/launchd; then
145 INITDDIR="/System/Library/LaunchDaemons"
147 INITDDIR="/System/Library/StartupItems/PrintingServices"
151 FreeBSD* | OpenBSD* | MirBsD* | ekkoBSD*)
152 # FreeBSD and OpenBSD
170 # Linux/HURD seems to choose an init.d directory at random...
171 if test -d /sbin/init.d; then
173 INITDIR="/sbin/init.d"
175 if test -d /etc/init.d; then
208 if test "x$rclevels" = x; then
221 dnl Xinetd support...
222 AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],XINETD="$withval",XINETD="")
224 if test "x$XINETD" = x -a ! -x /sbin/launchd; then
225 for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
226 if test -d $dir; then
235 dnl Setup default locations...
237 AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
239 if test x$cachedir = x; then
240 if test "x$uname" = xDarwin; then
241 CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
243 CUPS_CACHEDIR="$localstatedir/cache/cups"
246 CUPS_CACHEDIR="$cachedir"
248 AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
249 AC_SUBST(CUPS_CACHEDIR)
252 CUPS_DATADIR="$datadir/cups"
253 AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
254 AC_SUBST(CUPS_DATADIR)
257 AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="")
259 if test "x$icondir" = x -a -d /usr/share/icons; then
260 ICONDIR="/usr/share/icons"
268 AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="")
270 if test "x$menudir" = x -a -d /usr/share/applications; then
271 MENUDIR="/usr/share/applications"
278 # Documentation files
279 AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
281 if test x$docdir = x; then
282 CUPS_DOCROOT="$datadir/doc/cups"
283 docdir="$datadir/doc/cups"
285 CUPS_DOCROOT="$docdir"
288 AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
289 AC_SUBST(CUPS_DOCROOT)
292 AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
294 if test "x$fontpath" = "x"; then
295 CUPS_FONTPATH="$datadir/cups/fonts"
297 CUPS_FONTPATH="$fontpath"
300 AC_SUBST(CUPS_FONTPATH)
301 AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
305 Linux | GNU | *BSD* | Darwin*)
306 CUPS_LOCALEDIR="$datadir/locale"
310 CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
314 # This is the standard System V location...
315 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
319 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
320 AC_SUBST(CUPS_LOCALEDIR)
323 AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
325 if test x$logdir = x; then
326 CUPS_LOGDIR="$localstatedir/log/cups"
327 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
329 CUPS_LOGDIR="$logdir"
331 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
332 AC_SUBST(CUPS_LOGDIR)
334 # Longer-term spool data
335 CUPS_REQUESTS="$localstatedir/spool/cups"
336 AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
337 AC_SUBST(CUPS_REQUESTS)
339 # Server executables...
342 # *BSD and Darwin (MacOS X)
344 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
348 INSTALL_SYSV="install-sysv"
349 CUPS_SERVERBIN="$exec_prefix/lib/cups"
353 AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
354 AC_SUBST(CUPS_SERVERBIN)
355 AC_SUBST(INSTALL_SYSV)
357 # Configuration files
358 CUPS_SERVERROOT="$sysconfdir/cups"
359 AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
360 AC_SUBST(CUPS_SERVERROOT)
362 # Transient run-time state
363 CUPS_STATEDIR="$localstatedir/run/cups"
364 AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
365 AC_SUBST(CUPS_STATEDIR)
368 dnl End of "$Id: cups-directories.m4 6332 2007-03-12 16:08:51Z mike $".