4 dnl Directory stuff for CUPS.
6 dnl Copyright 2007-2014 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 if test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot; then
107 libdir="$exec_prefix/lib64"
113 dnl Setup private include directory...
114 AC_ARG_WITH(privateinclude, [ --with-privateinclude set path for private include files, default=none],privateinclude="$withval",privateinclude="")
115 if test "x$privateinclude" != x -a "x$privateinclude" != xnone; then
116 PRIVATEINCLUDE="$privateinclude/cups"
121 AC_SUBST(privateinclude)
122 AC_SUBST(PRIVATEINCLUDE)
124 dnl LPD sharing support...
125 AC_ARG_WITH(lpdconfig, [ --with-lpdconfig set URI for LPD config file],
126 LPDCONFIG="$withval", LPDCONFIG="")
128 if test "x$LPDCONFIG" = x; then
129 if test -f /System/Library/LaunchDaemons/org.cups.cups-lpd.plist; then
130 LPDCONFIG="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
131 elif test "x$XINETD" != x; then
132 LPDCONFIG="xinetd://$XINETD/cups-lpd"
136 if test "x$LPDCONFIG" = xoff; then
137 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "")
139 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "$LPDCONFIG")
142 dnl SMB sharing support...
143 AC_ARG_WITH(smbconfig, [ --with-smbconfig set URI for Samba config file],
144 SMBCONFIG="$withval", SMBCONFIG="")
146 if test "x$SMBCONFIG" = x; then
147 if test -f /System/Library/LaunchDaemons/smbd.plist; then
148 SMBCONFIG="launchd:///System/Library/LaunchDaemons/smbd.plist"
150 for dir in /etc /etc/samba /usr/local/etc; do
151 if test -f $dir/smb.conf; then
152 SMBCONFIG="samba://$dir/smb.conf"
159 if test "x$SMBCONFIG" = xoff; then
160 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "")
162 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "$SMBCONFIG")
165 dnl Setup default locations...
167 AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
169 if test x$cachedir = x; then
170 if test "x$uname" = xDarwin; then
171 CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
173 CUPS_CACHEDIR="$localstatedir/cache/cups"
176 CUPS_CACHEDIR="$cachedir"
178 AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
179 AC_SUBST(CUPS_CACHEDIR)
182 CUPS_DATADIR="$datadir/cups"
183 AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
184 AC_SUBST(CUPS_DATADIR)
187 AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="")
189 if test "x$icondir" = x -a -d /usr/share/icons; then
190 ICONDIR="/usr/share/icons"
198 AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="")
200 if test "x$menudir" = x -a -d /usr/share/applications; then
201 MENUDIR="/usr/share/applications"
208 # Documentation files
209 AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
211 if test x$docdir = x; then
212 CUPS_DOCROOT="$datadir/doc/cups"
213 docdir="$datadir/doc/cups"
215 CUPS_DOCROOT="$docdir"
218 AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
219 AC_SUBST(CUPS_DOCROOT)
222 AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
224 if test "x$fontpath" = "x"; then
225 CUPS_FONTPATH="$datadir/cups/fonts"
227 CUPS_FONTPATH="$fontpath"
230 AC_SUBST(CUPS_FONTPATH)
231 AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
234 if test "$localedir" = "\${datarootdir}/locale"; then
236 Linux | GNU | *BSD* | Darwin*)
237 CUPS_LOCALEDIR="$datarootdir/locale"
241 # This is the standard System V location...
242 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
246 CUPS_LOCALEDIR="$localedir"
249 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
250 AC_SUBST(CUPS_LOCALEDIR)
253 AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
255 if test x$logdir = x; then
256 CUPS_LOGDIR="$localstatedir/log/cups"
257 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
259 CUPS_LOGDIR="$logdir"
261 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
262 AC_SUBST(CUPS_LOGDIR)
264 # Longer-term spool data
265 CUPS_REQUESTS="$localstatedir/spool/cups"
266 AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
267 AC_SUBST(CUPS_REQUESTS)
269 # Server executables...
272 # *BSD and Darwin (MacOS X)
274 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
278 INSTALL_SYSV="install-sysv"
279 CUPS_SERVERBIN="$exec_prefix/lib/cups"
283 AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
284 AC_SUBST(CUPS_SERVERBIN)
285 AC_SUBST(INSTALL_SYSV)
287 # Configuration files
288 CUPS_SERVERROOT="$sysconfdir/cups"
289 AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
290 AC_SUBST(CUPS_SERVERROOT)
292 # Transient run-time state
293 AC_ARG_WITH(rundir, [ --with-rundir set transient run-time state directory],CUPS_STATEDIR="$withval",[
297 CUPS_STATEDIR="$CUPS_SERVERROOT"
301 CUPS_STATEDIR="$localstatedir/run/cups"
304 AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
305 AC_SUBST(CUPS_STATEDIR)