]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-directories.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-directories.m4
1 dnl
2 dnl "$Id: cups-directories.m4 5905 2006-08-29 20:48:59Z mike $"
3 dnl
4 dnl Directory stuff for the Common UNIX Printing System (CUPS).
5 dnl
6 dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
7 dnl
8 dnl These coded instructions, statements, and computer programs are the
9 dnl property of Easy Software Products and are protected by Federal
10 dnl copyright law. Distribution and use rights are outlined in the file
11 dnl "LICENSE.txt" which should have been included with this file. If this
12 dnl file is missing or damaged please contact Easy Software Products
13 dnl at:
14 dnl
15 dnl Attn: CUPS Licensing Information
16 dnl Easy Software Products
17 dnl 44141 Airport View Drive, Suite 204
18 dnl Hollywood, Maryland 20636 USA
19 dnl
20 dnl Voice: (301) 373-9600
21 dnl EMail: cups-info@cups.org
22 dnl WWW: http://www.cups.org
23 dnl
24
25 AC_PREFIX_DEFAULT(/)
26
27 dnl Fix "prefix" variable if it hasn't been specified...
28 if test "$prefix" = "NONE"; then
29 prefix="/"
30 fi
31
32 dnl Fix "exec_prefix" variable if it hasn't been specified...
33 if test "$exec_prefix" = "NONE"; then
34 if test "$prefix" = "/"; then
35 exec_prefix="/usr"
36 else
37 exec_prefix="$prefix"
38 fi
39 fi
40
41 dnl Fix "bindir" variable...
42 if test "$bindir" = "\${exec_prefix}/bin"; then
43 bindir="$exec_prefix/bin"
44 fi
45
46 AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir")
47
48 dnl Fix "sbindir" variable...
49 if test "$sbindir" = "\${exec_prefix}/sbin"; then
50 sbindir="$exec_prefix/sbin"
51 fi
52
53 AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir")
54
55 dnl Fix "sharedstatedir" variable if it hasn't been specified...
56 if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
57 sharedstatedir="/usr/com"
58 fi
59
60 dnl Fix "datarootdir" variable if it hasn't been specified...
61 if test "$datarootdir" = "\${prefix}/share"; then
62 if test "$prefix" = "/"; then
63 datarootdir="/usr/share"
64 else
65 datarootdir="$prefix/share"
66 fi
67 fi
68
69 dnl Fix "datadir" variable if it hasn't been specified...
70 if test "$datadir" = "\${prefix}/share"; then
71 if test "$prefix" = "/"; then
72 datadir="/usr/share"
73 else
74 datadir="$prefix/share"
75 fi
76 elif test "$datadir" = "\${datarootdir}"; then
77 datadir="$datarootdir"
78 fi
79
80 dnl Fix "includedir" variable if it hasn't been specified...
81 if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then
82 includedir="/usr/include"
83 fi
84
85 dnl Fix "localstatedir" variable if it hasn't been specified...
86 if test "$localstatedir" = "\${prefix}/var"; then
87 if test "$prefix" = "/"; then
88 if test "$uname" = Darwin; then
89 localstatedir="/private/var"
90 else
91 localstatedir="/var"
92 fi
93 else
94 localstatedir="$prefix/var"
95 fi
96 fi
97
98 dnl Fix "sysconfdir" variable if it hasn't been specified...
99 if test "$sysconfdir" = "\${prefix}/etc"; then
100 if test "$prefix" = "/"; then
101 if test "$uname" = Darwin; then
102 sysconfdir="/private/etc"
103 else
104 sysconfdir="/etc"
105 fi
106 else
107 sysconfdir="$prefix/etc"
108 fi
109 fi
110
111 dnl Fix "libdir" variable for IRIX 6.x...
112 if test "$libdir" = "\${exec_prefix}/lib"; then
113 if test "$uname" = "IRIX"; then
114 libdir="$exec_prefix/lib32"
115 else
116 if test "$uname" = Linux -a -d /usr/lib64; then
117 libdir="$exec_prefix/lib64"
118 else
119 libdir="$exec_prefix/lib"
120 fi
121 fi
122 fi
123
124 dnl Setup init.d locations...
125 AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
126
127 if test x$rcdir = x; then
128 case "$uname" in
129 FreeBSD* | OpenBSD* | MirBsD* | ekkoBSD*)
130 # FreeBSD and OpenBSD
131 INITDIR=""
132 INITDDIR=""
133 ;;
134
135 NetBSD*)
136 # NetBSD
137 INITDIR=""
138 INITDDIR="/etc/rc.d"
139 ;;
140
141 Darwin*)
142 # Darwin and MacOS X...
143 INITDIR=""
144 if test -x /sbin/launchd; then
145 INITDDIR="/System/Library/LaunchDaemons"
146 else
147 INITDDIR="/System/Library/StartupItems/PrintingServices"
148 fi
149 ;;
150
151 Linux | GNU)
152 # Linux/HURD seems to choose an init.d directory at random...
153 if test -d /sbin/init.d; then
154 # SuSE
155 INITDIR="/sbin/init.d"
156 INITDDIR=".."
157 else
158 if test -d /etc/init.d; then
159 # Others
160 INITDIR="/etc"
161 INITDDIR="../init.d"
162 else
163 # RedHat
164 INITDIR="/etc/rc.d"
165 INITDDIR="../init.d"
166 fi
167 fi
168 ;;
169
170 OSF1* | HP-UX*)
171 INITDIR="/sbin"
172 INITDDIR="../init.d"
173 ;;
174
175 AIX*)
176 INITDIR="/etc/rc.d"
177 INITDDIR=".."
178 ;;
179
180 *)
181 INITDIR="/etc"
182 INITDDIR="../init.d"
183 ;;
184
185 esac
186 else
187 INITDIR=""
188 INITDDIR="$rcdir"
189 fi
190
191 AC_SUBST(INITDIR)
192 AC_SUBST(INITDDIR)
193
194 dnl Xinetd support...
195 XINETD=""
196
197 if test ! -x /sbin/launchd; then
198 for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
199 if test -d $dir; then
200 XINETD="$dir"
201 break
202 fi
203 done
204 fi
205
206 AC_SUBST(XINETD)
207
208 dnl Setup default locations...
209 # Cache data...
210 AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
211
212 if test x$cachedir = x; then
213 if test "x$uname" = xDarwin; then
214 CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
215 else
216 CUPS_CACHEDIR="$localstatedir/cache/cups"
217 fi
218 else
219 CUPS_CACHEDIR="$cachedir"
220 fi
221 AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
222 AC_SUBST(CUPS_CACHEDIR)
223
224 # Data files
225 CUPS_DATADIR="$datadir/cups"
226 AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
227 AC_SUBST(CUPS_DATADIR)
228
229 # Documentation files
230 AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
231
232 if test x$docdir = x; then
233 CUPS_DOCROOT="$datadir/doc/cups"
234 docdir="$datadir/doc/cups"
235 else
236 CUPS_DOCROOT="$docdir"
237 fi
238
239 AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
240 AC_SUBST(CUPS_DOCROOT)
241
242 # Fonts
243 AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
244
245 if test "x$fontpath" = "x"; then
246 CUPS_FONTPATH="$datadir/cups/fonts"
247 else
248 CUPS_FONTPATH="$fontpath"
249 fi
250
251 AC_SUBST(CUPS_FONTPATH)
252 AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
253
254 # Locale data
255 case "$uname" in
256 Linux | GNU | *BSD* | Darwin*)
257 CUPS_LOCALEDIR="$datadir/locale"
258 ;;
259
260 OSF1* | AIX*)
261 CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
262 ;;
263
264 *)
265 # This is the standard System V location...
266 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
267 ;;
268 esac
269
270 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
271 AC_SUBST(CUPS_LOCALEDIR)
272
273 # Log files...
274 AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
275
276 if test x$logdir = x; then
277 CUPS_LOGDIR="$localstatedir/log/cups"
278 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
279 else
280 CUPS_LOGDIR="$logdir"
281 fi
282 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
283 AC_SUBST(CUPS_LOGDIR)
284
285 # Longer-term spool data
286 CUPS_REQUESTS="$localstatedir/spool/cups"
287 AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
288 AC_SUBST(CUPS_REQUESTS)
289
290 # Server executables...
291 case "$uname" in
292 *BSD* | Darwin*)
293 # *BSD and Darwin (MacOS X)
294 INSTALL_SYSV=""
295 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
296 ;;
297 *)
298 # All others
299 INSTALL_SYSV="install-sysv"
300 CUPS_SERVERBIN="$exec_prefix/lib/cups"
301 ;;
302 esac
303
304 AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
305 AC_SUBST(CUPS_SERVERBIN)
306 AC_SUBST(INSTALL_SYSV)
307
308 # Configuration files
309 CUPS_SERVERROOT="$sysconfdir/cups"
310 AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
311 AC_SUBST(CUPS_SERVERROOT)
312
313 # Transient run-time state
314 CUPS_STATEDIR="$localstatedir/run/cups"
315 AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
316 AC_SUBST(CUPS_STATEDIR)
317
318 dnl
319 dnl End of "$Id: cups-directories.m4 5905 2006-08-29 20:48:59Z mike $".
320 dnl