4 dnl Directory stuff for CUPS.
6 dnl Copyright 2007-2011 by Apple Inc.
7 dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
9 dnl These coded instructions, statements, and computer programs are the
10 dnl property of Apple Inc. and are protected by Federal copyright
11 dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 dnl which should have been included with this file. If this file is
13 dnl file is missing or damaged, see the license at "http://www.cups.org/".
18 dnl Fix "prefix" variable if it hasn't been specified...
19 if test "$prefix" = "NONE"; then
23 dnl Fix "exec_prefix" variable if it hasn't been specified...
24 if test "$exec_prefix" = "NONE"; then
25 if test "$prefix" = "/"; then
32 dnl Fix "bindir" variable...
33 if test "$bindir" = "\${exec_prefix}/bin"; then
34 bindir="$exec_prefix/bin"
37 AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir")
39 dnl Fix "sbindir" variable...
40 if test "$sbindir" = "\${exec_prefix}/sbin"; then
41 sbindir="$exec_prefix/sbin"
44 AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir")
46 dnl Fix "sharedstatedir" variable if it hasn't been specified...
47 if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
48 sharedstatedir="/usr/com"
51 dnl Fix "datarootdir" variable if it hasn't been specified...
52 if test "$datarootdir" = "\${prefix}/share"; then
53 if test "$prefix" = "/"; then
54 datarootdir="/usr/share"
56 datarootdir="$prefix/share"
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"
67 elif test "$datadir" = "\${datarootdir}"; then
68 datadir="$datarootdir"
71 dnl Fix "includedir" variable if it hasn't been specified...
72 if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then
73 includedir="/usr/include"
76 dnl Fix "localstatedir" variable if it hasn't been specified...
77 if test "$localstatedir" = "\${prefix}/var"; then
78 if test "$prefix" = "/"; then
79 if test "$uname" = Darwin; then
80 localstatedir="/private/var"
85 localstatedir="$prefix/var"
89 dnl Fix "sysconfdir" variable if it hasn't been specified...
90 if test "$sysconfdir" = "\${prefix}/etc"; then
91 if test "$prefix" = "/"; then
92 if test "$uname" = Darwin; then
93 sysconfdir="/private/etc"
98 sysconfdir="$prefix/etc"
102 dnl Fix "libdir" variable...
103 if test "$libdir" = "\${exec_prefix}/lib"; then
106 libdir="$exec_prefix/lib32"
109 if test -d /usr/lib64; then
110 libdir="$exec_prefix/lib64"
114 if test -d /usr/lib/hpux32; then
115 libdir="$exec_prefix/lib/hpux32"
121 dnl Setup private include directory...
122 AC_ARG_WITH(privateinclude, [ --with-privateinclude set path for private include files, default=none],privateinclude="$withval",privateinclude="")
123 if test "x$privateinclude" != x -a "x$privateinclude" != xnone; then
124 PRIVATEINCLUDE="$privateinclude/cups"
129 AC_SUBST(privateinclude)
130 AC_SUBST(PRIVATEINCLUDE)
132 dnl Setup init.d locations...
133 AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
134 AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
135 AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="99")
136 AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="00")
137 AC_ARG_WITH(smfmanifestdir, [ --with-smfmanifestdir set path for Solaris SMF manifest],smfmanifestdir="$withval",smfmanifestdir="")
146 if test x$rcdir = x; then
153 # Darwin and MacOS X...
154 if test -x /sbin/launchd; then
155 INITDDIR="/System/Library/LaunchDaemons"
157 INITDDIR="/System/Library/StartupItems/PrintingServices"
161 FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*)
162 # FreeBSD and OpenBSD
179 Linux | GNU | GNU/k*BSD*)
180 # Linux/HURD seems to choose an init.d directory at random...
181 if test -d /sbin/init.d; then
183 INITDIR="/sbin/init.d"
185 if test -d /etc/init.d; then
208 if test "x$smfmanifestdir" != x; then
209 SMFMANIFESTDIR=$smfmanifestdir
221 elif test "x$rcdir" != xno; then
222 if test "x$rclevels" = x; then
234 AC_SUBST(SMFMANIFESTDIR)
236 dnl Xinetd support...
237 AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],XINETD="$withval",XINETD="")
239 if test "x$XINETD" = x -a ! -x /sbin/launchd; then
240 for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
241 if test -d $dir; then
246 elif test "x$XINETD" = xno; then
252 dnl LPD sharing support...
253 AC_ARG_WITH(lpdconfig, [ --with-lpdconfig set URI for LPD config file],
254 LPDCONFIG="$withval", LPDCONFIG="")
256 if 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"
264 if test "x$LPDCONFIG" = xoff; then
265 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "")
267 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "$LPDCONFIG")
270 dnl SMB sharing support...
271 AC_ARG_WITH(smbconfig, [ --with-smbconfig set URI for Samba config file],
272 SMBCONFIG="$withval", SMBCONFIG="")
274 if test "x$SMBCONFIG" = x; then
275 if test -f /System/Library/LaunchDaemons/smbd.plist; then
276 SMBCONFIG="launchd:///System/Library/LaunchDaemons/smbd.plist"
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"
287 if test "x$SMBCONFIG" = xoff; then
288 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "")
290 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "$SMBCONFIG")
293 dnl Setup default locations...
295 AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
297 if test x$cachedir = x; then
298 if test "x$uname" = xDarwin; then
299 CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
301 CUPS_CACHEDIR="$localstatedir/cache/cups"
304 CUPS_CACHEDIR="$cachedir"
306 AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
307 AC_SUBST(CUPS_CACHEDIR)
310 CUPS_DATADIR="$datadir/cups"
311 AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
312 AC_SUBST(CUPS_DATADIR)
315 AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="")
317 if test "x$icondir" = x -a -d /usr/share/icons; then
318 ICONDIR="/usr/share/icons"
326 AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="")
328 if test "x$menudir" = x -a -d /usr/share/applications; then
329 MENUDIR="/usr/share/applications"
336 # Documentation files
337 AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
339 if test x$docdir = x; then
340 CUPS_DOCROOT="$datadir/doc/cups"
341 docdir="$datadir/doc/cups"
343 CUPS_DOCROOT="$docdir"
346 AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
347 AC_SUBST(CUPS_DOCROOT)
350 AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
352 if test "x$fontpath" = "x"; then
353 CUPS_FONTPATH="$datadir/cups/fonts"
355 CUPS_FONTPATH="$fontpath"
358 AC_SUBST(CUPS_FONTPATH)
359 AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
362 if test "$localedir" = "\${datarootdir}/locale"; then
364 Linux | GNU | *BSD* | Darwin*)
365 CUPS_LOCALEDIR="$datarootdir/locale"
369 CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
373 # This is the standard System V location...
374 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
378 CUPS_LOCALEDIR="$localedir"
381 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
382 AC_SUBST(CUPS_LOCALEDIR)
385 AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
387 if test x$logdir = x; then
388 CUPS_LOGDIR="$localstatedir/log/cups"
389 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
391 CUPS_LOGDIR="$logdir"
393 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
394 AC_SUBST(CUPS_LOGDIR)
396 # Longer-term spool data
397 CUPS_REQUESTS="$localstatedir/spool/cups"
398 AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
399 AC_SUBST(CUPS_REQUESTS)
401 # Server executables...
404 # *BSD and Darwin (MacOS X)
406 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
410 INSTALL_SYSV="install-sysv"
411 CUPS_SERVERBIN="$exec_prefix/lib/cups"
415 AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
416 AC_SUBST(CUPS_SERVERBIN)
417 AC_SUBST(INSTALL_SYSV)
419 # Configuration files
420 CUPS_SERVERROOT="$sysconfdir/cups"
421 AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
422 AC_SUBST(CUPS_SERVERROOT)
424 # Transient run-time state
428 CUPS_STATEDIR="$CUPS_SERVERROOT"
432 CUPS_STATEDIR="$localstatedir/run/cups"
435 AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
436 AC_SUBST(CUPS_STATEDIR)