]> 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
d09495fa 2dnl "$Id: cups-directories.m4 5905 2006-08-29 20:48:59Z mike $"
ef416fc2 3dnl
4dnl Directory stuff for the Common UNIX Printing System (CUPS).
5dnl
e1d6a774 6dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
ef416fc2 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
fa73b229 46AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir")
47
ef416fc2 48dnl Fix "sbindir" variable...
49if test "$sbindir" = "\${exec_prefix}/sbin"; then
50 sbindir="$exec_prefix/sbin"
51fi
52
fa73b229 53AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir")
54
ef416fc2 55dnl Fix "sharedstatedir" variable if it hasn't been specified...
56if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
57 sharedstatedir="/usr/com"
58fi
59
d09495fa 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
ef416fc2 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
d09495fa 76elif test "$datadir" = "\${datarootdir}"; then
77 datadir="$datarootdir"
ef416fc2 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
e1d6a774 113 if test "$uname" = "IRIX"; then
ef416fc2 114 libdir="$exec_prefix/lib32"
115 else
e1d6a774 116 if test "$uname" = Linux -a -d /usr/lib64; then
117 libdir="$exec_prefix/lib64"
118 else
119 libdir="$exec_prefix/lib"
120 fi
ef416fc2 121 fi
122fi
123
124dnl Setup init.d locations...
125AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
126
127if test x$rcdir = x; then
128 case "$uname" in
8ca02f3c 129 FreeBSD* | OpenBSD* | MirBsD* | ekkoBSD*)
ef416fc2 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=""
f301802f 144 if test -x /sbin/launchd; then
145 INITDDIR="/System/Library/LaunchDaemons"
146 else
147 INITDDIR="/System/Library/StartupItems/PrintingServices"
148 fi
ef416fc2 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
186else
187 INITDIR=""
188 INITDDIR="$rcdir"
189fi
190
191AC_SUBST(INITDIR)
192AC_SUBST(INITDDIR)
193
e1d6a774 194dnl Xinetd support...
195XINETD=""
d09495fa 196
197if 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
204fi
e1d6a774 205
206AC_SUBST(XINETD)
207
ef416fc2 208dnl Setup default locations...
209# Cache data...
210AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
211
212if test x$cachedir = x; then
a4d04587 213 if test "x$uname" = xDarwin; then
d09495fa 214 CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
a4d04587 215 else
216 CUPS_CACHEDIR="$localstatedir/cache/cups"
217 fi
ef416fc2 218else
219 CUPS_CACHEDIR="$cachedir"
220fi
221AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
222AC_SUBST(CUPS_CACHEDIR)
223
224# Data files
225CUPS_DATADIR="$datadir/cups"
226AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
227AC_SUBST(CUPS_DATADIR)
228
229# Documentation files
230AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
231
232if test x$docdir = x; then
233 CUPS_DOCROOT="$datadir/doc/cups"
234 docdir="$datadir/doc/cups"
235else
236 CUPS_DOCROOT="$docdir"
237fi
238
239AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
240AC_SUBST(CUPS_DOCROOT)
241
242# Fonts
243AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
244
245if test "x$fontpath" = "x"; then
246 CUPS_FONTPATH="$datadir/cups/fonts"
247else
248 CUPS_FONTPATH="$fontpath"
249fi
250
251AC_SUBST(CUPS_FONTPATH)
252AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
253
254# Locale data
255case "$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 ;;
268esac
269
270AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
271AC_SUBST(CUPS_LOCALEDIR)
272
273# Log files...
274AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
275
276if test x$logdir = x; then
277 CUPS_LOGDIR="$localstatedir/log/cups"
278 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
279else
280 CUPS_LOGDIR="$logdir"
281fi
282AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
283AC_SUBST(CUPS_LOGDIR)
284
285# Longer-term spool data
286CUPS_REQUESTS="$localstatedir/spool/cups"
287AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
288AC_SUBST(CUPS_REQUESTS)
289
290# Server executables...
291case "$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"
e1d6a774 300 CUPS_SERVERBIN="$exec_prefix/lib/cups"
ef416fc2 301 ;;
302esac
303
304AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
305AC_SUBST(CUPS_SERVERBIN)
306AC_SUBST(INSTALL_SYSV)
307
308# Configuration files
309CUPS_SERVERROOT="$sysconfdir/cups"
310AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
311AC_SUBST(CUPS_SERVERROOT)
312
313# Transient run-time state
314CUPS_STATEDIR="$localstatedir/run/cups"
315AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
316AC_SUBST(CUPS_STATEDIR)
317
318dnl
d09495fa 319dnl End of "$Id: cups-directories.m4 5905 2006-08-29 20:48:59Z mike $".
ef416fc2 320dnl