]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-directories.m4
Import CUPS 1.4svn r7023 into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-directories.m4
1 dnl
2 dnl "$Id: cups-directories.m4 6975 2007-09-18 20:37:09Z mike $"
3 dnl
4 dnl Directory stuff for the Common UNIX Printing System (CUPS).
5 dnl
6 dnl Copyright 2007 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 IRIX*)
106 libdir="$exec_prefix/lib32"
107 ;;
108 Linux*)
109 if test -d /usr/lib64; then
110 libdir="$exec_prefix/lib64"
111 fi
112 ;;
113 HP-UX*)
114 if test -d /usr/lib/hpux32; then
115 libdir="$exec_prefix/lib/hpux32"
116 fi
117 ;;
118 esac
119 fi
120
121 dnl Setup init.d locations...
122 AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
123 AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
124 AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="99")
125 AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="00")
126
127 INITDIR=""
128 INITDDIR=""
129 RCLEVELS="$rclevels"
130 RCSTART="$rcstart"
131 RCSTOP="$rcstop"
132
133 if test x$rcdir = x; then
134 case "$uname" in
135 AIX*)
136 INITDIR="/etc/rc.d"
137 ;;
138
139 Darwin*)
140 # Darwin and MacOS X...
141 if test -x /sbin/launchd; then
142 INITDDIR="/System/Library/LaunchDaemons"
143 else
144 INITDDIR="/System/Library/StartupItems/PrintingServices"
145 fi
146 ;;
147
148 FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*)
149 # FreeBSD and OpenBSD
150 ;;
151
152 HP-UX*)
153 INITDIR="/sbin"
154 RCLEVELS="2"
155 RCSTART="380"
156 RCSTOP="620"
157 ;;
158
159 IRIX*)
160 # IRIX
161 INITDIR="/etc"
162 RCSTART="60"
163 RCSTOP="25"
164 ;;
165
166 Linux | GNU | GNU/k*BSD*)
167 # Linux/HURD seems to choose an init.d directory at random...
168 if test -d /sbin/init.d; then
169 # SuSE
170 INITDIR="/sbin/init.d"
171 else
172 if test -d /etc/init.d; then
173 # Others
174 INITDIR="/etc"
175 else
176 # RedHat
177 INITDIR="/etc/rc.d"
178 fi
179 fi
180 RCSTART="81"
181 RCSTOP="36"
182 ;;
183
184 NetBSD*)
185 # NetBSD
186 INITDDIR="/etc/rc.d"
187 ;;
188
189 OSF1*)
190 INITDIR="/sbin"
191 ;;
192
193 SunOS*)
194 # Solaris
195 INITDIR="/etc"
196 RCSTART="81"
197 ;;
198
199 *)
200 INITDIR="/etc"
201 ;;
202
203 esac
204 else
205 if test "x$rclevels" = x; then
206 INITDDIR="$rcdir"
207 else
208 INITDIR="$rcdir"
209 fi
210 fi
211
212 AC_SUBST(INITDIR)
213 AC_SUBST(INITDDIR)
214 AC_SUBST(RCLEVELS)
215 AC_SUBST(RCSTART)
216 AC_SUBST(RCSTOP)
217
218 dnl Xinetd support...
219 AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],XINETD="$withval",XINETD="")
220
221 if test "x$XINETD" = x -a ! -x /sbin/launchd; then
222 for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
223 if test -d $dir; then
224 XINETD="$dir"
225 break
226 fi
227 done
228 fi
229
230 AC_SUBST(XINETD)
231
232 dnl LPD sharing support...
233 AC_ARG_WITH(lpdconfig, [ --with-lpdconfig set URI for LPD config file],
234 LPDCONFIG="$withval", LPDCONFIG="")
235
236 if test "x$LPDCONFIG" = x; then
237 if test -f /System/Library/LaunchDaemons/org.cups.cups-lpd.plist; then
238 LPDCONFIG="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
239 elif test "x$XINETD" != x; then
240 LPDCONFIG="xinetd://$XINETD/cups-lpd"
241 fi
242 fi
243
244 if test "x$LPDCONFIG" = xoff; then
245 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "")
246 else
247 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "$LPDCONFIG")
248 fi
249
250 dnl SMB sharing support...
251 AC_ARG_WITH(smbconfig, [ --with-smbconfig set URI for Samba config file],
252 SMBCONFIG="$withval", SMBCONFIG="")
253
254 if test "x$SMBCONFIG" = x; then
255 if test -f /System/Library/LaunchDaemons/smbd.plist; then
256 SMBCONFIG="launchd:///System/Library/LaunchDaemons/smbd.plist"
257 else
258 for dir in /etc /etc/samba /usr/local/etc; do
259 if test -f $dir/smb.conf; then
260 SMBCONFIG="samba://$dir/smb.conf"
261 break
262 fi
263 done
264 fi
265 fi
266
267 if test "x$SMBCONFIG" = xoff; then
268 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "")
269 else
270 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "$SMBCONFIG")
271 fi
272
273 dnl Setup default locations...
274 # Cache data...
275 AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
276
277 if test x$cachedir = x; then
278 if test "x$uname" = xDarwin; then
279 CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
280 else
281 CUPS_CACHEDIR="$localstatedir/cache/cups"
282 fi
283 else
284 CUPS_CACHEDIR="$cachedir"
285 fi
286 AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
287 AC_SUBST(CUPS_CACHEDIR)
288
289 # Data files
290 CUPS_DATADIR="$datadir/cups"
291 AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
292 AC_SUBST(CUPS_DATADIR)
293
294 # Icon directory
295 AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="")
296
297 if test "x$icondir" = x -a -d /usr/share/icons; then
298 ICONDIR="/usr/share/icons"
299 else
300 ICONDIR="$icondir"
301 fi
302
303 AC_SUBST(ICONDIR)
304
305 # Menu directory
306 AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="")
307
308 if test "x$menudir" = x -a -d /usr/share/applications; then
309 MENUDIR="/usr/share/applications"
310 else
311 MENUDIR="$menudir"
312 fi
313
314 AC_SUBST(MENUDIR)
315
316 # Documentation files
317 AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
318
319 if test x$docdir = x; then
320 CUPS_DOCROOT="$datadir/doc/cups"
321 docdir="$datadir/doc/cups"
322 else
323 CUPS_DOCROOT="$docdir"
324 fi
325
326 AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
327 AC_SUBST(CUPS_DOCROOT)
328
329 # Fonts
330 AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
331
332 if test "x$fontpath" = "x"; then
333 CUPS_FONTPATH="$datadir/cups/fonts"
334 else
335 CUPS_FONTPATH="$fontpath"
336 fi
337
338 AC_SUBST(CUPS_FONTPATH)
339 AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
340
341 # Locale data
342 if test "$localedir" = "\${datarootdir}/locale"; then
343 case "$uname" in
344 Linux | GNU | *BSD* | Darwin*)
345 CUPS_LOCALEDIR="$datarootdir/locale"
346 ;;
347
348 OSF1* | AIX*)
349 CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
350 ;;
351
352 *)
353 # This is the standard System V location...
354 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
355 ;;
356 esac
357 else
358 CUPS_LOCALEDIR="$localedir"
359 fi
360
361 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
362 AC_SUBST(CUPS_LOCALEDIR)
363
364 # Log files...
365 AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
366
367 if test x$logdir = x; then
368 CUPS_LOGDIR="$localstatedir/log/cups"
369 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
370 else
371 CUPS_LOGDIR="$logdir"
372 fi
373 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
374 AC_SUBST(CUPS_LOGDIR)
375
376 # Longer-term spool data
377 CUPS_REQUESTS="$localstatedir/spool/cups"
378 AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
379 AC_SUBST(CUPS_REQUESTS)
380
381 # Server executables...
382 case "$uname" in
383 *BSD* | Darwin*)
384 # *BSD and Darwin (MacOS X)
385 INSTALL_SYSV=""
386 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
387 ;;
388 *)
389 # All others
390 INSTALL_SYSV="install-sysv"
391 CUPS_SERVERBIN="$exec_prefix/lib/cups"
392 ;;
393 esac
394
395 AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
396 AC_SUBST(CUPS_SERVERBIN)
397 AC_SUBST(INSTALL_SYSV)
398
399 # Configuration files
400 CUPS_SERVERROOT="$sysconfdir/cups"
401 AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
402 AC_SUBST(CUPS_SERVERROOT)
403
404 # Transient run-time state
405 CUPS_STATEDIR="$localstatedir/run/cups"
406 AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
407 AC_SUBST(CUPS_STATEDIR)
408
409 dnl
410 dnl End of "$Id: cups-directories.m4 6975 2007-09-18 20:37:09Z mike $".
411 dnl