]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-directories.m4
40a17038a66482a4235615fa7708984177f08c56
[thirdparty/cups.git] / config-scripts / cups-directories.m4
1 dnl
2 dnl "$Id$"
3 dnl
4 dnl Directory stuff for CUPS.
5 dnl
6 dnl Copyright 2007-2014 by Apple Inc.
7 dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
8 dnl
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/".
14 dnl
15
16 AC_PREFIX_DEFAULT(/)
17
18 dnl Fix "prefix" variable if it hasn't been specified...
19 if test "$prefix" = "NONE"; then
20 prefix="/"
21 fi
22
23 dnl Fix "exec_prefix" variable if it hasn't been specified...
24 if test "$exec_prefix" = "NONE"; then
25 if test "$prefix" = "/"; then
26 exec_prefix="/usr"
27 else
28 exec_prefix="$prefix"
29 fi
30 fi
31
32 dnl Fix "bindir" variable...
33 if test "$bindir" = "\${exec_prefix}/bin"; then
34 bindir="$exec_prefix/bin"
35 fi
36
37 AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir")
38
39 dnl Fix "sbindir" variable...
40 if test "$sbindir" = "\${exec_prefix}/sbin"; then
41 sbindir="$exec_prefix/sbin"
42 fi
43
44 AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir")
45
46 dnl Fix "sharedstatedir" variable if it hasn't been specified...
47 if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
48 sharedstatedir="/usr/com"
49 fi
50
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"
55 else
56 datarootdir="$prefix/share"
57 fi
58 fi
59
60 dnl Fix "datadir" variable if it hasn't been specified...
61 if test "$datadir" = "\${prefix}/share"; then
62 if test "$prefix" = "/"; then
63 datadir="/usr/share"
64 else
65 datadir="$prefix/share"
66 fi
67 elif test "$datadir" = "\${datarootdir}"; then
68 datadir="$datarootdir"
69 fi
70
71 dnl Fix "includedir" variable if it hasn't been specified...
72 if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then
73 includedir="/usr/include"
74 fi
75
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"
81 else
82 localstatedir="/var"
83 fi
84 else
85 localstatedir="$prefix/var"
86 fi
87 fi
88
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"
94 else
95 sysconfdir="/etc"
96 fi
97 else
98 sysconfdir="$prefix/etc"
99 fi
100 fi
101
102 dnl Fix "libdir" variable...
103 if test "$libdir" = "\${exec_prefix}/lib"; then
104 case "$uname" in
105 Linux*)
106 if test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot; then
107 libdir="$exec_prefix/lib64"
108 fi
109 ;;
110 esac
111 fi
112
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"
117 else
118 privateinclude=""
119 PRIVATEINCLUDE=""
120 fi
121 AC_SUBST(privateinclude)
122 AC_SUBST(PRIVATEINCLUDE)
123
124 dnl LPD sharing support...
125 AC_ARG_WITH(lpdconfig, [ --with-lpdconfig set URI for LPD config file],
126 LPDCONFIG="$withval", LPDCONFIG="")
127
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"
133 fi
134 fi
135
136 if test "x$LPDCONFIG" = xoff; then
137 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "")
138 else
139 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "$LPDCONFIG")
140 fi
141
142 dnl SMB sharing support...
143 AC_ARG_WITH(smbconfig, [ --with-smbconfig set URI for Samba config file],
144 SMBCONFIG="$withval", SMBCONFIG="")
145
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"
149 else
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"
153 break
154 fi
155 done
156 fi
157 fi
158
159 if test "x$SMBCONFIG" = xoff; then
160 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "")
161 else
162 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "$SMBCONFIG")
163 fi
164
165 dnl Setup default locations...
166 # Cache data...
167 AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
168
169 if test x$cachedir = x; then
170 if test "x$uname" = xDarwin; then
171 CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
172 else
173 CUPS_CACHEDIR="$localstatedir/cache/cups"
174 fi
175 else
176 CUPS_CACHEDIR="$cachedir"
177 fi
178 AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
179 AC_SUBST(CUPS_CACHEDIR)
180
181 # Data files
182 CUPS_DATADIR="$datadir/cups"
183 AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
184 AC_SUBST(CUPS_DATADIR)
185
186 # Icon directory
187 AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="")
188
189 if test "x$icondir" = x -a -d /usr/share/icons; then
190 ICONDIR="/usr/share/icons"
191 else
192 ICONDIR="$icondir"
193 fi
194
195 AC_SUBST(ICONDIR)
196
197 # Menu directory
198 AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="")
199
200 if test "x$menudir" = x -a -d /usr/share/applications; then
201 MENUDIR="/usr/share/applications"
202 else
203 MENUDIR="$menudir"
204 fi
205
206 AC_SUBST(MENUDIR)
207
208 # Documentation files
209 AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
210
211 if test x$docdir = x; then
212 CUPS_DOCROOT="$datadir/doc/cups"
213 docdir="$datadir/doc/cups"
214 else
215 CUPS_DOCROOT="$docdir"
216 fi
217
218 AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
219 AC_SUBST(CUPS_DOCROOT)
220
221 # Fonts
222 AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
223
224 if test "x$fontpath" = "x"; then
225 CUPS_FONTPATH="$datadir/cups/fonts"
226 else
227 CUPS_FONTPATH="$fontpath"
228 fi
229
230 AC_SUBST(CUPS_FONTPATH)
231 AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
232
233 # Locale data
234 if test "$localedir" = "\${datarootdir}/locale"; then
235 case "$uname" in
236 Linux | GNU | *BSD* | Darwin*)
237 CUPS_LOCALEDIR="$datarootdir/locale"
238 ;;
239
240 *)
241 # This is the standard System V location...
242 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
243 ;;
244 esac
245 else
246 CUPS_LOCALEDIR="$localedir"
247 fi
248
249 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
250 AC_SUBST(CUPS_LOCALEDIR)
251
252 # Log files...
253 AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
254
255 if test x$logdir = x; then
256 CUPS_LOGDIR="$localstatedir/log/cups"
257 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
258 else
259 CUPS_LOGDIR="$logdir"
260 fi
261 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
262 AC_SUBST(CUPS_LOGDIR)
263
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)
268
269 # Server executables...
270 case "$uname" in
271 *BSD* | Darwin*)
272 # *BSD and Darwin (MacOS X)
273 INSTALL_SYSV=""
274 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
275 ;;
276 *)
277 # All others
278 INSTALL_SYSV="install-sysv"
279 CUPS_SERVERBIN="$exec_prefix/lib/cups"
280 ;;
281 esac
282
283 AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
284 AC_SUBST(CUPS_SERVERBIN)
285 AC_SUBST(INSTALL_SYSV)
286
287 # Configuration files
288 CUPS_SERVERROOT="$sysconfdir/cups"
289 AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
290 AC_SUBST(CUPS_SERVERROOT)
291
292 # Transient run-time state
293 AC_ARG_WITH(rundir, [ --with-rundir set transient run-time state directory],CUPS_STATEDIR="$withval",[
294 case "$uname" in
295 Darwin*)
296 # Darwin (OS X)
297 CUPS_STATEDIR="$CUPS_SERVERROOT"
298 ;;
299 *)
300 # All others
301 CUPS_STATEDIR="$localstatedir/run/cups"
302 ;;
303 esac])
304 AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
305 AC_SUBST(CUPS_STATEDIR)
306
307 dnl
308 dnl End of "$Id$".
309 dnl