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