2 dnl Directory stuff for CUPS.
4 dnl Copyright 2007-2014 by Apple Inc.
5 dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
7 dnl These coded instructions, statements, and computer programs are the
8 dnl property of Apple Inc. and are protected by Federal copyright
9 dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 dnl which should have been included with this file. If this file is
11 dnl file is missing or damaged, see the license at "http://www.cups.org/".
16 dnl Fix "prefix" variable if it hasn't been specified...
17 if test "$prefix" = "NONE"; then
21 dnl Fix "exec_prefix" variable if it hasn't been specified...
22 if test "$exec_prefix" = "NONE"; then
23 if test "$prefix" = "/"; then
30 dnl Fix "bindir" variable...
31 if test "$bindir" = "\${exec_prefix}/bin"; then
32 bindir="$exec_prefix/bin"
35 AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir")
37 dnl Fix "sbindir" variable...
38 if test "$sbindir" = "\${exec_prefix}/sbin"; then
39 sbindir="$exec_prefix/sbin"
42 AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir")
44 dnl Fix "sharedstatedir" variable if it hasn't been specified...
45 if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
46 sharedstatedir="/usr/com"
49 dnl Fix "datarootdir" variable if it hasn't been specified...
50 if test "$datarootdir" = "\${prefix}/share"; then
51 if test "$prefix" = "/"; then
52 datarootdir="/usr/share"
54 datarootdir="$prefix/share"
58 dnl Fix "datadir" variable if it hasn't been specified...
59 if test "$datadir" = "\${prefix}/share"; then
60 if test "$prefix" = "/"; then
63 datadir="$prefix/share"
65 elif test "$datadir" = "\${datarootdir}"; then
66 datadir="$datarootdir"
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...
101 if test "$libdir" = "\${exec_prefix}/lib"; then
104 if test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot; then
105 libdir="$exec_prefix/lib64"
111 dnl Setup private include directory...
112 AC_ARG_WITH(privateinclude, [ --with-privateinclude set path for private include files, default=none],privateinclude="$withval",privateinclude="")
113 if test "x$privateinclude" != x -a "x$privateinclude" != xnone; then
114 PRIVATEINCLUDE="$privateinclude/cups"
119 AC_SUBST(privateinclude)
120 AC_SUBST(PRIVATEINCLUDE)
122 dnl LPD sharing support...
123 AC_ARG_WITH(lpdconfig, [ --with-lpdconfig set URI for LPD config file],
124 LPDCONFIG="$withval", LPDCONFIG="")
126 if test "x$LPDCONFIG" = x; then
127 if test -f /System/Library/LaunchDaemons/org.cups.cups-lpd.plist; then
128 LPDCONFIG="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
129 elif test "x$XINETD" != x; then
130 LPDCONFIG="xinetd://$XINETD/cups-lpd"
134 if test "x$LPDCONFIG" = xoff; then
135 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "")
137 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "$LPDCONFIG")
140 dnl SMB sharing support...
141 AC_ARG_WITH(smbconfig, [ --with-smbconfig set URI for Samba config file],
142 SMBCONFIG="$withval", SMBCONFIG="")
144 if test "x$SMBCONFIG" = x; then
145 if test -f /System/Library/LaunchDaemons/smbd.plist; then
146 SMBCONFIG="launchd:///System/Library/LaunchDaemons/smbd.plist"
148 for dir in /etc /etc/samba /usr/local/etc; do
149 if test -f $dir/smb.conf; then
150 SMBCONFIG="samba://$dir/smb.conf"
157 if test "x$SMBCONFIG" = xoff; then
158 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "")
160 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "$SMBCONFIG")
163 dnl Setup default locations...
165 AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
167 if test x$cachedir = x; then
168 if test "x$uname" = xDarwin; then
169 CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
171 CUPS_CACHEDIR="$localstatedir/cache/cups"
174 CUPS_CACHEDIR="$cachedir"
176 AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
177 AC_SUBST(CUPS_CACHEDIR)
180 CUPS_DATADIR="$datadir/cups"
181 AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
182 AC_SUBST(CUPS_DATADIR)
185 AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="")
187 if test "x$icondir" = x -a -d /usr/share/icons; then
188 ICONDIR="/usr/share/icons"
196 AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="")
198 if test "x$menudir" = x -a -d /usr/share/applications; then
199 MENUDIR="/usr/share/applications"
206 # Documentation files
207 AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
209 if test x$docdir = x; then
210 CUPS_DOCROOT="$datadir/doc/cups"
211 docdir="$datadir/doc/cups"
213 CUPS_DOCROOT="$docdir"
216 AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
217 AC_SUBST(CUPS_DOCROOT)
220 AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
222 if test "x$fontpath" = "x"; then
223 CUPS_FONTPATH="$datadir/cups/fonts"
225 CUPS_FONTPATH="$fontpath"
228 AC_SUBST(CUPS_FONTPATH)
229 AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
232 if test "$localedir" = "\${datarootdir}/locale"; then
234 Linux | GNU | *BSD* | Darwin*)
235 CUPS_LOCALEDIR="$datarootdir/locale"
239 # This is the standard System V location...
240 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
244 CUPS_LOCALEDIR="$localedir"
247 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
248 AC_SUBST(CUPS_LOCALEDIR)
251 AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
253 if test x$logdir = x; then
254 CUPS_LOGDIR="$localstatedir/log/cups"
255 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
257 CUPS_LOGDIR="$logdir"
259 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
260 AC_SUBST(CUPS_LOGDIR)
262 # Longer-term spool data
263 CUPS_REQUESTS="$localstatedir/spool/cups"
264 AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
265 AC_SUBST(CUPS_REQUESTS)
267 # Server executables...
270 # *BSD and Darwin (MacmacOS)
272 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
276 INSTALL_SYSV="install-sysv"
277 CUPS_SERVERBIN="$exec_prefix/lib/cups"
281 AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
282 AC_SUBST(CUPS_SERVERBIN)
283 AC_SUBST(INSTALL_SYSV)
285 # Configuration files
286 CUPS_SERVERROOT="$sysconfdir/cups"
287 AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
288 AC_SUBST(CUPS_SERVERROOT)
290 # Transient run-time state
291 AC_ARG_WITH(rundir, [ --with-rundir set transient run-time state directory],CUPS_STATEDIR="$withval",[
295 CUPS_STATEDIR="$CUPS_SERVERROOT"
299 CUPS_STATEDIR="$localstatedir/run/cups"
302 AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
303 AC_SUBST(CUPS_STATEDIR)