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