dnl
-dnl "$Id: cups-directories.m4,v 1.12 2004/06/29 03:44:52 mike Exp $"
+dnl "$Id$"
dnl
dnl Directory stuff for the Common UNIX Printing System (CUPS).
dnl
-dnl Copyright 1997-2004 by Easy Software Products, all rights reserved.
+dnl Copyright 2007 by Apple Inc.
+dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
-dnl property of Easy Software Products and are protected by Federal
-dnl copyright law. Distribution and use rights are outlined in the file
-dnl "LICENSE.txt" which should have been included with this file. If this
-dnl file is missing or damaged please contact Easy Software Products
-dnl at:
-dnl
-dnl Attn: CUPS Licensing Information
-dnl Easy Software Products
-dnl 44141 Airport View Drive, Suite 204
-dnl Hollywood, Maryland 20636-3142 USA
-dnl
-dnl Voice: (301) 373-9600
-dnl EMail: cups-info@cups.org
-dnl WWW: http://www.cups.org
+dnl property of Apple Inc. and are protected by Federal copyright
+dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
+dnl which should have been included with this file. If this file is
+dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_PREFIX_DEFAULT(/)
-AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
-AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
-AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
-AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
-
dnl Fix "prefix" variable if it hasn't been specified...
if test "$prefix" = "NONE"; then
prefix="/"
fi
fi
+dnl Fix "bindir" variable...
+if test "$bindir" = "\${exec_prefix}/bin"; then
+ bindir="$exec_prefix/bin"
+fi
+
+AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir")
+
+dnl Fix "sbindir" variable...
+if test "$sbindir" = "\${exec_prefix}/sbin"; then
+ sbindir="$exec_prefix/sbin"
+fi
+
+AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir")
+
dnl Fix "sharedstatedir" variable if it hasn't been specified...
if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
sharedstatedir="/usr/com"
fi
+dnl Fix "datarootdir" variable if it hasn't been specified...
+if test "$datarootdir" = "\${prefix}/share"; then
+ if test "$prefix" = "/"; then
+ datarootdir="/usr/share"
+ else
+ datarootdir="$prefix/share"
+ fi
+fi
+
dnl Fix "datadir" variable if it hasn't been specified...
if test "$datadir" = "\${prefix}/share"; then
if test "$prefix" = "/"; then
else
datadir="$prefix/share"
fi
+elif test "$datadir" = "\${datarootdir}"; then
+ datadir="$datarootdir"
fi
dnl Fix "includedir" variable if it hasn't been specified...
dnl Fix "localstatedir" variable if it hasn't been specified...
if test "$localstatedir" = "\${prefix}/var"; then
if test "$prefix" = "/"; then
- localstatedir="/var"
+ if test "$uname" = Darwin; then
+ localstatedir="/private/var"
+ else
+ localstatedir="/var"
+ fi
else
localstatedir="$prefix/var"
fi
dnl Fix "sysconfdir" variable if it hasn't been specified...
if test "$sysconfdir" = "\${prefix}/etc"; then
if test "$prefix" = "/"; then
- sysconfdir="/etc"
+ if test "$uname" = Darwin; then
+ sysconfdir="/private/etc"
+ else
+ sysconfdir="/etc"
+ fi
else
sysconfdir="$prefix/etc"
fi
dnl Fix "libdir" variable for IRIX 6.x...
if test "$libdir" = "\${exec_prefix}/lib"; then
- libdir="$exec_prefix/lib"
+ if test "$uname" = "IRIX"; then
+ libdir="$exec_prefix/lib32"
+ else
+ if test "$uname" = Linux -a -d /usr/lib64; then
+ libdir="$exec_prefix/lib64"
+ else
+ libdir="$exec_prefix/lib"
+ fi
+ fi
fi
-if test "$uname" = "IRIX" -a $uversion -ge 62; then
- libdir="$exec_prefix/lib32"
-fi
+dnl Setup init.d locations...
+AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
+AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
+AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="99")
+AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="00")
-dnl Fix "fontpath" variable...
-if test "x$fontpath" = "x"; then
- fontpath="$datadir/cups/fonts"
-fi
+INITDIR=""
+INITDDIR=""
+RCLEVELS="$rclevels"
+RCSTART="$rcstart"
+RCSTOP="$rcstop"
-dnl Setup init.d locations...
if test x$rcdir = x; then
case "$uname" in
- FreeBSD* | OpenBSD*)
+ AIX*)
+ INITDIR="/etc/rc.d"
+ ;;
+
+ Darwin*)
+ # Darwin and MacOS X...
+ if test -x /sbin/launchd; then
+ INITDDIR="/System/Library/LaunchDaemons"
+ else
+ INITDDIR="/System/Library/StartupItems/PrintingServices"
+ fi
+ ;;
+
+ FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*)
# FreeBSD and OpenBSD
- INITDIR=""
- INITDDIR=""
;;
- NetBSD*)
- # NetBSD
- INITDIR=""
- INITDDIR="/etc/rc.d"
+ HP-UX*)
+ INITDIR="/sbin"
+ RCLEVELS="2"
+ RCSTART="620"
+ RCSTOP="380"
;;
- Darwin*)
- # Darwin and MacOS X...
- INITDIR=""
- INITDDIR="/System/Library/StartupItems/PrintingServices"
+ IRIX*)
+ # IRIX
+ INITDIR="/etc"
+ RCSTART="60"
+ RCSTOP="25"
;;
- Linux*)
- # Linux seems to choose an init.d directory at random...
+ Linux | GNU | GNU/k*BSD*)
+ # Linux/HURD seems to choose an init.d directory at random...
if test -d /sbin/init.d; then
# SuSE
INITDIR="/sbin/init.d"
- INITDDIR=".."
else
- if test -d /etc/rc.d; then
- # RedHat
- INITDIR="/etc/rc.d"
- INITDDIR="../init.d"
- else
+ if test -d /etc/init.d; then
# Others
INITDIR="/etc"
- INITDDIR="../init.d"
+ else
+ # RedHat
+ INITDIR="/etc/rc.d"
fi
fi
+ RCSTART="81"
+ RCSTOP="36"
+ ;;
+
+ NetBSD*)
+ # NetBSD
+ INITDDIR="/etc/rc.d"
;;
- OSF1* | HP-UX*)
+ OSF1*)
INITDIR="/sbin"
- INITDDIR="../init.d"
;;
- AIX*)
- INITDIR="/etc/rc.d"
- INITDDIR=".."
+ SunOS*)
+ # Solaris
+ INITDIR="/etc"
+ RCSTART="81"
;;
*)
INITDIR="/etc"
- INITDDIR="../init.d"
;;
esac
else
- INITDIR=""
- INITDDIR="$rcdir"
+ if test "x$rclevels" = x; then
+ INITDDIR="$rcdir"
+ else
+ INITDIR="$rcdir"
+ fi
fi
AC_SUBST(INITDIR)
AC_SUBST(INITDDIR)
+AC_SUBST(RCLEVELS)
+AC_SUBST(RCSTART)
+AC_SUBST(RCSTOP)
+
+dnl Xinetd support...
+AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],XINETD="$withval",XINETD="")
+
+if test "x$XINETD" = x -a ! -x /sbin/launchd; then
+ for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
+ if test -d $dir; then
+ XINETD="$dir"
+ break
+ fi
+ done
+fi
+
+AC_SUBST(XINETD)
dnl Setup default locations...
-CUPS_SERVERROOT="$sysconfdir/cups"
-CUPS_REQUESTS="$localstatedir/spool/cups"
+# Cache data...
+AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
-AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
-AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
+if test x$cachedir = x; then
+ if test "x$uname" = xDarwin; then
+ CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
+ else
+ CUPS_CACHEDIR="$localstatedir/cache/cups"
+ fi
+else
+ CUPS_CACHEDIR="$cachedir"
+fi
+AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
+AC_SUBST(CUPS_CACHEDIR)
+
+# Data files
+CUPS_DATADIR="$datadir/cups"
+AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
+AC_SUBST(CUPS_DATADIR)
+
+# Icon directory
+AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="")
+
+if test "x$icondir" = x -a -d /usr/share/icons; then
+ ICONDIR="/usr/share/icons"
+else
+ ICONDIR="$icondir"
+fi
+
+AC_SUBST(ICONDIR)
+
+# Menu directory
+AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="")
+
+if test "x$menudir" = x -a -d /usr/share/applications; then
+ MENUDIR="/usr/share/applications"
+else
+ MENUDIR="$menudir"
+fi
+
+AC_SUBST(MENUDIR)
+
+# Documentation files
+AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
+
+if test x$docdir = x; then
+ CUPS_DOCROOT="$datadir/doc/cups"
+ docdir="$datadir/doc/cups"
+else
+ CUPS_DOCROOT="$docdir"
+fi
+
+AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
+AC_SUBST(CUPS_DOCROOT)
+
+# Fonts
+AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
+
+if test "x$fontpath" = "x"; then
+ CUPS_FONTPATH="$datadir/cups/fonts"
+else
+ CUPS_FONTPATH="$fontpath"
+fi
+
+AC_SUBST(CUPS_FONTPATH)
+AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
+
+# Locale data
+if test "$localedir" = "\${datarootdir}/locale"; then
+ case "$uname" in
+ Linux | GNU | *BSD* | Darwin*)
+ CUPS_LOCALEDIR="$datarootdir/locale"
+ ;;
+
+ OSF1* | AIX*)
+ CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
+ ;;
+
+ *)
+ # This is the standard System V location...
+ CUPS_LOCALEDIR="$exec_prefix/lib/locale"
+ ;;
+ esac
+else
+ CUPS_LOCALEDIR="$localedir"
+fi
+
+AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
+AC_SUBST(CUPS_LOCALEDIR)
+
+# Log files...
+AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
if test x$logdir = x; then
CUPS_LOGDIR="$localstatedir/log/cups"
AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
else
CUPS_LOGDIR="$logdir"
- AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$logdir")
fi
+AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
+AC_SUBST(CUPS_LOGDIR)
+
+# Longer-term spool data
+CUPS_REQUESTS="$localstatedir/spool/cups"
+AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
+AC_SUBST(CUPS_REQUESTS)
-dnl See what directory to put server executables...
+# Server executables...
case "$uname" in
*BSD* | Darwin*)
# *BSD and Darwin (MacOS X)
INSTALL_SYSV=""
CUPS_SERVERBIN="$exec_prefix/libexec/cups"
- AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$exec_prefix/libexec/cups")
;;
*)
# All others
INSTALL_SYSV="install-sysv"
- CUPS_SERVERBIN="$libdir/cups"
- AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$libdir/cups")
+ CUPS_SERVERBIN="$exec_prefix/lib/cups"
;;
esac
-AC_SUBST(INSTALL_SYSV)
-AC_SUBST(CUPS_SERVERROOT)
+AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
AC_SUBST(CUPS_SERVERBIN)
-AC_SUBST(CUPS_LOGDIR)
-AC_SUBST(CUPS_REQUESTS)
-
-dnl Set the CUPS_LOCALE directory...
-case "$uname" in
- Linux* | *BSD* | Darwin*)
- CUPS_LOCALEDIR="$datadir/locale"
- AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$datadir/locale")
- ;;
-
- OSF1* | AIX*)
- CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
- AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$exec_prefix/lib/nls/msg")
- ;;
-
- *)
- # This is the standard System V location...
- CUPS_LOCALEDIR="$exec_prefix/lib/locale"
- AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$exec_prefix/lib/locale")
- ;;
-esac
-
-AC_SUBST(CUPS_LOCALEDIR)
-
-dnl Set the CUPS_DATADIR directory...
-CUPS_DATADIR="$datadir/cups"
-AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
-AC_SUBST(CUPS_DATADIR)
-
-dnl Set the CUPS_DOCROOT directory...
-if test x$docdir = x; then
- CUPS_DOCROOT="$datadir/doc/cups"
- docdir="$datadir/doc/cups"
-else
- CUPS_DOCROOT="$docdir"
-fi
+AC_SUBST(INSTALL_SYSV)
-AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
-AC_SUBST(CUPS_DOCROOT)
+# Configuration files
+CUPS_SERVERROOT="$sysconfdir/cups"
+AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
+AC_SUBST(CUPS_SERVERROOT)
-dnl Set the CUPS_FONTPATH directory...
-CUPS_FONTPATH="$fontpath"
-AC_SUBST(CUPS_FONTPATH)
-AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$fontpath")
+# Transient run-time state
+CUPS_STATEDIR="$localstatedir/run/cups"
+AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
+AC_SUBST(CUPS_STATEDIR)
dnl
-dnl End of "$Id: cups-directories.m4,v 1.12 2004/06/29 03:44:52 mike Exp $".
+dnl End of "$Id$".
dnl